Ejemplo n.º 1
0
    def __init__(self, parent, library):
        super(EditTags, self).__init__(spacing=12)
        self.title = _("Edit Tags")
        self.set_border_width(12)

        model = Gtk.ListStore(str, str, bool, bool, bool, str, bool, str)
        view = RCMHintedTreeView(model)
        selection = view.get_selection()
        render = Gtk.CellRendererPixbuf()
        column = TreeViewColumn(_("Write"), render)

        style = view.get_style()
        pixbufs = [
            style.lookup_icon_set(stock).render_icon(style,
                                                     Gtk.TextDirection.NONE,
                                                     state, Gtk.IconSize.MENU,
                                                     view, None)
            for state in (Gtk.StateType.INSENSITIVE, Gtk.StateType.NORMAL)
            for stock in (Gtk.STOCK_EDIT, Gtk.STOCK_DELETE)
        ]

        def cdf_write(col, rend, model, iter, (write, delete)):
            row = model[iter]
            if row[CANEDIT]:
                rend.set_property('stock-id', None)
                rend.set_property('pixbuf',
                                  pixbufs[2 * row[EDITED] + row[DELETED]])
            else:
                rend.set_property('stock-id', Gtk.STOCK_DIALOG_AUTHENTICATION)
Ejemplo n.º 2
0
    def __init__(self, parent, library):
        super(EditTags, self).__init__(spacing=12)
        self.title = _("Edit Tags")
        self.set_border_width(12)

        model = gtk.ListStore(str, str, bool, bool, bool, str, bool, str)
        view = RCMHintedTreeView(model)
        selection = view.get_selection()
        render = gtk.CellRendererPixbuf()
        column = TreeViewColumn(_("Write"), render)

        style = view.get_style()
        pixbufs = [
            style.lookup_icon_set(stock).render_icon(style, gtk.TEXT_DIR_NONE, state, gtk.ICON_SIZE_MENU, view, None)
            for state in (gtk.STATE_INSENSITIVE, gtk.STATE_NORMAL)
            for stock in (gtk.STOCK_EDIT, gtk.STOCK_DELETE)
        ]

        def cdf_write(col, rend, model, iter, (write, delete)):
            row = model[iter]
            if row[CANEDIT]:
                rend.set_property("stock-id", None)
                rend.set_property("pixbuf", pixbufs[2 * row[EDITED] + row[DELETED]])
            else:
                rend.set_property("stock-id", gtk.STOCK_DIALOG_AUTHENTICATION)