Пример #1
0
class ConfigWidget(ConfigWidgetBase):
    def genesis(self, gui):
        self.gui = gui
        self.conf_widget = ShortcutConfig(self)
        self.conf_widget.changed_signal.connect(self.changed_signal)
        self._layout = l = QVBoxLayout()
        self.setLayout(l)
        l.addWidget(self.conf_widget)

    def initialize(self):
        ConfigWidgetBase.initialize(self)
        self.conf_widget.initialize(self.gui.keyboard)

    def restore_defaults(self):
        ConfigWidgetBase.restore_defaults(self)
        self.conf_widget.restore_defaults()

    def commit(self):
        self.conf_widget.commit()
        return ConfigWidgetBase.commit(self)

    def refresh_gui(self, gui):
        gui.keyboard.finalize()

    def highlight_group(self, group_name):
        self.conf_widget.highlight_group(group_name)
Пример #2
0
class KeyboardConfigDialog(SizePersistedDialog):
    '''
    This dialog is used to allow editing of keyboard shortcuts.
    '''
    def __init__(self, gui, group_name):
        SizePersistedDialog.__init__(self, gui, 'Keyboard shortcut dialog')
        self.gui = gui
        self.setWindowTitle('Keyboard shortcuts')
        layout = QVBoxLayout(self)
        self.setLayout(layout)

        self.keyboard_widget = ShortcutConfig(self)
        layout.addWidget(self.keyboard_widget)
        self.group_name = group_name

        button_box = QDialogButtonBox(QDialogButtonBox.Ok
                                      | QDialogButtonBox.Cancel)
        button_box.accepted.connect(self.commit)
        button_box.rejected.connect(self.reject)
        layout.addWidget(button_box)

        # Cause our dialog size to be restored from prefs or created on first usage
        self.resize_dialog()
        self.initialize()

    def initialize(self):
        self.keyboard_widget.initialize(self.gui.keyboard)
        self.keyboard_widget.highlight_group(self.group_name)

    def commit(self):
        self.keyboard_widget.commit()
        self.accept()
Пример #3
0
class KeyboardConfigDialog(SizePersistedDialog):
    '''
    This dialog is used to allow editing of keyboard shortcuts.
    '''
    def __init__(self, gui, group_name):
        SizePersistedDialog.__init__(self, gui, 'Keyboard shortcut dialog')
        self.gui = gui
        self.setWindowTitle('Keyboard shortcuts')
        layout = QVBoxLayout(self)
        self.setLayout(layout)

        self.keyboard_widget = ShortcutConfig(self)
        layout.addWidget(self.keyboard_widget)
        self.group_name = group_name

        button_box = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        button_box.accepted.connect(self.commit)
        button_box.rejected.connect(self.reject)
        layout.addWidget(button_box)

        # Cause our dialog size to be restored from prefs or created on first usage
        self.resize_dialog()
        self.initialize()

    def initialize(self):
        self.keyboard_widget.initialize(self.gui.keyboard)
        self.keyboard_widget.highlight_group(self.group_name)

    def commit(self):
        self.keyboard_widget.commit()
        self.accept()
Пример #4
0
class ConfigWidget(ConfigWidgetBase):

    def genesis(self, gui):
        self.gui = gui
        self.conf_widget = ShortcutConfig(self)
        self.conf_widget.changed_signal.connect(self.changed_signal)
        self._layout = l = QVBoxLayout()
        self.setLayout(l)
        l.addWidget(self.conf_widget)

    def initialize(self):
        ConfigWidgetBase.initialize(self)
        self.conf_widget.initialize(self.gui.keyboard)

    def restore_defaults(self):
        ConfigWidgetBase.restore_defaults(self)
        self.conf_widget.restore_defaults()

    def commit(self):
        self.conf_widget.commit()
        return ConfigWidgetBase.commit(self)

    def refresh_gui(self, gui):
        gui.keyboard.finalize()

    def highlight_group(self, group_name):
        self.conf_widget.highlight_group(group_name)