예제 #1
0
    def __group_cell_func(self, col, cell, model, iter):
        obj = model.get_value(iter, 0)
        color, markup = self.style.mid[gtk.STATE_NORMAL], None

        if isinstance(obj, TFlag):
            color = None
            markup = '<b>%s</b>' % gobject.markup_escape_text(obj.ref)

        elif isinstance(obj, TField):
            # This is a property

            name = gobject.markup_escape_text(backend.get_field_name(obj.ref))
            proto = obj.proto

            if not backend.is_flags(obj.ref):
                color = None

            if backend.is_field_autofilled(obj.ref):
                markup = '<i>%s</i>' % name
            else:
                markup = '<b>%s</b>' % name
        else:
            # Ok. This is the protocol
            name = gobject.markup_escape_text(backend.get_proto_name(obj))
            markup = '<b>%s</b>' % name

        # Setting the values
        cell.set_property('cell-background-gdk', color)
        cell.set_property('markup', markup)
예제 #2
0
    def __pixbuf_cell_func(self, col, cell, model, iter):
        obj = model.get_value(iter, 0)

        icon, color = None, self.style.mid[gtk.STATE_NORMAL]

        if isinstance(obj, TFlag):
            color = None

        elif isinstance(obj, TField):
            if not backend.is_flags(obj.ref): # Not a flag container
                color = None

            if backend.is_field_autofilled(obj.ref):
                icon = self.icon_locked

        cell.set_property('cell-background-gdk', color)
        cell.set_property('pixbuf', icon)