Пример #1
0
    def do_action_for_app(self, pkgname, action_id, *args):
        action_id = int(action_id)

        if action_id == self.INSTALL_ACTION:
            set_busy(self)
            worker = AptWorker(self.get_toplevel(),
                               finish_handler=self.on_package_work_finished,
                               data={'parent': self})
            worker.install_packages([pkgname])

            self.update_action_button(self.INSTALLING_ACTION)
        elif action_id == self.UNINSTALL_ACTION:
            set_busy(self)
            worker = AptWorker(self.get_toplevel(),
                               finish_handler=self.on_package_work_finished,
                               data={'parent': self})
            worker.remove_packages([pkgname])

            self.update_action_button(self.UNINSTALLING_ACTION)
        elif action_id == self.UPDATE_ACTION:
            set_busy(self)
            worker = AptWorker(self.get_toplevel(),
                               finish_handler=self.on_update_work_finished,
                               data={'parent': self})
            worker.update_cache()
            self.update_action_button(self.UPDATING_ACTION)
Пример #2
0
    def do_action_for_app(self, pkgname, action_id, *args):
        action_id = int(action_id)

        if action_id == self.INSTALL_ACTION:
            set_busy(self)
            worker = AptWorker(self.get_toplevel(),
                               finish_handler=self.on_package_work_finished,
                               data={'parent': self})
            worker.install_packages([pkgname])

            self.update_action_button(self.INSTALLING_ACTION)
        elif action_id == self.UNINSTALL_ACTION:
            set_busy(self)
            worker = AptWorker(self.get_toplevel(),
                               finish_handler=self.on_package_work_finished,
                               data={'parent': self})
            worker.remove_packages([pkgname])

            self.update_action_button(self.UNINSTALLING_ACTION)
        elif action_id == self.UPDATE_ACTION:
            set_busy(self)
            worker = AptWorker(self.get_toplevel(),
                               finish_handler=self.on_update_work_finished,
                               data={'parent': self})
            worker.update_cache()
            self.update_action_button(self.UPDATING_ACTION)
Пример #3
0
    def on_update_button_clicked(self, widget):
        @log_func(log)
        def on_update_finished(transaction, status, parent):
            log.debug("on_update_finished")
            unset_busy(parent)

        set_busy(self)
        daemon = AptWorker(widget.get_toplevel(),
                           finish_handler=on_update_finished,
                           data=self)
        daemon.update_cache()

        self.emit('call', 'ubuntutweak.modules.appcenter', 'update_app_data', {})
        self.emit('call', 'ubuntutweak.modules.updatemanager', 'update_list', {})
Пример #4
0
    def on_update_button_clicked(self, widget):
        @log_func(log)
        def on_update_finished(transaction, status, parent):
            log.debug("on_update_finished")
            unset_busy(parent)

        set_busy(self)
        daemon = AptWorker(widget.get_toplevel(),
                           finish_handler=on_update_finished,
                           data=self)
        daemon.update_cache()

        self.emit('call', 'ubuntutweak.modules.appcenter', 'update_app_data',
                  {})
        self.emit('call', 'ubuntutweak.modules.updatemanager', 'update_list',
                  {})
Пример #5
0
 def on_update_button_clicked(self, widget):
     self.set_busy()
     daemon = AptWorker(widget.get_toplevel(),
                        lambda t, s, d: self.unset_busy())
     daemon.update_cache()
Пример #6
0
 def on_update_button_clicked(self, widget):
     self.set_busy()
     daemon = AptWorker(widget.get_toplevel(), lambda t, s, d: self.unset_busy())
     daemon.update_cache()
Пример #7
0
    def on_update_button_clicked(self, widget):
        daemon = AptWorker(widget.get_toplevel())
        daemon.update_cache()

        self.emit('call', 'ubuntutweak.modules.appcenter', 'update_app_data', {})
        self.emit('call', 'ubuntutweak.modules.updatemanager', 'update_list', {})