def on_polkit_action(self, widget, action): if action: self.refresh_button.set_sensitive(True) if proxy.get_proxy(): if os.getenv('LANG').startswith('zh_CN'): self.sourceview.setup_ubuntu_cn_mirror() self.sourceview.set_sensitive(True) self.expander.set_sensitive(True) WARNING_KEY = '/apps/ubuntu-tweak/disable_thidparty_warning' if not config.get_value(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 on_polkit_action(self, widget, action): if action: self.sync_button.set_sensitive(True) if proxy.get_proxy(): # 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 on_polkit_action(self, widget, action): if action: if proxy.get_proxy(): 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_proxy(): 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()