예제 #1
0
    def on_apply_clicked(self, widget, box):
        to_add = []
        to_rm = []

        for widget in box.items:
            if widget.get_active():
                to_add.append(widget.pkgname)
            else:
                to_rm.append(widget.pkgname)

        self.PACKAGE_WORKER.perform_action(widget.get_toplevel(), to_add,
                                           to_rm)
        self.PACKAGE_WORKER.update_apt_cache(True)

        done = PACKAGE_WORKER.get_install_status(to_add, to_rm)

        if done:
            self.button.set_sensitive(False)
            InfoDialog(_('Update Successful!')).launch()
        else:
            InfoDialog(_('Update Failed!')).launch()
            for widget in box.items:
                widget.reset_active()

        CompizPlugin.update_context()
        self.remove_all_children()
        self.create_interface()

        self.show_all()
예제 #2
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()
예제 #3
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()
예제 #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', {})
예제 #5
0
 def upgrade_sources(self):
     dialog = QuestionDialog(_(
         'After a successful distribution upgrade, '
         'any third-party sources you use will be disabled by default.\n'
         'Would you like to re-enable any sources disabled by Update Manager?'
     ),
                             title=_('Upgrade Third Party Sources'))
     response = dialog.run()
     dialog.destroy()
     if response == gtk.RESPONSE_YES:
         proxy.upgrade_sources(self.__get_disable_string(), UPGRADE_DICT)
         if not self.check_source_upgradable():
             InfoDialog(_('Upgrade Successful!')).launch()
         else:
             ErrorDialog(_('Upgrade Failed!')).launch()
         self.emit('call', 'ubuntutweak.modules.sourceeditor',
                   'update_source_combo', {})
         self.update_thirdparty()
예제 #6
0
    def show_installed_status(self, to_add, to_rm):
        done = True

        for pkg in to_add:
            if not PackageInfo(pkg).check_installed():
                done = False
                break

        for pkg in to_rm:
            try:
                if PackageInfo(pkg).check_installed():
                    done = False
                    break
            except:
                pass

        if done:
            InfoDialog(_('Update Successful!')).launch()
        else:
            ErrorDialog(_('Update Failed!')).launch()
예제 #7
0
 def on_sync_button_clicked(self, widget):
     dialog = CheckSourceDialog(widget.get_toplevel(), self.url)
     dialog.run()
     dialog.destroy()
     if dialog.status == True:
         dialog = QuestionDialog(
             _("Update available, Would you like to update?"))
         response = dialog.run()
         dialog.destroy()
         if response == gtk.RESPONSE_YES:
             dialog = FetchingDialog(parent=self.get_toplevel(),
                                     url=get_source_data_url())
             dialog.connect('destroy', self.on_source_data_downloaded)
             dialog.run()
             dialog.destroy()
     elif dialog.error == True:
         ErrorDialog(
             _("Network Error, Please check your network connection or the remote server is down."
               )).launch()
     else:
         utdata.save_synced_timestamp(SOURCE_ROOT)
         self.update_timestamp()
         InfoDialog(_("No update available.")).launch()
예제 #8
0
    def on_apply_button_clicked(self, widget, data=None):
        to_rm = self.appview.to_rm
        to_add = self.appview.to_add
        self.package_worker.perform_action(widget.get_toplevel(), to_add,
                                           to_rm)

        self.package_worker.update_apt_cache(True)

        done = self.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.emit('call', 'ubuntutweak.modules.updatemanager', 'update_list',
                  {})

        self.appview.to_add = []
        self.appview.to_rm = []
        self.appview.clear_model()
        self.appview.update_model()
예제 #9
0
    def on_action_clicked(self, cell, path):
        iter = self.model.get_iter_from_string(path)
        installed = self.model.get_value(iter, self.COLUMN_ACTION)
        task = self.model.get_value(iter, self.COLUMN_TASK)
        name = self.model.get_value(iter, self.COLUMN_NAME)

        self.set_busy()
        updateview = UpdateView()
        updateview.set_headers_visible(False)

        if installed == 'Installed':
            dialog = InfoDialog(_('You\'ve installed the <b>"%s"</b> task.' % name))
            dialog.add_button(_('Remove'), gtk.RESPONSE_YES)
            res = dialog.run()
            dialog.destroy()
            if res == gtk.RESPONSE_YES:
                dialog = WarningDialog(_('It is dangerous to remove a task, it may remove the desktop related packages.\nPlease only continue when you know what you are doing.'),
                         title=_("Dangerous!"))
                res = dialog.run()
                dialog.destroy()

                if res == gtk.RESPONSE_YES:
                    data = os.popen('tasksel -t remove %s' % task).read()
                    pkgs = self.filter_remove_packages(data)
                    updateview.update_updates(pkgs)
                    updateview.select_all_action(True)

                    dialog = self.create_task_dialog(title=_('Packages will be removed'),
                            desc = _('You are going to remove the <b>"%s"</b> task.\nThe following packages will be remove.' % name),
                            updateview=updateview)

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

                    if res == gtk.RESPONSE_YES:
                        PACKAGE_WORKER.perform_action(self.get_toplevel(), [], updateview.to_add)
                        PACKAGE_WORKER.update_apt_cache(True)
                        self.update_model()
        else:
            list = os.popen('tasksel --task-packages %s' % task).read().split('\n')
            list = [pkg for pkg in list if pkg.strip() and not PackageInfo(pkg).check_installed()]

            updateview.update_updates(list)
            updateview.select_all_action(True)

            dialog = self.create_task_dialog(title=_('New packages will be installed'),
                    desc = _('You are going to install the <b>"%s"</b> task.\nThe following packager will be installed.' % name),
                    updateview=updateview)

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

            if res == gtk.RESPONSE_YES:
                PACKAGE_WORKER.perform_action(self.get_toplevel(), updateview.to_add, [])
                PACKAGE_WORKER.update_apt_cache(True)
                self.update_model()

        print self.model.get_value(iter, self.COLUMN_ACTION)

        self.unset_busy()
