Пример #1
0
    def on_edit_categories_clicked(self, button, new=False):
        category = None

        # if new == True, a simpler categories dialog pops up
        self.window.category = self.category
        categories = CategoriesDialog(parent=self.window, new=new)
        ret = categories.run()

        if ret == gtk.RESPONSE_OK:
            #TODO: We should handle the saving in the dialog itself.
            # the category hasn't been saved yet... so save it.
            if new:
                categories._on_savebutton_clicked(None)
            category = categories.currentrecord

        categories.destroy()

        # Always re-populate the categories dropdown widget, regardless if
        # newer category was added. If something was returned, select it.
        if category:
            self._populate_category(category.name)
        else:
            self._populate_category()

        return ret
Пример #2
0
    def on_edit_categories_clicked(self, button, new = False):
        category = None

        # if new == True, a simpler categories dialog pops up
        self.window.category = self.category
        categories = CategoriesDialog(parent = self.window, new = new)
        ret = categories.run()

        if ret == gtk.RESPONSE_OK:
            #TODO: We should handle the saving in the dialog itself.
            # the category hasn't been saved yet... so save it.
            if new:
                categories._on_savebutton_clicked(None)
            category = categories.currentrecord

        categories.destroy()

        # Always re-populate the categories dropdown widget, regardless if
        # newer category was added. If something was returned, select it.
        if category:
            self._populate_category(category.name)
        else:
            self._populate_category()

        return ret
Пример #3
0
def categories_dialog(parent=None):
    categories = CategoriesDialog(parent=parent)
    ret = categories.run()
    pref.destroy()

    return ret
Пример #4
0
def categories_dialog(parent=None):
    categories = CategoriesDialog(parent=parent)
    ret = categories.run()
    pref.destroy()

    return ret