コード例 #1
0
    def __init__(self, controller, *args, **kwargs):
        self.controller = controller
        self.current_layout = None
        self.default_keyboard_layout = None
        self.default_keyboard_variant = None

        try:
            from PyQt5 import uic
            from PyQt5.QtWidgets import QVBoxLayout
            from ubiquity.frontend.kde_components.Keyboard import Keyboard

            self.page = uic.loadUi(
                '/usr/share/ubiquity/qt/stepKeyboardConf.ui')
            self.keyboardDisplay = Keyboard(self.page.keyboard_frame)
            self.page.keyboard_frame.setLayout(QVBoxLayout())
            self.page.keyboard_frame.layout().addWidget(self.keyboardDisplay)
            # use activated instead of changed because we only want to act
            # when the user changes the selection not when we are populating
            # the combo box
            self.page.keyboard_layout_combobox.activated.connect(
                self.on_keyboard_layout_selected)
            self.page.keyboard_variant_combobox.activated.connect(
                self.on_keyboard_variant_selected)
        except Exception as e:
            self.debug('Could not create keyboard page: %s', e)
            self.page = None
        self.plugin_widgets = self.page