예제 #10
0
 def on_compositing_button_toggled(self, widget):
     if widget.get_active():
         InfoDialog(
             _('To enable Metacity\'s compositing feature, you should manually disable Visual Effects in "Appearance".'
               )).launch()
예제 #11
0
    def on_action_clicked(self, cell, path):
        iter = self.model.get_iter_from_string(path)
        installed = self.model.get_value(iter, self.COLUMN_ACTION)
        task = self.model.get_value(iter, self.COLUMN_TASK)
        name = self.model.get_value(iter, self.COLUMN_NAME)

        self.set_busy()
        updateview = UpdateView()
        updateview.set_headers_visible(False)

        if installed == 'Installed':
            dialog = InfoDialog(
                _('You\'ve installed the <b>"%s"</b> task.' % name))
            dialog.add_button(_('Remove'), gtk.RESPONSE_YES)
            res = dialog.run()
            dialog.destroy()
            if res == gtk.RESPONSE_YES:
                dialog = WarningDialog(_(
                    'It is dangerous to remove a task, it may remove the desktop related packages.\nPlease only continue when you know what you are doing.'
                ),
                                       title=_("Dangerous!"))
                res = dialog.run()
                dialog.destroy()

                if res == gtk.RESPONSE_YES:
                    data = os.popen('tasksel -t remove %s' % task).read()
                    pkgs = self.filter_remove_packages(data)
                    updateview.update_updates(pkgs)
                    updateview.select_all_action(True)

                    dialog = self.create_task_dialog(
                        title=_('Packages will be removed'),
                        desc=_(
                            'You are going to remove the <b>"%s"</b> task.\nThe following packages will be remove.'
                            % name),
                        updateview=updateview)

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

                    if res == gtk.RESPONSE_YES:
                        PACKAGE_WORKER.perform_action(self.get_toplevel(), [],
                                                      updateview.to_add)
                        PACKAGE_WORKER.update_apt_cache(True)
                        self.update_model()
        else:
            list = os.popen('tasksel --task-packages %s' %
                            task).read().split('\n')
            list = [
                pkg for pkg in list
                if pkg.strip() and not PackageInfo(pkg).check_installed()
            ]

            updateview.update_updates(list)
            updateview.select_all_action(True)

            dialog = self.create_task_dialog(
                title=_('New packages will be installed'),
                desc=_(
                    'You are going to install the <b>"%s"</b> task.\nThe following packager will be installed.'
                    % name),
                updateview=updateview)

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

            if res == gtk.RESPONSE_YES:
                PACKAGE_WORKER.perform_action(self.get_toplevel(),
                                              updateview.to_add, [])
                PACKAGE_WORKER.update_apt_cache(True)
                self.update_model()

        print self.model.get_value(iter, self.COLUMN_ACTION)

        self.unset_busy()
예제 #12
0
 def show_backup_successful_dialog(self):
     InfoDialog(_("Backup Successful!")).launch()
예제 #13
0
def refresh_source(parent):
    dialog = UpdateCacheDialog(parent)
    dialog.run()

    new_pkg = []
    for pkg in PACKAGE_WORKER.get_new_package():
        if pkg in APP_PARSER:
            new_pkg.append(pkg)

    new_updates = list(PACKAGE_WORKER.get_update_package())

    if new_pkg or new_updates:
        updateview = UpdateView()
        updateview.connect('select', on_select_action)

        if new_pkg:
            updateview.update_model(new_pkg)

        if new_updates:
            updateview.update_updates(new_updates)

        dialog = QuestionDialog(_(
            'You can install new applications by selecting them and choosing "Yes".\nOr you can install them at Application Center by choosing "No".'
        ),
                                title=_('New applications are available'))

        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)

        select_button = gtk.CheckButton(_('Select All'))
        select_button.connect('clicked', on_select_button_clicked, updateview)
        vbox.pack_start(select_button, False, False, 0)
        vbox.show_all()

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

        to_rm = updateview.to_rm
        to_add = updateview.to_add

        if res == gtk.RESPONSE_YES and 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 are no updates yet."),
            title=_('Software information is now up-to-date'))

        dialog.launch()
        return False
예제 #14
0
 def show_success_dialog(self):
     InfoDialog(_('Clean up successful!')).launch()
예제 #15
0
 def show_usercancel_dialog(self):
     InfoDialog(_('Cancelled by user!')).launch()