Merge pull request #6988 from Ultimaker/CURA-7071

CURA-7071/Added option to redirect to Web MP from Cura MP
This commit is contained in:
konskarm 2020-02-04 11:02:30 +01:00 committed by GitHub
commit 35903e7dd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 95 additions and 28 deletions

View file

@ -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)