From 6aba835c1c66fb39fd421eb9fc3667ac1cd95951 Mon Sep 17 00:00:00 2001 From: Nino van Hooff Date: Mon, 13 Jan 2020 09:57:14 +0100 Subject: [PATCH] Only show restart dialog when packages were installed CURA-6983 --- plugins/Toolbox/src/CloudSync/SyncOrchestrator.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/Toolbox/src/CloudSync/SyncOrchestrator.py b/plugins/Toolbox/src/CloudSync/SyncOrchestrator.py index f740c6dff1..af9f1440e6 100644 --- a/plugins/Toolbox/src/CloudSync/SyncOrchestrator.py +++ b/plugins/Toolbox/src/CloudSync/SyncOrchestrator.py @@ -73,6 +73,8 @@ class SyncOrchestrator(Extension): def _onLicenseAnswers(self, answers: [Dict[str, Any]]): Logger.debug("Got license answers: {}", answers) + has_changes = False # True when at least one package is installed + for item in answers: if item["accepted"]: # install and subscribe packages @@ -80,13 +82,15 @@ class SyncOrchestrator(Extension): Logger.error("could not install {}".format(item["package_id"])) continue self._cloud_package_manager.subscribe(item["package_id"]) + has_changes = True else: # todo unsubscribe declined packages pass # delete temp file os.remove(item["package_path"]) - self._restart_presenter.present() + if has_changes: + self._restart_presenter.present()