In prep for Fremantle support, removing autoconnect
authorEd Page <eopage@byu.net>
Wed, 4 Nov 2009 01:48:38 +0000 (19:48 -0600)
committerEd Page <eopage@byu.net>
Wed, 4 Nov 2009 01:48:38 +0000 (19:48 -0600)
data/gonvert.glade
src/gonvert_glade.py

index a11a816..cae7766 100644 (file)
@@ -22,7 +22,6 @@
                         <property name="visible">True</property>
                         <property name="label" translatable="yes">_Exit</property>
                         <property name="use_underline">True</property>
                         <property name="visible">True</property>
                         <property name="label" translatable="yes">_Exit</property>
                         <property name="use_underline">True</property>
-                        <signal name="activate" handler="on_exit_menu_activate"/>
                         <accelerator key="q" signal="activate" modifiers="GDK_CONTROL_MASK"/>
                       </widget>
                     </child>
                         <accelerator key="q" signal="activate" modifiers="GDK_CONTROL_MASK"/>
                       </widget>
                     </child>
@@ -43,7 +42,6 @@
                         <property name="tooltip" translatable="yes">Show shortlist selections</property>
                         <property name="label" translatable="yes">_Edit shortlist</property>
                         <property name="use_underline">True</property>
                         <property name="tooltip" translatable="yes">Show shortlist selections</property>
                         <property name="label" translatable="yes">_Edit shortlist</property>
                         <property name="use_underline">True</property>
-                        <signal name="activate" handler="on_editShortListMenuItem_activate"/>
                       </widget>
                     </child>
                     <child>
                       </widget>
                     </child>
                     <child>
@@ -52,7 +50,6 @@
                         <property name="tooltip" translatable="yes">Clear saved selections</property>
                         <property name="label" translatable="yes">_Clear selections</property>
                         <property name="use_underline">True</property>
                         <property name="tooltip" translatable="yes">Clear saved selections</property>
                         <property name="label" translatable="yes">_Clear selections</property>
                         <property name="use_underline">True</property>
-                        <signal name="activate" handler="on_clearSelectionMenuItem_activate"/>
                       </widget>
                     </child>
                   </widget>
                       </widget>
                     </child>
                   </widget>
@@ -71,7 +68,6 @@
                         <property name="visible">True</property>
                         <property name="label" translatable="yes">_About</property>
                         <property name="use_underline">True</property>
                         <property name="visible">True</property>
                         <property name="label" translatable="yes">_About</property>
                         <property name="use_underline">True</property>
-                        <signal name="activate" handler="on_aboutMenuItem_activate"/>
                       </widget>
                     </child>
                   </widget>
                       </widget>
                     </child>
                   </widget>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="headers_visible">False</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="headers_visible">False</property>
-                    <signal name="cursor_changed" handler="on_categoryView_select_row"/>
                   </widget>
                 </child>
               </widget>
                   </widget>
                 </child>
               </widget>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="invisible_char">&#x25CF;</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="invisible_char">&#x25CF;</property>
-                        <signal name="changed" handler="on_unitValue_changed"/>
                       </widget>
                       <packing>
                         <property name="position">1</property>
                       </widget>
                       <packing>
                         <property name="position">1</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="invisible_char">&#x25CF;</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="invisible_char">&#x25CF;</property>
-                        <signal name="changed" handler="on_previousUnitValue_changed"/>
                       </widget>
                       <packing>
                         <property name="position">1</property>
                       </widget>
                       <packing>
                         <property name="position">1</property>
                           <widget class="GtkTreeView" id="unitsView">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                           <widget class="GtkTreeView" id="unitsView">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                            <signal name="cursor_changed" handler="on_unitsView_cursor_changed"/>
                           </widget>
                         </child>
                       </widget>
                           </widget>
                         </child>
                       </widget>
                         <property name="can_focus">True</property>
                         <property name="tooltip" translatable="yes">Enter unit to find here</property>
                         <property name="invisible_char">&#x25CF;</property>
                         <property name="can_focus">True</property>
                         <property name="tooltip" translatable="yes">Enter unit to find here</property>
                         <property name="invisible_char">&#x25CF;</property>
-                        <signal name="changed" handler="on_findEntry_changed"/>
-                        <signal name="activate" handler="on_findEntry_activated"/>
                       </widget>
                       <packing>
                         <property name="expand">False</property>
                       </widget>
                       <packing>
                         <property name="expand">False</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
                         <property name="use_underline">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
                         <property name="use_underline">True</property>
