"on_unitValue_changed": self._on_unit_value_changed,
"on_previousUnitValue_changed": self._on_previous_unit_value_changed,
"on_writeUnitsMenuItem_activate": self._on_user_write_units,
- "on_findButton_clicked": self._on_user_find_units,
- "on_findEntry_activated": self._on_user_find_units,
+ "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_messagebox_ok_clicked": self.messagebox_ok_clicked,
# Clear our user message
self._findLabel.set_text('')
- def _first_find(self):
+ def _find_first(self):
assert len(self._find_result) == 0
assert self._find_count == 0
findString = string.lower(string.strip(self._findEntry.get_text()))
self._categoryView.set_cursor(self._find_result[self._find_count][2], self._categoryColumn, False)
self._unitsView.set_cursor(self._find_result[self._find_count][3], self._unitNameColumn, True)
- def _on_user_find_units(self, a):
+ def _on_find_activate(self, a):
"""
check if 'new find' or 'last find' or 'next-find'
= self._find_count = 0 and len(self._find_result)>0
"""
if len(self._find_result) == 0:
- self._first_find()
+ self._find_first()
else:
if self._find_count == len(self._find_result)-1:
self._find_wrap_around()
#Since category has just been clicked, the list will be sorted already.
if self._selected_category in self._selected_units:
if self._selected_units[self._selected_category][0]:
- ''"debug ''"
#self._selected_units[self._selected_category] = [selected_unit, self._selected_units[self._selected_category][0]]
units = unit_data.UNIT_DESCRIPTIONS[self._selected_category].keys()