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