-                        <signal name="clicked" handler="on_findButton_clicked"/>
                         <accelerator key="F6" signal="clicked"/>
                       </widget>
                       <packing>
                         <accelerator key="F6" signal="clicked"/>
                       </widget>
                       <packing>
                         <property name="receives_default">False</property>
                         <property name="use_underline">True</property>
                         <property name="draw_indicator">True</property>
                         <property name="receives_default">False</property>
                         <property name="use_underline">True</property>
                         <property name="draw_indicator">True</property>
-                        <signal name="toggled" handler="on_shortlistcheck_toggled"/>
                       </widget>
                       <packing>
                         <property name="expand">False</property>
                       </widget>
                       <packing>
                         <property name="expand">False</property>
index 7166f47..ec9469b 100755 (executable)
@@ -2,8 +2,6 @@
 # -*- coding: UTF8 -*-
 
 """
 # -*- coding: UTF8 -*-
 
 """
-@todo Get rid of autoconnects except for menus
-
 @todo Look into using two columns for displaying the value, split by the
 decimal place.  The left one would be right aligned and the right would be left
 aligned (only if not in exponential notation
 @todo Look into using two columns for displaying the value, split by the
 decimal place.  The left one would be right aligned and the right would be left
 aligned (only if not in exponential notation
@@ -191,25 +189,23 @@ class Gonvert(object):
                        self._categoryModel.append(row)
 
                #--------- connections to GUI ----------------
                        self._categoryModel.append(row)
 
                #--------- connections to GUI ----------------
-               dic = {
-                       "on_exit_menu_activate": self._on_user_exit,
-                       "on_categoryView_select_row": self._on_click_category,
-                       "on_unitValue_changed": self._on_unit_value_changed,
-                       "on_previousUnitValue_changed": self._on_previous_unit_value_changed,
-                       "on_findButton_clicked": self._on_find_activate,
-                       "on_findEntry_activated": self._on_find_activate,
-                       "on_findEntry_changed": self._on_findEntry_changed,
-                       "on_aboutMenuItem_activate": self._on_about_clicked,
-                       "on_clearSelectionMenuItem_activate": self._on_user_clear_selections,
-                       "on_unitsView_cursor_changed": self._on_click_unit,
-                       "on_shortlistcheck_toggled": self._on_shortlist_changed,
-                       "on_toggleShortList_activate": self._on_edit_shortlist,
-               }
-               widgets.signal_autoconnect(dic)
                self._mainWindow.connect("delete-event", self._on_user_exit)
                self._mainWindow.connect("key-press-event", self._on_key_press)
                self._mainWindow.connect("window-state-event", self._on_window_state_change)
                self._categorySelectionButton.connect("clicked", self._on_category_selector_clicked)
                self._mainWindow.connect("delete-event", self._on_user_exit)
                self._mainWindow.connect("key-press-event", self._on_key_press)
                self._mainWindow.connect("window-state-event", self._on_window_state_change)
                self._categorySelectionButton.connect("clicked", self._on_category_selector_clicked)
+               self._categoryView.connect("cursor-changed", self._on_click_category)
+               self._findButton.connect("clicked", self._on_find_activate)
+               self._findEntry.connect("activate", self._on_find_activate)
+               self._findEntry.connect("changed", self._on_findEntry_changed)
+               self._previousUnitValue.connect("changed", self._on_previous_unit_value_changed)
+               self._shortlistcheck.connect("toggled", self._on_shortlist_changed)
+               self._unitValue.connect("changed", self._on_unit_value_changed)
+               self._unitsView.connect("cursor-changed", self._on_click_unit)
+               if hildonize.GTK_MENU_USED:
+                       widgets.get_widget("aboutMenuItem").connect("activate", self._on_about_clicked)
+                       widgets.get_widget("clearSelectionMenuItem").connect("activate", self._on_user_clear_selections)
+                       widgets.get_widget("editShortListMenuItem").connect("activate", self._on_edit_shortlist)
+                       widgets.get_widget("exitMenuItem").connect("activate", self._on_user_exit)
 
                for scrollingWidgetName in (
                        "unitsViewScrolledWindow",
 
                for scrollingWidgetName in (
                        "unitsViewScrolledWindow",
@@ -232,6 +228,7 @@ class Gonvert(object):
                        widgets.get_widget("mainMenuBar"),
                        replacementButtons
                )
                        widgets.get_widget("mainMenuBar"),
                        replacementButtons
                )
+
                if not hildonize.IS_HILDON_SUPPORTED:
                        _moduleLogger.info("No hildonization support")
 
                if not hildonize.IS_HILDON_SUPPORTED:
                        _moduleLogger.info("No hildonization support")