def __init__(self): TweakPage.__init__(self, _('Third-Party Software Sources'), _('After every release of Ubuntu there comes a feature freeze.\nThis means only applications with bug-fixes get into the repository.\nBy using third-party DEB repositories, you can always keep up-to-date with the latest version.\nAfter adding these repositories, locate and install them using Add/Remove.')) self.__config = Config() sw = gtk.ScrolledWindow() sw.set_shadow_type(gtk.SHADOW_ETCHED_IN) sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.pack_start(sw) self.treeview = SourcesView() self.treeview.connect('sourcechanged', self.colleague_changed) self.treeview.selection.connect('changed', self.on_selection_changed) self.treeview.set_sensitive(False) self.treeview.set_rules_hint(True) sw.add(self.treeview) self.expander = gtk.Expander(_('Details')) self.pack_start(self.expander, False, False, 0) self.sourcedetail = SourceDetail() self.expander.set_sensitive(False) self.expander.add(self.sourcedetail) hbox = gtk.HBox(False, 5) self.pack_end(hbox, False, False, 0) un_lock = PolkitButton() un_lock.connect('changed', self.on_polkit_action) hbox.pack_end(un_lock, False, False, 0) self.refresh_button = gtk.Button(stock = gtk.STOCK_REFRESH) self.refresh_button.set_sensitive(False) self.refresh_button.connect('clicked', self.on_refresh_button_clicked) hbox.pack_end(self.refresh_button, False, False, 0)
def __init__(self): super(PackageCleaner, self).__init__( _('Package Cleaner'), _('Free up disk space by removing unneeded packages and cleaning the package download cache.')) update_apt_cache(True) self.to_add = [] self.to_rm = [] self.button_list = [] self.current_button = 0 hbox = gtk.HBox(False, 0) self.pack_start(hbox, True, True, 0) sw = gtk.ScrolledWindow() sw.set_shadow_type(gtk.SHADOW_ETCHED_IN) sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) hbox.pack_start(sw) vbox = gtk.VBox(False, 8) hbox.pack_start(vbox, False, False, 5) # create tree view self.treeview = PackageView() self.treeview.set_rules_hint(True) self.treeview.connect('checked', self.on_item_checked) self.treeview.connect('cleaned', self.on_item_cleaned) sw.add(self.treeview) # create the button self.pkg_button = self.create_button(_('Clean Package'), gtk.image_new_from_pixbuf(get_icon_with_name('deb', 24)), self.treeview.update_package_model) vbox.pack_start(self.pkg_button, False, False, 0) self.cache_button = self.create_button(_('Clean Cache'), gtk.image_new_from_stock(gtk.STOCK_CLEAR, gtk.ICON_SIZE_BUTTON), self.treeview.update_cache_model) vbox.pack_start(self.cache_button, False, False, 0) self.config_button = self.create_button(_('Clean Config'), gtk.image_new_from_stock(gtk.STOCK_PREFERENCES, gtk.ICON_SIZE_BUTTON), self.treeview.update_config_model) vbox.pack_start(self.config_button, False, False, 0) self.kernel_button = self.create_button(_('Clean Kernel'), gtk.image_new_from_pixbuf(get_icon_with_name('start-here', 24)), self.treeview.update_kernel_model) vbox.pack_start(self.kernel_button, False, False, 0) # checkbutton self.select_button = gtk.CheckButton(_('Select All')) self.select_button.set_sensitive(False) self.__handler_id = self.select_button.connect('toggled', self.on_select_all) self.pack_start(self.select_button, False, False, 0) # button hbox = gtk.HBox(False, 0) self.pack_end(hbox, False ,False, 5) un_lock = PolkitButton() un_lock.connect('changed', self.on_polkit_action) hbox.pack_end(un_lock, False, False, 5) self.clean_button = gtk.Button(stock = gtk.STOCK_CLEAR) self.clean_button.connect('clicked', self.on_clean_button_clicked) self.clean_button.set_sensitive(False) hbox.pack_end(self.clean_button, False, False, 5) self.show_all()
def __init__(self): super(SourceEditor, self).__init__( _('Source Editor'), _('Freely edit your software sources to fit your needs.\n' 'Click "Update Sources" if you want to change the sources.\n' 'Click "Submit Sources" if you want to share your sources with other people.\n') ) self.online_data = {} hbox = gtk.HBox(False, 0) self.pack_start(hbox, True, True, 0) sw = gtk.ScrolledWindow() sw.set_shadow_type(gtk.SHADOW_ETCHED_IN) sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) hbox.pack_start(sw) vbox = gtk.VBox(False, 8) hbox.pack_start(vbox, False, False, 5) self.update_button = gtk.Button(stock = gtk.STOCK_GO_DOWN) set_label_for_stock_button(self.update_button, _('Update Sources')) self.update_button.set_sensitive(False) self.update_button.connect('clicked', self.on_update_button_clicked) vbox.pack_start(self.update_button, False, False, 0) self.submit_button = gtk.Button(stock = gtk.STOCK_GO_UP) set_label_for_stock_button(self.submit_button, _('Submit Sources')) self.submit_button.set_sensitive(False) self.submit_button.connect('clicked', self.on_submit_button_clicked) vbox.pack_start(self.submit_button, False, False, 0) self.textview = SourceView() self.textview.set_sensitive(False) sw.add(self.textview) buffer = self.textview.get_buffer() buffer.connect('changed', self.on_buffer_changed) # button hbox = gtk.HBox(False, 5) self.pack_end(hbox, False ,False, 5) self.save_button = gtk.Button(stock = gtk.STOCK_SAVE) self.save_button.set_sensitive(False) self.save_button.connect('clicked', self.on_save_button_clicked) hbox.pack_start(self.save_button, False, False, 0) self.redo_button = gtk.Button(stock = gtk.STOCK_REDO) self.redo_button.set_sensitive(False) self.redo_button.connect('clicked', self.on_redo_button_clicked) hbox.pack_start(self.redo_button, False, False, 0) un_lock = PolkitButton() un_lock.connect('changed', self.on_polkit_action) hbox.pack_end(un_lock, False, False, 0) self.refresh_button = gtk.Button(stock = gtk.STOCK_REFRESH) self.refresh_button.set_sensitive(False) self.refresh_button.connect('clicked', self.on_refresh_button_clicked) hbox.pack_end(self.refresh_button, False, False, 0) self.show_all()