Add Ctrl+t key binding (and menu entry) for focusing the quick select entry
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 29 Apr 2007 20:51:31 +0000 (22:51 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 29 Apr 2007 20:51:31 +0000 (22:51 +0200)
src/gkofoto/glade/gkofoto.glade
src/packages/kofoto/gkofoto/categories.py

index 13cfcf6..8506318 100644 (file)
                      <accelerator key="s" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image893">
+                       <widget class="GtkImage" id="image1013">
                          <property name="visible">True</property>
                          <property name="stock">gtk-save</property>
                          <property name="icon_size">1</property>
                      <signal name="activate" handler="on_revert_activate" last_modification_time="Sat, 17 May 2003 15:02:14 GMT"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image894">
+                       <widget class="GtkImage" id="image1014">
                          <property name="visible">True</property>
                          <property name="stock">gtk-revert-to-saved</property>
                          <property name="icon_size">1</property>
                      <accelerator key="q" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image895">
+                       <widget class="GtkImage" id="image1015">
                          <property name="visible">True</property>
                          <property name="stock">gtk-quit</property>
                          <property name="icon_size">1</property>
                      <accelerator key="x" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image896">
+                       <widget class="GtkImage" id="image1016">
                          <property name="visible">True</property>
                          <property name="stock">gtk-cut</property>
                          <property name="icon_size">1</property>
                      <accelerator key="c" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image897">
+                       <widget class="GtkImage" id="image1017">
                          <property name="visible">True</property>
                          <property name="stock">gtk-copy</property>
                          <property name="icon_size">1</property>
                      <accelerator key="v" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image898">
+                       <widget class="GtkImage" id="image1018">
                          <property name="visible">True</property>
                          <property name="stock">gtk-paste</property>
                          <property name="icon_size">1</property>
                      <signal name="activate" handler="on_menubarDelete_activate" last_modification_time="Sun, 11 Jul 2004 19:26:27 GMT"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image899">
+                       <widget class="GtkImage" id="image1019">
                          <property name="visible">True</property>
                          <property name="stock">gtk-delete</property>
                          <property name="icon_size">1</property>
                      <signal name="activate" handler="on_destroy_activate" last_modification_time="Sun, 11 Jul 2004 19:26:27 GMT"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image900">
+                       <widget class="GtkImage" id="image1020">
                          <property name="visible">True</property>
                          <property name="stock">gtk-delete</property>
                          <property name="icon_size">1</property>
                      <signal name="activate" handler="on_clear_activate" last_modification_time="Sun, 11 Jul 2004 20:06:16 GMT"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image901">
+                       <widget class="GtkImage" id="image1021">
                          <property name="visible">True</property>
                          <property name="stock">gtk-clear</property>
                          <property name="icon_size">1</property>
                      <signal name="activate" handler="on_menubarProperties_activate" last_modification_time="Wed, 14 Jul 2004 10:12:21 GMT"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image902">
+                       <widget class="GtkImage" id="image1022">
                          <property name="visible">True</property>
                          <property name="stock">gtk-properties</property>
                          <property name="icon_size">1</property>
                      <property name="visible">True</property>
                      <property name="label" translatable="yes">_Table</property>
                      <property name="use_underline">True</property>
-                     <property name="active">True</property>
+                     <property name="active">False</property>
                      <signal name="activate" handler="on_table_view_activate" last_modification_time="Sun, 11 Jul 2004 19:28:48 GMT"/>
                    </widget>
                  </child>
                      <accelerator key="F6" modifiers="0" signal="activate"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image903">
+                       <widget class="GtkImage" id="image1023">
                          <property name="visible">True</property>
                          <property name="stock">gtk-go-forward</property>
                          <property name="icon_size">1</property>
                      <accelerator key="F6" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image904">
+                       <widget class="GtkImage" id="image1024">
                          <property name="visible">True</property>
                          <property name="stock">gtk-go-back</property>
                          <property name="icon_size">1</property>
                              <accelerator key="0" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 
                              <child internal-child="image">
-                               <widget class="GtkImage" id="image905">
+                               <widget class="GtkImage" id="image1025">
                                  <property name="visible">True</property>
                                  <property name="stock">gtk-zoom-100</property>
                                  <property name="icon_size">1</property>
                              <accelerator key="equal" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 
                              <child internal-child="image">
-                               <widget class="GtkImage" id="image906">
+                               <widget class="GtkImage" id="image1026">
                                  <property name="visible">True</property>
                                  <property name="stock">gtk-zoom-fit</property>
                                  <property name="icon_size">1</property>
                              <accelerator key="plus" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 
                              <child internal-child="image">
-                               <widget class="GtkImage" id="image907">
+                               <widget class="GtkImage" id="image1027">
                                  <property name="visible">True</property>
                                  <property name="stock">gtk-zoom-in</property>
                                  <property name="icon_size">1</property>
                              <accelerator key="minus" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 
                              <child internal-child="image">
-                               <widget class="GtkImage" id="image908">
+                               <widget class="GtkImage" id="image1028">
                                  <property name="visible">True</property>
                                  <property name="stock">gtk-zoom-out</property>
                                  <property name="icon_size">1</property>
                      <signal name="activate" handler="on_open_image_activate" last_modification_time="Sun, 11 Jul 2004 19:52:02 GMT"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image909">
+                       <widget class="GtkImage" id="image1029">
                          <property name="visible">True</property>
                          <property name="stock">gtk-open</property>
                          <property name="icon_size">1</property>
                      <signal name="activate" handler="on_menubarDuplicateAndOpenImage_activate" last_modification_time="Thu, 14 Jul 2005 10:29:29 GMT"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image910">
+                       <widget class="GtkImage" id="image1030">
                          <property name="visible">True</property>
                          <property name="stock">gtk-open</property>
                          <property name="icon_size">1</property>
                      <accelerator key="L" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image911">
+                       <widget class="GtkImage" id="image1031">
                          <property name="visible">True</property>
                          <property name="stock">gtk-add</property>
                          <property name="icon_size">1</property>
                      <accelerator key="R" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image912">
+                       <widget class="GtkImage" id="image1032">
                          <property name="visible">True</property>
                          <property name="stock">gtk-add</property>
                          <property name="icon_size">1</property>
                      <signal name="activate" handler="on_open_image_version(s)_in_external_program1_activate" last_modification_time="Wed, 13 Jul 2005 10:11:26 GMT"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image913">
+                       <widget class="GtkImage" id="image1033">
                          <property name="visible">True</property>
                          <property name="stock">gtk-open</property>
                          <property name="icon_size">1</property>
                      <signal name="activate" handler="on_menubarDuplicateAndOpenImageVersion_activate" last_modification_time="Thu, 14 Jul 2005 12:03:08 GMT"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image914">
+                       <widget class="GtkImage" id="image1034">
                          <property name="visible">True</property>
                          <property name="stock">gtk-open</property>
                          <property name="icon_size">1</property>
                      <signal name="activate" handler="on_rotate_left1_activate" last_modification_time="Wed, 13 Jul 2005 10:11:26 GMT"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image915">
+                       <widget class="GtkImage" id="image1035">
                          <property name="visible">True</property>
                          <property name="stock">gtk-add</property>
                          <property name="icon_size">1</property>
                      <signal name="activate" handler="on_rotate_right1_activate" last_modification_time="Wed, 13 Jul 2005 10:11:26 GMT"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image916">
+                       <widget class="GtkImage" id="image1036">
                          <property name="visible">True</property>
                          <property name="stock">gtk-add</property>
                          <property name="icon_size">1</property>
                      <signal name="activate" handler="on_menubarCreateRoot_activate" last_modification_time="Wed, 14 Jul 2004 10:12:21 GMT"/>
                    </widget>
                  </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator11">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menubarSetUnsetCategory">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Set/unset category</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_menuBarSetUnsetCategory_activate" last_modification_time="Sun, 29 Apr 2007 20:10:43 GMT"/>
+                     <accelerator key="T" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+                   </widget>
+                 </child>
                </widget>
              </child>
            </widget>
                      <signal name="activate" handler="on_about_activate" last_modification_time="Sun, 11 Jul 2004 20:05:01 GMT"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image917">
+                       <widget class="GtkImage" id="image1037">
                          <property name="visible">True</property>
                          <property name="stock">gtk-add</property>
                          <property name="icon_size">1</property>
                  </child>
 
                  <child>
-                   <widget class="GtkNotebook" id="notebook1">
+                   <widget class="GtkNotebook" id="categoriesNotebook">
                      <property name="visible">True</property>
                      <property name="can_focus">True</property>
                      <property name="show_tabs">True</property>
index 6ee6500..b19607e 100644 (file)
@@ -55,6 +55,8 @@ class Categories:
         #
         # Category quick select view
         #
+        env.widgets["menubarSetUnsetCategory"].connect(
+            "activate", self._setUnsetCategory_cb)
         self.__categoryQSModel = gtk.ListStore(
             gobject.TYPE_INT,      # CATEGORY_ID
             gobject.TYPE_STRING,   # DESCRIPTION
@@ -457,6 +459,11 @@ class Categories:
             env.widgets["autoExpand"].get_active(),
             env.widgets["autoCollapse"].get_active())
 
+    def _setUnsetCategory_cb(self, item):
+        env.widgets["sourceNotebook"].set_current_page(1)
+        env.widgets["categoriesNotebook"].set_current_page(1)
+        self.__categoryQSEntry.grab_focus()
+
 ######################################################################
 ### Private