Esempio n. 1
0
    def __show_successful_with_logout_button(self, message):
        dialog = InfoDialog(message)

        button = gtk.Button(_('_Logout'))
        button.connect('clicked', self.on_logout_button_clicked, dialog)
        dialog.add_option_button(button)

        dialog.launch()
Esempio n. 2
0
    def on_refresh_button_clicked(self, widget):
        UpdateCacheDialog(widget.get_toplevel()).run()

        PACKAGE_WORKER.update_apt_cache(True)
        self.select_button.set_active(False)

        new_updates = list(PACKAGE_WORKER.get_update_package())
        if new_updates:
            self.emit('call', 'ubuntutweak.modules.sourcecenter', 'update_thirdparty', {})
            self.updateview.get_model().clear()
            self.updateview.update_updates(new_updates)
        else:
            dialog = InfoDialog(_("Your system is clean and there's no update yet."),
                        title=_('The software information is up-to-date now'))

            dialog.launch()
Esempio n. 3
0
    def on_action_clicked(self, cell, path):
        iter = self.model.get_iter_from_string(path)
        installed = self.model.get_value(iter, COLUMN_ACTION)
        task = self.model.get_value(iter, COLUMN_TASK)
        name = self.model.get_value(iter, COLUMN_NAME)

        self.set_busy()

        if installed == 'Installed':
            #TODO install if not complete, and remove options
            dialog = InfoDialog(_('You\'ve installed the "%s" task.\n' % name))
            dialog.launch()
        else:
            updateview = UpdateView()
            updateview.set_headers_visible(False)

            list = os.popen('tasksel --task-packages %s' % task).read().split('\n')
            list = [i for i in list if i.strip()]

            updateview.update_updates(list)

            dialog = QuestionDialog(_('You are going to install the "%s" task.\nThe following packagers will be installed.' % name),
                title = _('New packages will be installed'))

            vbox = dialog.vbox
            sw = gtk.ScrolledWindow()
            sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
            sw.set_size_request(-1, 200)
            vbox.pack_start(sw, False, False, 0)
            sw.add(updateview)
            sw.show_all()

            res = dialog.run()
            dialog.destroy()

            if res == gtk.RESPONSE_YES:
                package_worker.perform_action(self.get_toplevel(), [task+'~'], [])
                package_worker.update_apt_cache(True)
                self.update_model()

        self.unset_busy()
Esempio n. 4
0
    def on_refresh_button_clicked(self, widget):
        do_ppa_disable = False
        if self.ppa_button.get_active():
            proxy.disable_ppa()
            do_ppa_disable = True

        UpdateCacheDialog(widget.get_toplevel()).run()

        PACKAGE_WORKER.update_apt_cache(True)

        new_updates = list(PACKAGE_WORKER.get_update_package())
        if new_updates:
            self.updateview.get_model().clear()
            self.updateview.update_updates(new_updates)
        else:
            dialog = InfoDialog(_("Your system is clean and no updates are available."),
                        title=_('Software information is now up-to-date'))

            dialog.launch()

        if do_ppa_disable:
            proxy.enable_ppa()
        self.emit('call', 'ubuntutweak.modules.sourcecenter', 'update_thirdparty', {})
        self.emit('call', 'ubuntutweak.modules.sourceeditor', 'update_source_combo', {})