# Path: kano_settings/templates.py
# class Template(Gtk.Box):
# 
#     def __init__(
#         self,
#         title,
#         description,
#         button_text,
#         is_plug=False,
#         back_btn=False
#     ):
# 
#         Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
# 
#         self.title = Heading(title, description, is_plug, back_btn)
#         self.title.container.set_margin_bottom(0)
#         self.box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
#         self.align = Gtk.Alignment(xscale=0, yscale=0, xalign=0.5, yalign=0.3)
#         self.align.add(self.box)
#         self.kano_button = KanoButton(button_text)
#         self.kano_button.pack_and_align()
#         self.kano_button.align.set_padding(0, 30, 0, 0)
# 
#         self.pack_start(self.title.container, False, False, 0)
#         self.pack_start(self.align, True, True, 0)
#         self.pack_end(self.kano_button.align, False, False, 0)
# 
#     def set_prev_callback(self, cb):
#         self.title.set_prev_callback(cb)
# 
# Path: kano_settings/config_file.py
# def get_setting(variable):
# 
#     try:
#         value = read_json(settings_file)[variable]
#     except Exception:
#         if variable not in DEFAULTS:
#             logger.info("Defaults not found for variable: {}".format(variable))
#         value = DEFAULTS[variable]
#     return value


import threading
import kano_settings.system.keyboard_layouts as keyboard_layouts
import kano_settings.system.keyboard_config as keyboard_config
import kano_settings.common as common
from gi import require_version
from gi.repository import Gtk, GObject
from kano_settings.templates import Template
from kano_settings.config_file import get_setting
from kano.gtk3.buttons import OrangeButton
from kano.gtk3.kano_combobox import KanoComboBox
from kano.utils import detect_kano_keyboard
from kano.logging import logger
        self.kano_button.connect('button-release-event', self.win.go_to_home)
        self.win.change_prev_callback(self.win.go_to_home)

        self.box.pack_start(img, False, False, 0)
        self.box.pack_start(self.to_advance_button, False, False, 0)

        # Refresh window
        self.win.show_all()

    def to_advance(self, widget, event):

        self.win.clear_win()
        SetKeyboard(self.win)


class SetKeyboard(Template):
    selected_layout = None
    selected_continent_index = 1
    selected_country = None
    selected_country_index = 21
    selected_variant = None
    selected_variant_index = 0
    selected_continent_hr = 'America'
    selected_country_hr = 'USA'
    selected_variant_hr = 'generic'
    variants_combo = None
    continents = keyboard_layouts.get_continents()
    kano_keyboard = True

    def __init__(self, win):

# Path: kano_settings/templates.py
# class Template(Gtk.Box):
# 
#     def __init__(
#         self,
#         title,
#         description,
#         button_text,
#         is_plug=False,
#         back_btn=False
#     ):
# 
#         Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
# 
#         self.title = Heading(title, description, is_plug, back_btn)
#         self.title.container.set_margin_bottom(0)
#         self.box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
#         self.align = Gtk.Alignment(xscale=0, yscale=0, xalign=0.5, yalign=0.3)
#         self.align.add(self.box)
#         self.kano_button = KanoButton(button_text)
#         self.kano_button.pack_and_align()
#         self.kano_button.align.set_padding(0, 30, 0, 0)
# 
#         self.pack_start(self.title.container, False, False, 0)
#         self.pack_start(self.align, True, True, 0)
#         self.pack_end(self.kano_button.align, False, False, 0)
# 
#     def set_prev_callback(self, cb):
#         self.title.set_prev_callback(cb)
# 
# Path: kano_settings/config_file.py
# def get_setting(variable):
# 
#     try:
#         value = read_json(settings_file)[variable]
#     except Exception:
#         if variable not in DEFAULTS:
#             logger.info("Defaults not found for variable: {}".format(variable))
#         value = DEFAULTS[variable]
#     return value


# Path: kano_settings/set_keyboard.py
import threading
import kano_settings.system.keyboard_layouts as keyboard_layouts
import kano_settings.system.keyboard_config as keyboard_config
import kano_settings.common as common
from gi import require_version
from gi.repository import Gtk, GObject
from kano_settings.templates import Template
from kano_settings.config_file import get_setting
from kano.gtk3.buttons import OrangeButton
from kano.gtk3.kano_combobox import KanoComboBox
from kano.utils import detect_kano_keyboard
from kano.logging import logger

        self.kano_button.connect('button-release-event', self.win.go_to_home)
        self.win.change_prev_callback(self.win.go_to_home)

        self.box.pack_start(img, False, False, 0)
        self.box.pack_start(self.to_advance_button, False, False, 0)

        # Refresh window
        self.win.show_all()

    def to_advance(self, widget, event):

        self.win.clear_win()
        SetKeyboard(self.win)


class SetKeyboard(Template):
    selected_layout = None
    selected_continent_index = 1
    selected_country = None
    selected_country_index = 21
    selected_variant = None
    selected_variant_index = 0
    selected_continent_hr = 'America'
    selected_country_hr = 'USA'
    selected_variant_hr = 'generic'
    variants_combo = None
    continents = keyboard_layouts.get_continents()
    kano_keyboard = True

    def __init__(self, win):

        Template.__init__(