From d9e992c0f22fd957dae98ffcf06d2200d50355d6 Mon Sep 17 00:00:00 2001 From: Mika Fischer Date: Tue, 2 Aug 2011 11:28:48 +0200 Subject: [PATCH] Add support for inserter hotkeys --- sloth/gui/propertyeditor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sloth/gui/propertyeditor.py b/sloth/gui/propertyeditor.py index 6f38d46..56e0f83 100644 --- a/sloth/gui/propertyeditor.py +++ b/sloth/gui/propertyeditor.py @@ -352,6 +352,12 @@ class PropertyEditor(QWidget): self._class_buttons[label_class] = button self._classbox_layout.addWidget(button) + # Add hotkey + if 'hotkey' in label_config: + hotkey = QShortcut(QKeySequence(label_config['hotkey']), self) + hotkey.activated.connect(button.click) + self._class_shortcuts[label_class] = hotkey + def parseConfiguration(self, label_class, label_config): attrs = label_config['attributes'] @@ -435,6 +441,7 @@ class PropertyEditor(QWidget): def _setupGUI(self): self._class_buttons = {} + self._class_shortcuts = {} self._label_editor = None # Label class buttons