Browse Source

Dialog was immediately being destroyed because a reference to it was not being stored in memory. Added a missingPackageDialog variable to WorkspaceDialog to fix this.

Swapped the loading order of Marketplace extensions so SyncOrchestractor is not fetched by PluginRegistry.getInstance().getPluginObject("Marketplace") in WorkspaceDialog.

CURA-8610
j.delarago 2 years ago
parent
commit
d5511a078c
2 changed files with 4 additions and 3 deletions
  1. 3 2
      plugins/Marketplace/Marketplace.py
  2. 1 1
      plugins/Marketplace/__init__.py

+ 3 - 2
plugins/Marketplace/Marketplace.py

@@ -41,6 +41,7 @@ class Marketplace(Extension, QObject):
 
         self._tab_shown: int = 0
         self._restart_needed = False
+        self.missingPackageDialog = None
 
     def getTabShown(self) -> int:
         return self._tab_shown
@@ -128,5 +129,5 @@ class Marketplace(Extension, QObject):
         :param ignore_warning_callback: A callback that gets executed when the user ignores the pop-up, to show them a
         warning.
         """
-        dialog = InstallMissingPackageDialog(packages_metadata, ignore_warning_callback)
-        dialog.show()
+        self.missingPackageDialog = InstallMissingPackageDialog(packages_metadata, ignore_warning_callback)
+        self.missingPackageDialog.show()

+ 1 - 1
plugins/Marketplace/__init__.py

@@ -14,4 +14,4 @@ def register(app):
     """
     Register the plug-in object with Uranium.
     """
-    return { "extension": [Marketplace(), SyncOrchestrator(app)] }
+    return { "extension": [SyncOrchestrator(app), Marketplace()] }