mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 21:44:16 +02:00
uninstall refactoring
This commit is contained in:
@@ -140,11 +140,11 @@ class GenericApplicationManager(ApplicationManager):
|
||||
if man:
|
||||
return man.update(app, root_password)
|
||||
|
||||
def uninstall(self, app: Application, root_password: str) -> SystemProcess:
|
||||
def uninstall(self, app: Application, root_password: str, handler: ProcessHandler) -> bool:
|
||||
man = self._get_manager_for(app)
|
||||
|
||||
if man:
|
||||
return man.uninstall(app, root_password)
|
||||
return man.uninstall(app, root_password, handler)
|
||||
|
||||
def install(self, app: Application, root_password: str, handler: ProcessHandler) -> bool:
|
||||
man = self._get_manager_for(app)
|
||||
|
||||
@@ -95,7 +95,7 @@ class RefreshApps(QThread):
|
||||
self.signal.emit(self.manager.read_installed())
|
||||
|
||||
|
||||
class UninstallApp(AsyncAction):
|
||||
class UninstallApp(AsyncAction, ProcessHandler):
|
||||
signal_finished = pyqtSignal(object)
|
||||
signal_output = pyqtSignal(str)
|
||||
|
||||
@@ -108,8 +108,7 @@ class UninstallApp(AsyncAction):
|
||||
|
||||
def run(self):
|
||||
if self.app:
|
||||
process = self.manager.uninstall(self.app.model, self.root_password)
|
||||
success = self.notify_subproc_outputs(process, self.signal_output)
|
||||
success = self.manager.uninstall(self.app.model, self.root_password, self)
|
||||
|
||||
if success:
|
||||
self.icon_cache.delete(self.app.model.base_data.icon_url)
|
||||
@@ -119,6 +118,13 @@ class UninstallApp(AsyncAction):
|
||||
self.app = None
|
||||
self.root_password = None
|
||||
|
||||
def handle(self, proc: SystemProcess) -> bool:
|
||||
return self.notify_subproc_outputs(proc, self.signal_output)
|
||||
|
||||
def notify(self, msg: str):
|
||||
if msg:
|
||||
self.signal_output.emit(msg)
|
||||
|
||||
|
||||
class DowngradeApp(AsyncAction):
|
||||
signal_finished = pyqtSignal(bool)
|
||||
|
||||
Reference in New Issue
Block a user