def __init__(self, cache, db, distro, icons, datadir, show_ratings=True): Gtk.VBox.__init__(self) BasePane.__init__(self) # other classes we need self.enquirer = AppEnquire(cache, db) self._query_complete_handler = self.enquirer.connect( "query-complete", self.on_query_complete) self.cache = cache self.db = db self.distro = distro self.icons = icons self.datadir = datadir self.show_ratings = show_ratings self.backend = get_install_backend() self.nonapps_visible = NonAppVisibility.MAYBE_VISIBLE # refreshes can happen out-of-bound so we need to be sure # that we only set the new model (when its available) if # the refresh_seq_nr of the ready model matches that of the # request (e.g. people click on ubuntu channel, get impatient, click # on partner channel) self.refresh_seq_nr = 0 # this should be initialized self.apps_search_term = "" # Create the basic frame for the common view self.state = DisplayState() vm = get_viewmanager() self.searchentry = vm.get_global_searchentry() self.back_forward = vm.get_global_backforward() # a notebook below self.notebook = Gtk.Notebook() if not "SOFTWARE_CENTER_DEBUG_TABS" in os.environ: self.notebook.set_show_tabs(False) self.notebook.set_show_border(False) # make a spinner view to display while the applist is loading self.spinner_notebook = SpinnerNotebook(self.notebook) self.pack_start(self.spinner_notebook, True, True, 0) # add a bar at the bottom (hidden by default) for contextual actions self.action_bar = ActionBar() self.pack_start(self.action_bar, False, True, 0) # cursor self.busy_cursor = Gdk.Cursor.new(Gdk.CursorType.WATCH) # views to be created in init_view self.app_view = None self.app_details_view = None
def __init__(self, cache, db, distro, icons, datadir, show_ratings=True): Gtk.VBox.__init__(self) BasePane.__init__(self) # other classes we need self.enquirer = AppEnquire(cache, db) self._query_complete_handler = self.enquirer.connect( "query-complete", self.on_query_complete) self.cache = cache self.db = db self.distro = distro self.icons = icons self.datadir = datadir self.show_ratings = show_ratings self.backend = get_install_backend() self.nonapps_visible = NonAppVisibility.MAYBE_VISIBLE # refreshes can happen out-of-bound so we need to be sure # that we only set the new model (when its available) if # the refresh_seq_nr of the ready model matches that of the # request (e.g. people click on ubuntu channel, get impatient, click # on partner channel) self.refresh_seq_nr = 0 # this should be initialized self.apps_search_term = "" # Create the basic frame for the common view self.state = DisplayState() vm = get_viewmanager() self.searchentry = vm.get_global_searchentry() self.back_forward = vm.get_global_backforward() # a notebook below self.notebook = Gtk.Notebook() if not SOFTWARE_CENTER_DEBUG_TABS: self.notebook.set_show_tabs(False) self.notebook.set_show_border(False) # make a spinner view to display while the applist is loading self.spinner_notebook = SpinnerNotebook(self.notebook) self.pack_start(self.spinner_notebook, True, True, 0) # add a bar at the bottom (hidden by default) for contextual actions self.action_bar = ActionBar() self.pack_start(self.action_bar, False, True, 0) # cursor self.busy_cursor = Gdk.Cursor.new(Gdk.CursorType.WATCH) # views to be created in init_view self.app_view = None self.app_details_view = None
def __init__(self, icons): Gtk.ScrolledWindow.__init__(self) BasePane.__init__(self) self.state = DisplayState() self.pane_name = _("Progress") self.tv = Gtk.TreeView() # customization self.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) self.add(self.tv) self.tv.set_headers_visible(False) self.tv.connect("button-press-event", self._on_button_pressed) # icon self.icons = icons tp = Gtk.CellRendererPixbuf() tp.set_property("xpad", self.CANCEL_XPAD) tp.set_property("ypad", self.CANCEL_YPAD) column = Gtk.TreeViewColumn("Icon", tp, pixbuf=PendingStore.COL_ICON) self.tv.append_column(column) # name tr = Gtk.CellRendererText() column = Gtk.TreeViewColumn("Name", tr, markup=PendingStore.COL_STATUS) column.set_min_width(200) column.set_expand(True) self.tv.append_column(column) # progress tp = Gtk.CellRendererProgress() tp.set_property("xpad", self.CANCEL_XPAD) tp.set_property("ypad", self.CANCEL_YPAD) tp.set_property("text", "") column = Gtk.TreeViewColumn("Progress", tp, value=PendingStore.COL_PROGRESS, pulse=PendingStore.COL_PULSE) column.set_min_width(200) self.tv.append_column(column) # cancel icon tpix = Gtk.CellRendererPixbuf() column = Gtk.TreeViewColumn("Cancel", tpix, stock_id=PendingStore.COL_CANCEL) self.tv.append_column(column) # fake columns that eats the extra space at the end tt = Gtk.CellRendererText() column = Gtk.TreeViewColumn("Cancel", tt) self.tv.append_column(column) # add it store = PendingStore(icons) self.tv.set_model(store)