Make Marketplace link configurable from the build system

This way you could set it to marketplace-staging if you like.

Contributes to issue CURA-7071.
This commit is contained in:
Ghostkeeper 2020-01-28 11:52:46 +01:00
parent 654a28450d
commit ad2b8f140e
No known key found for this signature in database
GPG key ID: 37E2020986774393
3 changed files with 10 additions and 3 deletions

View file

@ -4,7 +4,6 @@
import json
import os
import tempfile
import platform
from typing import cast, Any, Dict, List, Set, TYPE_CHECKING, Tuple, Optional, Union
from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal, pyqtSlot
@ -17,6 +16,7 @@ from UM.i18n import i18nCatalog
from UM.Version import Version
from cura import ApplicationMetadata
from cura.CuraVersion import CuraMarketplaceRoot
from cura.CuraApplication import CuraApplication
from cura.Machines.ContainerTree import ContainerTree
from plugins.Toolbox.src.CloudApiModel import CloudApiModel
@ -33,6 +33,8 @@ if TYPE_CHECKING:
i18n_catalog = i18nCatalog("cura")
DEFAULT_MARKETPLACE_ROOT = "https://marketplace.ultimaker.com" # type: str
# todo Remove license and download dialog, use SyncOrchestrator instead
## Provides a marketplace for users to download plugins an materials
@ -767,7 +769,10 @@ class Toolbox(QObject, Extension):
@pyqtProperty(str, constant=True)
def getWebMarketplaceUrl(self) -> str:
return ApplicationMetadata.WEB_MARKETPLACE_URL
root = CuraMarketplaceRoot
if root == "":
root = DEFAULT_MARKETPLACE_ROOT
return root + "/app/cura/materials"
# Filter Models:
# --------------------------------------------------------------------------