diff options
author | konskarm <konskarm@gmail.com> | 2020-02-04 13:02:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-04 13:02:30 +0300 |
commit | 35903e7dd3c0efa747cd0bfb6b0b3a466c1db635 (patch) | |
tree | cec9acc313ad689052084fc5e7c5edcef12481c3 /plugins/Toolbox/src/Toolbox.py | |
parent | 35aadad747b523f3f9cba0776fcd8ca6fc4c62f2 (diff) | |
parent | d15e64cc5b81a1caba013361c02d096298d38ebe (diff) |
Merge pull request #6988 from Ultimaker/CURA-7071
CURA-7071/Added option to redirect to Web MP from Cura MP
Diffstat (limited to 'plugins/Toolbox/src/Toolbox.py')
-rw-r--r-- | plugins/Toolbox/src/Toolbox.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 782d6668ba..55c6ba223b 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -16,6 +16,7 @@ from UM.i18n import i18nCatalog from UM.Version import Version from cura import ApplicationMetadata + from cura.CuraApplication import CuraApplication from cura.Machines.ContainerTree import ContainerTree @@ -31,6 +32,13 @@ if TYPE_CHECKING: i18n_catalog = i18nCatalog("cura") +DEFAULT_MARKETPLACE_ROOT = "https://marketplace.ultimaker.com" # type: str + +try: + from cura.CuraVersion import CuraMarketplaceRoot +except ImportError: + CuraMarketplaceRoot = DEFAULT_MARKETPLACE_ROOT + # todo Remove license and download dialog, use SyncOrchestrator instead ## Provides a marketplace for users to download plugins an materials @@ -766,6 +774,13 @@ class Toolbox(QObject, Extension): def materialsGenericModel(self) -> PackagesModel: return self._materials_generic_model + @pyqtSlot(str, result = str) + def getWebMarketplaceUrl(self, page: str) -> str: + root = CuraMarketplaceRoot + if root == "": + root = DEFAULT_MARKETPLACE_ROOT + return root + "/app/cura/" + page + # Filter Models: # -------------------------------------------------------------------------- @pyqtSlot(str, str, str) |