def on_polkit_action(self, widget, action): if action: self.sync_button.set_sensitive(True) if proxy.get_object(): # if os.getenv('LANG').startswith('zh_CN'): # self.sourceview.setup_ubuntu_cn_mirror() self.sourceview.set_sensitive(True) self.expander.set_sensitive(True) if not CONFIG.get_value_from_key(WARNING_KEY): dialog = WarningDialog(_( 'It is a possible security risk to ' 'use packages from Third-Party Sources.\n' 'Please be careful and use only sources you trust.'), buttons=gtk.BUTTONS_OK, title=_('Warning')) checkbutton = GconfCheckButton(_('Never show this dialog'), WARNING_KEY) dialog.add_widget(checkbutton) dialog.run() dialog.destroy() else: ServerErrorDialog().launch() else: AuthenticateFailDialog().launch()
def on_polkit_action(self, widget, action): if action: if proxy.get_object(): for item in self.options_box.items: item.set_sensitive(True) self.vbox1.set_sensitive(True) else: ServerErrorDialog().launch() else: AuthenticateFailDialog().launch()
def on_polkit_action(self, widget, action): if action: if proxy.get_object(): for item in self.options_box.items: item.set_sensitive(True) self.vbox1.set_sensitive(True) else: ServerErrorDialog().launch() else: AuthenticateFailDialog().launch()
def on_polkit_action(self, widget, action): if action: if proxy.get_object(): self.textview.set_sensitive(True) # self.update_button.set_sensitive(True) # self.submit_button.set_sensitive(True) self.refresh_button.set_sensitive(True) self.delete_button.set_sensitive(True) else: ServerErrorDialog().launch() else: AuthenticateFailDialog().launch()
def on_polkit_action(self, widget, action): if action: if proxy.get_object(): self.textview.set_sensitive(True) # self.update_button.set_sensitive(True) # self.submit_button.set_sensitive(True) self.refresh_button.set_sensitive(True) self.delete_button.set_sensitive(True) else: ServerErrorDialog().launch() else: AuthenticateFailDialog().launch()
def notify_stable_source(self): log.debug("Stable Source Warning is %s", CONFIG.get_value_from_key(WARNING_KEY)) log.debug("The Stable Source enabling is %s", proxy.get_stable_source_enabled()) if proxy.get_object() and not CONFIG.get_value_from_key(WARNING_KEY) and not proxy.get_stable_source_enabled(): dialog = WarningDialog(_('It is highly recommended that you enable the Ubuntu Tweak stable repository to get security and maintenance updates.\n' 'If you don\'t enable this repository, you will need to update manually.\n\n' 'Would you like to enable this repository?'), title=_('Warning')) checkbutton = GconfCheckButton(_('Never show this dialog'), WARNING_KEY) dialog.add_option(checkbutton) response = dialog.run() dialog.destroy() if response == gtk.RESPONSE_YES: log.debug("Start enable the source") proxy.enable_stable_source() log.debug("Finish enable the source, now it's %s", proxy.get_stable_source_enabled())
def on_polkit_action(self, widget, action): if action: self.sync_button.set_sensitive(True) if proxy.get_object(): # if os.getenv('LANG').startswith('zh_CN'): # self.sourceview.setup_ubuntu_cn_mirror() self.sourceview.set_sensitive(True) self.expander.set_sensitive(True) if not CONFIG.get_value_from_key(WARNING_KEY): dialog = WarningDialog(_('It is a possible security risk to ' 'use packages from Third-Party Sources.\n' 'Please be careful and use only sources you trust.'), buttons = gtk.BUTTONS_OK, title = _('Warning')) checkbutton = GconfCheckButton(_('Never show this dialog'), WARNING_KEY) dialog.add_option(checkbutton) dialog.run() dialog.destroy() else: ServerErrorDialog().launch() else: AuthenticateFailDialog().launch()
def notify_stable_source(self): log.debug("Stable Source Warning is %s", CONFIG.get_value_from_key(WARNING_KEY)) log.debug("The Stable Source enabling is %s", proxy.get_stable_source_enabled()) if proxy.get_object() and not CONFIG.get_value_from_key( WARNING_KEY) and not proxy.get_stable_source_enabled(): dialog = WarningDialog(_( 'It is highly recommended that you enable the Ubuntu Tweak stable repository to get security and maintenance updates.\n' 'If you don\'t enable this repository, you will need to update manually.\n\n' 'Would you like to enable this repository?'), title=_('Warning')) checkbutton = GconfCheckButton(_('Never show this dialog'), WARNING_KEY) dialog.add_widget(checkbutton) response = dialog.run() dialog.destroy() if response == gtk.RESPONSE_YES: log.debug("Start enable the source") proxy.enable_stable_source() log.debug("Finish enable the source, now it's %s", proxy.get_stable_source_enabled())