def __init__(self): TweakModule.__init__(self) box = ListPack(_("System Security options"), ( WidgetFactory.create( "GconfCheckButton", label=_("Disable \"Run Application\" dialog (Alt+F2)"), key="disable_command_line", enable_reset=True), WidgetFactory.create("GconfCheckButton", label=_('Disable "Lock Screen"'), key="disable_lock_screen", enable_reset=True), WidgetFactory.create("GconfCheckButton", label=_("Disable printing"), key="disable_printing", enable_reset=True), WidgetFactory.create("GconfCheckButton", label=_("Disable printer settings"), key="disable_print_setup", enable_reset=True), WidgetFactory.create("GconfCheckButton", label=_("Disable save to disk"), key="disable_save_to_disk", enable_reset=True), WidgetFactory.create("GconfCheckButton", label=_('Disable "Fast User Switching"'), key="disable_user_switching", enable_reset=True), ), padding=2) self.add_start(box, False, False, 0) self.fix_theme_button = gtk.CheckButton( _('Fix the appearance of themes when granted root privileges')) if proxy.is_exists(ROOT_THEMES) and proxy.is_exists(ROOT_ICONS): self.fix_theme_button.set_active(True) self.fix_theme_button.connect('toggled', self.on_fix_theme_btn_taggled) self.fix_theme_button.set_sensitive(False) box = ListPack(_('Miscellaneous Options'), (self.fix_theme_button, )) self.add_start(box, 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)
def __init__(self): TweakModule.__init__(self, 'sourcecenter.ui') self.url = SOURCE_VERSION_URL set_label_for_stock_button(self.sync_button, _('_Sync')) self.cateview = CategoryView(os.path.join(SOURCE_ROOT, 'cates.json')) self.cate_selection = self.cateview.get_selection() self.cate_selection.connect('changed', self.on_category_changed) self.left_sw.add(self.cateview) self.sourceview = SourcesView() self.sourceview.connect('sourcechanged', self.on_source_changed) self.sourceview.selection.connect('changed', self.on_selection_changed) self.sourceview.set_sensitive(False) self.sourceview.set_rules_hint(True) self.right_sw.add(self.sourceview) self.expander = gtk.Expander(_('Details')) self.vbox1.pack_start(self.expander, False, False, 0) self.sourcedetail = SourceDetail() self.expander.set_sensitive(False) self.expander.add(self.sourcedetail) un_lock = PolkitButton() un_lock.connect('changed', self.on_polkit_action) self.hbox2.pack_end(un_lock, False, False, 0) self.hbox2.reorder_child(un_lock, 0) #TODO when server is ready, work on it again # try: # if os.getenv('LANG').startswith('zh_CN'): # if TweakSettings.get_use_mirror_ppa(): # gobject.idle_add(self.start_check_cn_ppa) # else: # self.sourceview.unconver_ubuntu_cn_mirror() # except AttributeError: # pass # CONFIG.get_client().notify_add('/apps/ubuntu-tweak/use_mirror_ppa', # self.value_changed) self.update_timestamp() UPDATE_SETTING.set_value(False) UPDATE_SETTING.connect_notify(self.on_have_update, data=None) if TweakSettings.get_sync_notify(): thread.start_new_thread(self.check_update, ()) gobject.timeout_add(60000, self.update_timestamp) self.reparent(self.main_vbox)
def __init__(self): TweakModule.__init__(self, "loginsettings.ui") log.debug('Start to build "Session Options"') self.options_box = ListPack( _("Login Options"), ( WidgetFactory.create( "UserGconfCheckButton", user="******", label=_("Disable user list in gdm"), key="/apps/gdm/simple-greeter/disable_user_list", ), WidgetFactory.create( "UserGconfCheckButton", user="******", label=_("Play sound at login"), key="/desktop/gnome/sound/event_sounds", ), WidgetFactory.create( "UserGconfCheckButton", user="******", label=_("Disable showing the restart buttons"), key="/apps/gdm/simple-greeter/disable_restart_buttons", ), ), ) for item in self.options_box.items: log.debug("Set widget %s to sensitive False", item) item.set_sensitive(False) log.debug('Build "Session Options" finished') self.add_start(self.options_box, False, False, 0) self.icon_setting = UserGconfSetting("/apps/gdm/simple-greeter/logo_icon_name") self.icon_theme_setting = UserGconfSetting("/desktop/gnome/interface/icon_theme") self.__setup_logo_image() self.__setup_background_image() self.vbox1.unparent() self.vbox1.set_sensitive(False) box = ListPack(_("Login Theme"), (self.vbox1)) self.add_start(box, False, False, 0) hbox = gtk.HBox(False, 12) polkit_button = PolkitButton() polkit_button.connect("changed", self.on_polkit_action) hbox.pack_end(polkit_button, False, False, 0) self.add_start(hbox, False, False, 0)
def __init__(self): TweakModule.__init__(self) box = ListPack(_("System Security options"), ( WidgetFactory.create("GconfCheckButton", label=_("Disable \"Run Application\" dialog (Alt+F2)"), key="disable_command_line", enable_reset=True), WidgetFactory.create("GconfCheckButton", label=_('Disable "Lock Screen"'), key="disable_lock_screen", enable_reset=True), WidgetFactory.create("GconfCheckButton", label=_("Disable printing"), key="disable_printing", enable_reset=True), WidgetFactory.create("GconfCheckButton", label=_("Disable printer settings"), key="disable_print_setup", enable_reset=True), WidgetFactory.create("GconfCheckButton", label=_("Disable save to disk"), key="disable_save_to_disk", enable_reset=True), WidgetFactory.create("GconfCheckButton", label=_('Disable "Fast User Switching"'), key="disable_user_switching", enable_reset=True), ), padding=2) self.add_start(box, False, False, 0) self.fix_theme_button = gtk.CheckButton(_('Fix the appearance of themes when granted root privileges')) if proxy.is_exists(ROOT_THEMES) and proxy.is_exists(ROOT_ICONS): self.fix_theme_button.set_active(True) self.fix_theme_button.connect('toggled', self.on_fix_theme_btn_taggled) self.fix_theme_button.set_sensitive(False) box = ListPack(_('Miscellaneous Options'), (self.fix_theme_button,)) self.add_start(box, 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)
def __init__(self): TweakModule.__init__(self, 'loginsettings.ui') log.debug('Start to build "Session Options"') self.options_box = ListPack(_("Login Options"), ( WidgetFactory.create( "UserGconfCheckButton", user='******', label=_("Disable user list in GDM"), enable_reset=True, key="/apps/gdm/simple-greeter/disable_user_list"), WidgetFactory.create("UserGconfCheckButton", user='******', label=_("Play sound at login"), enable_reset=True, key="/desktop/gnome/sound/event_sounds"), WidgetFactory.create( "UserGconfCheckButton", user='******', label=_("Disable showing the restart button"), enable_reset=True, key="/apps/gdm/simple-greeter/disable_restart_buttons"), )) for item in self.options_box.items: log.debug('Set widget %s to sensitive False', item) item.set_sensitive(False) log.debug('Build "Session Options" finished') self.add_start(self.options_box, False, False, 0) self.icon_setting = UserGconfSetting( '/apps/gdm/simple-greeter/logo_icon_name') self.icon_theme_setting = UserGconfSetting( '/desktop/gnome/interface/icon_theme') self.__setup_logo_image() self.__setup_background_image() self.vbox1.unparent() self.vbox1.set_sensitive(False) box = ListPack(_('Login Theme'), (self.vbox1)) self.add_start(box, False, False, 0) hbox = gtk.HBox(False, 12) polkit_button = PolkitButton() polkit_button.connect('changed', self.on_polkit_action) hbox.pack_end(polkit_button, False, False, 0) self.add_start(hbox, False, False, 0)
def __init__(self): TweakModule.__init__(self, 'sourceeditor.ui') self.online_data = {} set_label_for_stock_button(self.update_button, _('Update Sources')) set_label_for_stock_button(self.submit_button, _('Submit Sources')) self.textview = SourceView(SOURCES_LIST) self.textview.set_sensitive(False) self.sw1.add(self.textview) buffer = self.textview.get_buffer() buffer.connect('changed', self.on_buffer_changed) self.setup_source_combo() self.update_source_combo() un_lock = PolkitButton() un_lock.connect('changed', self.on_polkit_action) self.hbox2.pack_end(un_lock, False, False, 0) self.hbox2.reorder_child(un_lock, 1)
def __init__(self): TweakModule.__init__(self, 'sourceeditor.ui') self.online_data = {} # set_label_for_stock_button(self.update_button, _('Update Sources')) # set_label_for_stock_button(self.submit_button, _('Submit Sources')) self.textview = SourceView(SOURCES_LIST) self.textview.set_sensitive(False) self.sw1.add(self.textview) buffer = self.textview.get_buffer() buffer.connect('changed', self.on_buffer_changed) self.setup_source_combo() self.update_source_combo() un_lock = PolkitButton() un_lock.connect('changed', self.on_polkit_action) self.hbuttonbox2.pack_end(un_lock, False, False, 0) self.reparent(self.main_vbox)
def __init__(self): TweakModule.__init__(self, 'thirdsoft.ui') self.cateview = CategoryView(os.path.join(SOURCE_ROOT, 'cates.json')) self.cate_selection = self.cateview.get_selection() self.cate_selection.connect('changed', self.on_category_changed) self.left_sw.add(self.cateview) self.sourceview = SourcesView() self.sourceview.connect('sourcechanged', self.colleague_changed) self.sourceview.selection.connect('changed', self.on_selection_changed) self.sourceview.set_sensitive(False) self.sourceview.set_rules_hint(True) self.right_sw.add(self.sourceview) self.expander = gtk.Expander(_('Details')) self.vbox1.pack_start(self.expander, False, False, 0) self.sourcedetail = SourceDetail() self.expander.set_sensitive(False) self.expander.add(self.sourcedetail) un_lock = PolkitButton() un_lock.connect('changed', self.on_polkit_action) self.hbox2.pack_end(un_lock, False, False, 0) self.hbox2.reorder_child(un_lock, 0) #FIXME China mirror hack if os.getenv('LANG').startswith('zh_CN'): if TweakSettings.get_use_mirror_ppa(): gobject.idle_add(self.start_check_cn_ppa) else: self.sourceview.unconver_ubuntu_cn_mirror() config.get_client().notify_add('/apps/ubuntu-tweak/use_mirror_ppa', self.value_changed) gobject.idle_add(self.on_idle_check)
def __init__(self): TweakModule.__init__(self) self.to_add = [] self.to_rm = [] self.button_list = [] self.current_button = 0 hbox = gtk.HBox(False, 0) self.add_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.add_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) set_label_for_stock_button(self.clean_button, _('_Cleanup')) 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): TweakModule.__init__(self, 'sourcecenter.ui') self.url = SOURCE_VERSION_URL set_label_for_stock_button(self.sync_button, _('_Sync')) self.sourceview = SourcesView() self.sourceview.set_status_active(TweakSettings.get_enable_new_item()) self.sourceview.update_model() self.sourceview.connect('sourcechanged', self.on_source_changed) self.sourceview.selection.connect('changed', self.on_selection_changed) self.sourceview.set_sensitive(False) self.sourceview.set_rules_hint(True) self.source_selection = self.sourceview.get_selection() self.source_selection.connect('changed', self.on_source_selection) self.right_sw.add(self.sourceview) self.cateview = CategoryView(os.path.join(SOURCE_ROOT, 'cates.json')) self.cateview.set_status_from_view(self.sourceview) self.cateview.update_model() self.cate_selection = self.cateview.get_selection() self.cate_selection.connect('changed', self.on_category_changed) self.left_sw.add(self.cateview) self.expander = gtk.Expander(_('Details')) self.vbox1.pack_start(self.expander, False, False, 0) self.sourcedetail = SourceDetail() self.expander.set_sensitive(False) self.expander.add(self.sourcedetail) un_lock = PolkitButton() un_lock.connect('changed', self.on_polkit_action) self.hbuttonbox1.pack_end(un_lock, False, False, 0) #TODO when server is ready, work on it again # try: # if os.getenv('LANG').startswith('zh_CN'): # if TweakSettings.get_use_mirror_ppa(): # gobject.idle_add(self.start_check_cn_ppa) # else: # self.sourceview.unconver_ubuntu_cn_mirror() # except AttributeError: # pass # CONFIG.get_client().notify_add('/apps/ubuntu-tweak/use_mirror_ppa', # self.value_changed) self.update_timestamp() UPDATE_SETTING.set_value(False) UPDATE_SETTING.connect_notify(self.on_have_update, data=None) if TweakSettings.get_sync_notify(): log.debug('Start check update') thread.start_new_thread(self.check_update, ()) gobject.timeout_add(60000, self.update_timestamp) if self.check_source_upgradable() and UPGRADE_DICT: gobject.idle_add(self.upgrade_sources) self.reparent(self.main_vbox)
def __init__(self): TweakModule.__init__(self) self.to_add = [] self.to_rm = [] self.button_list = [] self.current_button = 0 hbox = gtk.HBox(False, 12) self.add_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, 6) hbox.pack_start(vbox, False, False, 0) # 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 Packages'), gtk.image_new_from_pixbuf(icon.get_from_name('deb')), 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 Kernels'), gtk.image_new_from_pixbuf(icon.get_from_name('start-here')), self.treeview.update_kernel_model) vbox.pack_start(self.kernel_button, False, False, 0) self.ppa_button = self.create_button( _('Purge PPAs'), gtk.image_new_from_pixbuf(icon.get_from_name('start-here')), self.treeview.update_ppa_model) vbox.pack_start(self.ppa_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.add_start(self.select_button, False, False, 0) # button hbuttonbox = gtk.HButtonBox() hbuttonbox.set_spacing(12) hbuttonbox.set_layout(gtk.BUTTONBOX_END) self.add_end(hbuttonbox, False, False, 0) self.clean_button = gtk.Button(stock=gtk.STOCK_CLEAR) set_label_for_stock_button(self.clean_button, _('_Cleanup')) self.clean_button.connect('clicked', self.on_clean_button_clicked) self.clean_button.set_sensitive(False) hbuttonbox.pack_end(self.clean_button, False, False, 0) un_lock = PolkitButton() un_lock.connect('changed', self.on_polkit_action) hbuttonbox.pack_end(un_lock, False, False, 0) self.show_all()