Exemple #1
0
 def set_registered(self, is_registered):
     if is_simple_content_access():
         self.update_certificates_button.set_property("visible", False)
     else:
         self.update_certificates_button.set_property(
             'visible', is_registered)
     self.register_button.set_property('visible', not is_registered)
Exemple #2
0
    def __init__(self, backend, tab_icon, parent, ent_dir, prod_dir):
        # The row striping in this TreeView is handled automatically
        # because we have the rules_hint set to True in the Glade file.
        super(InstalledProductsTab, self).__init__()

        self.tab_icon = tab_icon

        self.identity = inj.require(inj.IDENTITY)
        self.entitlement_dir = ent_dir

        self.backend = backend

        # Product column
        text_renderer = ga_Gtk.CellRendererText()
        image_renderer = ga_Gtk.CellRendererPixbuf()
        column = ga_Gtk.TreeViewColumn(_('Product'))

        column.set_expand(True)
        column.pack_start(image_renderer, False)
        column.pack_start(text_renderer, False)
        column.add_attribute(image_renderer, 'pixbuf', self.store['image'])
        column.add_attribute(text_renderer, 'text', self.store['product'])
        self.top_view.append_column(column)
        cols = []
        cols.append((column, 'text', 'product'))

        column = self.add_text_column(_('Version'), 'version')
        cols.append((column, 'text', 'version'))

        column = self.add_text_column(_('Status'), 'status')
        cols.append((column, 'text', 'status'))

        column = self.add_date_column(_('Start Date'), 'start_date')
        cols.append((column, 'date', 'start_date'))

        column = self.add_date_column(_('End Date'), 'expiration_date')
        cols.append((column, 'date', 'expiration_date'))

        self.set_sorts(self.store, cols)

        if is_simple_content_access():
            self.update_certificates_button.set_property("visible", False)

        self.connect_signals({
            "on_update_certificates_button_clicked":
            parent._update_certificates_button_clicked,
            "on_register_button_clicked":
            parent._register_item_clicked,
        })

        self._entries = []