def on_polkit_action(self, widget, action):
        if action:
            if proxy.get_proxy():
                self.treeview.set_sensitive(True)
                self.expander.set_sensitive(True)
                WARNING_KEY = '/apps/ubuntu-tweak/disable_thidparty_warning'

                if not self.__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'))
                    vbox = dialog.get_child()
                    hbox = gtk.HBox()
                    vbox.pack_start(hbox, False, False, 0)
                    checkbutton = GconfCheckButton(_('Never show this dialog'), WARNING_KEY)
                    hbox.pack_end(checkbutton, False, False, 0)
                    hbox.show_all()

                    dialog.run()
                    dialog.destroy()
            else:
                ServerErrorDialog().launch()
        else:
            AuthenticateFailDialog().launch()
 def on_polkit_action(self, widget, action):
     if action:
         if proxy.get_proxy():
             self.treeview.set_sensitive(True)
             self.select_button.set_sensitive(True)
         else:
             ServerErrorDialog().launch()
     else:
         AuthenticateFailDialog().launch()
    def destroy(self, widget, data = None):
        from common.policykit import proxy
        if proxy.get_proxy():
            state = proxy.get_list_state()
            if state == "expire":
                from thirdsoft import UpdateCacheDialog
                dialog = UpdateCacheDialog(self)
                res = dialog.run()

            proxy.exit()

        self.save_gui_state()
        gtk.main_quit()