Esempio n. 1
0
def refresh_source(parent):
    dialog = UpdateCacheDialog(parent)
    res = dialog.run()

    new_pkg = []
    for pkg in package_worker.get_new_package():
        if pkg in BUILTIN_APPS:
            new_pkg.append(pkg)

    new_updates = list(package_worker.get_update_package())

    if new_pkg or new_updates:
        updateview = UpdateView()
        updateview.set_headers_visible(False)

        if new_pkg:
            updateview.update_model(new_pkg)

        if new_updates:
            updateview.update_updates(package_worker.get_update_package())

        dialog = QuestionDialog(_('You can install the new applications by selecting them and choose "Yes".\nOr you can install them at Add/Remove by choose "No".'),
            title = _('New applications are available to update'))

        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:
            to_rm = updateview.to_rm
            to_add = updateview.to_add
            package_worker.perform_action(parent, to_add, to_rm)

            package_worker.update_apt_cache(True)

            done = package_worker.get_install_status(to_add, to_rm)

            if done:
                InfoDialog(_('Update Successful!')).launch()
            else:
                ErrorDialog(_('Update Failed!')).launch()

        return True
    else:
        dialog = InfoDialog(_("Your system is clean and there's no update yet."),
            title = _('The software information is up-to-date now'))

        dialog.launch()
        return False
Esempio n. 2
0
    def clean_selected_config(self):
        self.set_busy()
        model = self.get_model()

        dialog = CleanConfigDialog(self.get_toplevel(), self.get_list())
        if dialog.run() == gtk.RESPONSE_REJECT:
            dialog.destroy()
            dialog.user_action = True
            self.show_usercancel_dialog()
        else:
            self.show_success_dialog()

        package_worker.update_apt_cache(True)
        self.update_config_model()
        self.emit('cleaned')
        self.unset_busy()
Esempio n. 3
0
    def clean_selected_package(self):
        self.set_busy()
        state = self.package_worker.perform_action(self.get_toplevel(), [],self.__check_list)

        if state == 0:
            self.show_success_dialog()
        else:
            self.show_failed_dialog()

        package_worker.update_apt_cache(True)
        if self.mode == 'package':
            self.update_package_model()
        else:
            self.update_kernel_model()
        self.__check_list = []
        self.emit('cleaned')
        self.unset_busy()
Esempio n. 4
0
    def on_apply_button_clicked(self, widget, data = None):
        to_rm = self.appview.to_rm
        to_add = self.appview.to_add
        if self.show_changes():
            self.package_worker.perform_action(widget.get_toplevel(), to_add, to_rm)

            package_worker.update_apt_cache(True)

            done = package_worker.get_install_status(to_add, to_rm)

            if done:
                self.apply_button.set_sensitive(False)
                InfoDialog(_('Update Successful!')).launch()
            else:
                ErrorDialog(_('Update Failed!')).launch()

            self.appview.to_add = []
            self.appview.to_rm = []
            self.appview.clear_model()
            self.appview.update_model()
Esempio n. 5
0
 def deep_update(self):
     package_worker.update_apt_cache(True)
     self.update_app_data()