diff options
author | Peng Wu <alexepico@gmail.com> | 2015-02-28 13:38:05 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2015-02-28 13:38:05 +0800 |
commit | 7735432908764b8ff0e5444279692ea8c2aaec55 (patch) | |
tree | caac6ad7768098110a5e65607420a32b75caa886 | |
parent | 29157570ceaade11ed51fbc45a48e952ef1eae6e (diff) | |
download | ibus-libpinyin-7735432908764b8ff0e5444279692ea8c2aaec55.tar.gz ibus-libpinyin-7735432908764b8ff0e5444279692ea8c2aaec55.tar.xz ibus-libpinyin-7735432908764b8ff0e5444279692ea8c2aaec55.zip |
select the first item in shortcut editor
-rw-r--r-- | setup/shortcuteditor.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/setup/shortcuteditor.py b/setup/shortcuteditor.py index a621e22..3ef76f1 100644 --- a/setup/shortcuteditor.py +++ b/setup/shortcuteditor.py @@ -162,16 +162,18 @@ class ShortcutEditor(Gtk.Box): # set default button self.__set_default_button = Gtk.Button(label = _("_Default"), use_underline = True) - self.__set_default_button.set_sensitive(False) self.__set_default_button.connect("clicked", self.__set_default_button_clicked_cb) hbox.pack_start(self.__set_default_button, False, True, 0) # edit button self.__edit_button = Gtk.Button(label= _("_Edit"), use_underline = True) - self.__edit_button.set_sensitive(False) self.__edit_button.connect("clicked", self.__edit_button_clicked_cb) hbox.pack_start(self.__edit_button, False, True, 0) self.pack_start(hbox, False, True, 4) + # select the first row + selection = self.__shortcut_treeview.get_selection() + selection.set_mode(Gtk.SelectionMode.SINGLE) + selection.select_path(Gtk.TreePath(0)) self.show_all() def __shortcut_treeview_cursor_changed_cb(self, treeview): |