def _on_move_category(self, *args): if self._notizen.noteId == -1: mbox = gtk.MessageDialog(self._window, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _("No note selected.")) try: response = mbox.run() finally: mbox.hide() mbox.destroy() return sql = "SELECT id, liste FROM categories WHERE id = 0 ORDER BY liste" rows = self._db.ladeSQL(sql) selectableCategories = list(self._category.get_categories()) selectableCategories.remove(self._category.ALL_CATEGORIES) currentCategory = self._category.get_category_name() if currentCategory == self._category.ALL_CATEGORIES: currentCategory = selectableCategories[0] newCategory = hildonize.touch_selector_entry( self._window, "Move to", selectableCategories, currentCategory ) self._category.add_category(newCategory) noteid, pcdatum, category, note = self._db.loadNote(self._notizen.noteId) self._db.saveNote(noteid, note, newCategory, pcdatum = None) self._category.set_category() # HACK force it to update
def _on_category_selector(self, *args): window = gtk_toolbox.find_parent_window(self) userSelection = hildonize.touch_selector_entry( window, "Categories", self._categories, self.get_category_name(), ) self.set_category(userSelection)
def _on_category_selector(self, *args): window = gtk_toolbox.find_parent_window(self) userSelection = hildonize.touch_selector_entry( window, "Categories", self.__categories, self.__categoryButton.get_label(), ) self.set_category(userSelection) self.emit("changed", "category", "") self.db.speichereDirekt("comboCategoryText"+self.__listButton.get_label(), self.__categoryButton.get_label()) self.update_categories()