Load different pages of Marketplace depending on current tab

Feels intuitive actually, but if you think about it it's weird that the link should change depending on the tab that's next to it.

Contributes to issue CURA-7071.
This commit is contained in:
Ghostkeeper 2020-01-28 11:57:40 +01:00
parent ad2b8f140e
commit 13644f7e41
No known key found for this signature in database
GPG key ID: 37E2020986774393
2 changed files with 12 additions and 4 deletions

View file

@ -89,7 +89,15 @@ Item
rightMargin: UM.Theme.getSize("default_margin").width rightMargin: UM.Theme.getSize("default_margin").width
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
onClicked: Qt.openUrlExternally(toolbox.getWebMarketplaceUrl) onClicked:
{
let page = "plugins"; //Online page to go to on the Marketplace subdomain.
if(materialsTabButton.active)
{
page = "materials";
}
Qt.openUrlExternally(toolbox.getWebMarketplaceUrl(page));
}
UM.RecolorImage UM.RecolorImage
{ {
id: cloudMarketplaceButton id: cloudMarketplaceButton

View file

@ -767,12 +767,12 @@ class Toolbox(QObject, Extension):
def materialsGenericModel(self) -> PackagesModel: def materialsGenericModel(self) -> PackagesModel:
return self._materials_generic_model return self._materials_generic_model
@pyqtProperty(str, constant=True) @pyqtSlot(str, result = str)
def getWebMarketplaceUrl(self) -> str: def getWebMarketplaceUrl(self, page: str) -> str:
root = CuraMarketplaceRoot root = CuraMarketplaceRoot
if root == "": if root == "":
root = DEFAULT_MARKETPLACE_ROOT root = DEFAULT_MARKETPLACE_ROOT
return root + "/app/cura/materials" return root + "/app/cura/" + page
# Filter Models: # Filter Models:
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------