From 32dd2323509e0856f50621ba5dfd076002f29899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Sun, 9 Oct 2016 09:03:21 -0500 Subject: [PATCH] Changes to keystrokes are reflected in keystroke editor automatically --- src/keystrokeEditor/keystrokeEditor.py | 1 + src/keystrokeEditor/wx_ui.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/keystrokeEditor/keystrokeEditor.py b/src/keystrokeEditor/keystrokeEditor.py index 5e0e800d..3f47abbc 100644 --- a/src/keystrokeEditor/keystrokeEditor.py +++ b/src/keystrokeEditor/keystrokeEditor.py @@ -28,6 +28,7 @@ class KeystrokeEditor(object): if new_keystroke != self.map[action]: self.changed = True self.map[action] = new_keystroke + self.dialog.put_keystrokes(constants.actions, self.map) def set_keystroke(self, keystroke, dialog): for i in keystroke.split("+"): diff --git a/src/keystrokeEditor/wx_ui.py b/src/keystrokeEditor/wx_ui.py index 700129c9..c8162ffa 100644 --- a/src/keystrokeEditor/wx_ui.py +++ b/src/keystrokeEditor/wx_ui.py @@ -29,6 +29,8 @@ class keystrokeEditorDialog(baseDialog.BaseWXDialog): self.SetClientSize(sizer.CalcMin()) def put_keystrokes(self, actions, keystrokes): + selection = self.keys.get_selected() + self.keys.clear() for i in keystrokes: if actions.has_key(i) == False: continue @@ -36,6 +38,7 @@ class keystrokeEditorDialog(baseDialog.BaseWXDialog): self.actions.append(i) keystroke = keystrokes[i] self.keys.insert_item(False, *[action, keystroke]) + self.keys.select_item(selection) def get_action(self): return self.keys.get_selected()