Пример #1
0
 def on_rebuild_clicked(self, widget):
     dialog = WarningDialog(_('This will delete all disabled templates.\nDo you wish to continue?'))
     if dialog.run() == gtk.RESPONSE_YES:
         self.default.remove()
         self.default.create()
         self.disable_templates.update_model()
     dialog.destroy()
Пример #2
0
 def colleague_changed(self, widget):
     enabled = self.recently_used.get_active()
     file = os.path.expanduser("~/.recently-used.xbel")
     if enabled:
         os.system('rm -r %s' % file)
         os.system('touch %s' % file)
     else:
         dialog = WarningDialog(_('Disabling "Recent Documents" may break other software, for example the history feature in VMware Player.'),
                                title=_("Warning"))
         if dialog.run() == gtk.RESPONSE_YES:
             os.system('rm -r %s' % file)
             os.system('mkdir %s' % file)
         else:
             widget.set_active(True)
         dialog.destroy()
Пример #3
0
    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()
Пример #4
0
    def notify_invalid_sources(self, disabled_list):
        treeview = ErrorListView(disabled_list)
        dialog = WarningDialog(
            _(
                'To keep the package manager work, Ubuntu Tweak has disabled these broken sources.\n\nIf you want to re-open these sources, Please try to correct it.\n\nYou can click "Help" to see the guide, then edit these sources at Source Editor.'
            ),
            title=_("The software sources list is broken"),
            buttons=gtk.BUTTONS_CLOSE,
        )

        dialog.add_widget_with_scrolledwindow(treeview, height=100)
        dialog.add_button(_("_Help"), gtk.RESPONSE_YES)

        response = dialog.run()
        dialog.destroy()
        if response == gtk.RESPONSE_YES:
            webbrowser.open("http://blog.ubuntu-tweak.com/guide/how-to-fix-the-source-list-files")
Пример #5
0
    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())