Only show restart dialog when packages were installed

CURA-6983
This commit is contained in:
Nino van Hooff 2020-01-13 09:57:14 +01:00
parent 2da8040e5a
commit 6aba835c1c

View file

@ -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,12 +82,14 @@ 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"])
if has_changes:
self._restart_presenter.present()