- def _on_findEntry_changed(self, *args):
- """
- Clear out find results since the user wants to look for something new
- """
- try:
- self._clear_find()
- except Exception:
- _moduleLogger.exception()
-
- def _on_shortlist_changed(self, *args):
- try:
- raise NotImplementedError("%s" % self._shortlistcheck.get_active())
- except Exception:
- _moduleLogger.exception()
-
- def _on_edit_shortlist(self, *args):
- try:
- raise NotImplementedError("%s" % self._toggleShortList.get_active())
- except Exception:
- _moduleLogger.exception()
-
- def _on_user_clear_selections(self, *args):
- try:
- selectionsDatPath = "/".join((constants._data_path_, "selections.dat"))
- os.remove(selectionsDatPath)
- self._selected_units = {}
- except Exception:
- _moduleLogger.exception()
-
- def _on_find_activate(self, a):
- """
- check if 'new find' or 'last find' or 'next-find'
-
- new-find = run the find algorithm which also selects the first found unit
- = self._find_count = 0 and self._find_result = []
-
- last-find = restart from top again
- = self._find_count = len(self._find_result)
-
- next-find = continue to next found location
- = self._find_count = 0 and len(self._find_result)>0
- """
- try:
- if len(self._find_result) == 0:
- self._find_first()
- else:
- if self._find_count == len(self._find_result)-1:
- self._find_wrap_around()
- else:
- self._find_next()
-
- if not self._find_result:
- self._findLabel.set_text('Text not found')
- else:
- resultsLeft = len(self._find_result) - self._find_count - 1
- self._findLabel.set_text(
- '%s result(s) left' % (resultsLeft, )
- )
- except Exception:
- _moduleLogger.exception()
-
- def _on_click_unit_column(self, col):
- """
- Sort the contents of the col when the user clicks on the title.
- """
- #Determine which column requires sorting
- if col is self._unitNameColumn:
- selectedUnitColumn = 0
- self._unitNameColumn.set_sort_indicator(True)
- self._unitValueColumn.set_sort_indicator(False)
- self._unitSymbolColumn.set_sort_indicator(False)
- self._unitNameColumn.set_sort_order(not self._unit_sort_direction)
- elif col is self._unitValueColumn:
- selectedUnitColumn = 1
- self._unitNameColumn.set_sort_indicator(False)
- self._unitValueColumn.set_sort_indicator(True)
- self._unitSymbolColumn.set_sort_indicator(False)
- self._unitValueColumn.set_sort_order(not self._value_sort_direction)
- elif col is self._unitSymbolColumn:
- selectedUnitColumn = 2
- self._unitNameColumn.set_sort_indicator(False)
- self._unitValueColumn.set_sort_indicator(False)
- self._unitSymbolColumn.set_sort_indicator(True)
- self._unitSymbolColumn.set_sort_order(not self._units_sort_direction)