From ff2602cfc356474d23e4aadde00ea71e482d4731 Mon Sep 17 00:00:00 2001 From: Huang Peng Date: Wed, 20 Aug 2008 15:08:18 +0800 Subject: [PATCH] Add add_shortcut method --- setup/keyboardshortcut.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup/keyboardshortcut.py b/setup/keyboardshortcut.py index 7a914d4..d794324 100644 --- a/setup/keyboardshortcut.py +++ b/setup/keyboardshortcut.py @@ -177,7 +177,6 @@ class KeyboardShortcutSelection(gtk.VBox): del model[path[0]] def __shortcut_view_cursor_changed_cb(self, treeview): - print "cursor changed" shortcut = self.__get_selected_shortcut() self.__set_shortcut_to_buttons(shortcut) @@ -240,6 +239,9 @@ class KeyboardShortcutSelectionDialog(gtk.Dialog): def set_shortcuts(self, shotrcuts = None): self.__selection_view.set_shortcuts(shotrcuts) + def add_shortcut(self, shotrcut): + self.__selection_view.add_shortcut(shotrcut) + def get_shortcuts(self): return self.__selection_view.get_shortcuts() @@ -249,7 +251,7 @@ if __name__ == "__main__": dlg = KeyboardShortcutSelectionDialog( title = "Select test", buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK, gtk.RESPONSE_OK)) - dlg.set_shortcuts(["Ctrl+Shift+space"]) + dlg.add_shortcut("Ctrl+Shift+space") print dlg.run() print dlg.get_shortcuts() -- 2.7.4