From 51ec8a539fa22390b9bea607e610e1ed1d5105c3 Mon Sep 17 00:00:00 2001 From: Dimitriovski Date: Thu, 16 Jan 2020 16:30:11 +0100 Subject: [PATCH 01/16] Added a 'Marketplace' icon in the header of the Toolbox CURA-7071 --- cura/ApplicationMetadata.py | 4 +- .../qml/components/ToolboxHeader.qml | 56 +++++++++++++------ plugins/Toolbox/src/Toolbox.py | 4 ++ 3 files changed, 46 insertions(+), 18 deletions(-) diff --git a/cura/ApplicationMetadata.py b/cura/ApplicationMetadata.py index 8da64beead..449cc6848a 100644 --- a/cura/ApplicationMetadata.py +++ b/cura/ApplicationMetadata.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Ultimaker B.V. +# Copyright (c) 2020 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. # --------- @@ -56,3 +56,5 @@ try: except ImportError: CuraAppDisplayName = DEFAULT_CURA_DISPLAY_NAME + +WEB_MARKETPLACE_URL = "https://marketplace.ultimaker.com/app/cura/materials" \ No newline at end of file diff --git a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml index 491567eb5f..de64eefff1 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml @@ -51,32 +51,25 @@ Item toolbox.viewPage = "overview" } } - } - ToolboxTabButton - { - id: installedTabButton - text: catalog.i18nc("@title:tab", "Installed") - active: toolbox.viewCategory == "installed" - enabled: !toolbox.isDownloading - anchors + ToolboxTabButton { - right: parent.right - rightMargin: UM.Theme.getSize("default_margin").width + id: installedTabButton + text: catalog.i18nc("@title:tab", "Installed") + active: toolbox.viewCategory == "installed" + enabled: !toolbox.isDownloading + onClicked: toolbox.viewCategory = "installed" + width: UM.Theme.getSize("toolbox_header_tab").width + marketplaceNotificationIcon.width - UM.Theme.getSize("default_margin").width } - onClicked: toolbox.viewCategory = "installed" - width: UM.Theme.getSize("toolbox_header_tab").width + marketplaceNotificationIcon.width - UM.Theme.getSize("default_margin").width + + } Cura.NotificationIcon { id: marketplaceNotificationIcon - visible: CuraApplication.getPackageManager().packagesWithUpdate.length > 0 - - anchors.right: installedTabButton.right - anchors.verticalCenter: installedTabButton.verticalCenter - + anchors.right: bar.right labelText: { const itemCount = CuraApplication.getPackageManager().packagesWithUpdate.length @@ -84,6 +77,35 @@ Item } } + + UM.TooltipArea + { + width: childrenRect.width; + height: childrenRect.height; + text: catalog.i18nc("@info:tooltip", "Go to Web Marketplace") + anchors + { + right: parent.right + rightMargin: UM.Theme.getSize("default_margin").width + verticalCenter: parent.verticalCenter + } + Image + { + id: cloudMarketplaceButton + source: "../../images/marketplace.png" + height: 45 + width: height + //width: UM.Theme.getSize("toolbox_header_tab").width + mipmap: true + fillMode: Image.PreserveAspectFit + MouseArea + { + anchors.fill: parent + onClicked: Qt.openUrlExternally(toolbox.getWebMarketplaceUrl) + } + } + } + ToolboxShadow { anchors.top: bar.bottom diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index b1928b4e84..c7ea5bf7cc 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -765,6 +765,10 @@ class Toolbox(QObject, Extension): def materialsGenericModel(self) -> PackagesModel: return self._materials_generic_model + @pyqtProperty(str, constant=True) + def getWebMarketplaceUrl(self) -> str: + return ApplicationMetadata.WEB_MARKETPLACE_URL + # Filter Models: # -------------------------------------------------------------------------- @pyqtSlot(str, str, str) From ddd2afa08a9769f87daa7d5d8a443a8351692ae6 Mon Sep 17 00:00:00 2001 From: Dimitriovski Date: Thu, 16 Jan 2020 16:30:58 +0100 Subject: [PATCH 02/16] Added dummy image downloaded from internet for presentation only. CURA-7071 --- plugins/Toolbox/resources/images/marketplace.png | Bin 0 -> 9916 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 plugins/Toolbox/resources/images/marketplace.png diff --git a/plugins/Toolbox/resources/images/marketplace.png b/plugins/Toolbox/resources/images/marketplace.png new file mode 100644 index 0000000000000000000000000000000000000000..ca4f41820ef3728554fedfda67f440f2e8035895 GIT binary patch literal 9916 zcmcgy2{@GN+kcJ0kQkCBOruUGd$b_yn9`<&QY35BPAFuVEMv(z*;-Dt2{|g2EyvE# zC@N`?P+5iwMKeXs#8|%jopCzn`(Nk$x9hvU>*|_$J@50}%kTc(_w(G(^t0X8^>d{b zNFfL^cjJb&+Yv-G20<`EIB^(xYL#w+AU{TLTx;zR{OV(O_p!G|isH>%o^xdOMtvGy z%ToL0A=X1IL)u|1!~UzHgP79Ixzp}vh{p(9b1jC?R!AC6gjW&2)udZRSc14A=8PH^ zzG?XX?++3Y^#0#|JmXG({x&-LX6*CSyAEIa)Lhb*y4A)_bs<~1Q&?O~t;Tli(Lo+F zBL4gr=8lv}<7oJDe(B0DBF%1gPtzWB7^|-Z8x@~e z+gXeGrF#tV=faeiJ{kRzte(;8IQk4AXPTOd&+aFk#b$Wna51E%>i5^$VZVtsV2jGM!vkc1X3EDc{~=!uV9O<#t-_@*prBZGLQocW*_MZ$IMTWbGs zF2dHqV#&=a*vOq`XC^GgX!wHjnh05gh{rgFJjY|M#Ce>UO3|YqiAIJI#2^b3SNU^OiDb) z<0bll(LgFg~L zu-Zvqs@9@<5-%k*LswM{ORha`k4&7^cb=fbT2Sn_5XIz#l349Md$1C${XR|b;6dvs zjqA1%fvGfn=r7lXf2~CXQ)8Z0MVRXAb!ZG$>Q zdPqhaH@m!UNTk*W4c?!f6L<+yg@yoFf&iezYD8%P{6GlXWpOd+6hY*{Y2m|nDZr&e zjg7Ll>mkHofFNWAm!yRNqU!{wSedf;tnoGKC7Zzv;kEZ z<*oBKxj#Yt%mV=@R4{unN&w(3xcw)xWTt$XThdVA!kI$82$BNjyHcB$&@;gZ%F#?T_h2XZovUTbWOE<`QR{zC zvSwAmP=JI;Z5Wze{A`^>x`&7mY@nr}h@r3oKS4UAgCJt4g^lY#Hcu7{X7wGbDV(3FA-a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q zpjF=mQ{q9`PI`+@q_W`JE;sv~y}GMx5?onjT-xh@+wNz#iO%E11nFaX%T&^I2C^y) zbM;j%bnxq@^KSXc$>F@rw`&~PPj>M0(Ru*4JfvXag4cyb_4i75r6#QNO=y`o*W%e{ zQS$idt4PDr$+8zDCyMv=^s~E%U5*y7Q7*=of0mnrpAP3_iqHLl`?ygKfk6}_b`WJPNAtUVCOPz!^FC{{uc6PGO*SWucA3mIbE?*dnC|L0 z@ogZ5IQUsB(VlQKC&@l{No!rlFEgual2#4Ybp|J-6}>;0oL01>!Oyp&m>aUKq<9u(C$C1g!4IW2wCfddez644Nen;~h+WF-Xd)Gdq%e|-GKYQADjGb#K zXM}vDUeu{AJ?#`;5wLNveG&DDdC4?;fo)l`iEleSf0Cai+Sf|WE`6$c_R4OX0{gkp zRgsiK^S3wz8H^Gb*{b$W=ch9pa-lG^@b1_sRePnj*@$2KNyhWRv7d*e+f9ABRr!Nw z_AJJ)6C1rXeu6n!9I#as-Tk_ziWUdmy;J-Vq%%i$Bv~B^8DJkUz^$k-%(lhTF(^5$v&s)4d4`G!{U#oW&esmyHVddsCrCd<$^=FqJ% zar7P?uGD~xuszNGf&T9qbP)c*AUggZ{ZX61OYRlzE3Ju;6v#l(<^R?P`r{&k+VcPX g@oyOD@?=J&v*zZBV4uueU?j59X6xEKvPaba0CaNvK>z>% literal 0 HcmV?d00001 From 812017c8140b0990451b6f9fb0f39c62b5783a38 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 28 Jan 2020 11:29:01 +0100 Subject: [PATCH 03/16] Switch out shop icon The sourceSize needs to be adjusted because this is an SVG that we don't necessarily want to stretch but just want to render directly at the correct size. Contributes to issue CURA-7071. --- plugins/Toolbox/resources/images/marketplace.png | Bin 9916 -> 0 bytes plugins/Toolbox/resources/images/shop.svg | 3 +++ .../resources/qml/components/ToolboxHeader.qml | 7 ++++--- 3 files changed, 7 insertions(+), 3 deletions(-) delete mode 100644 plugins/Toolbox/resources/images/marketplace.png create mode 100644 plugins/Toolbox/resources/images/shop.svg diff --git a/plugins/Toolbox/resources/images/marketplace.png b/plugins/Toolbox/resources/images/marketplace.png deleted file mode 100644 index ca4f41820ef3728554fedfda67f440f2e8035895..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9916 zcmcgy2{@GN+kcJ0kQkCBOruUGd$b_yn9`<&QY35BPAFuVEMv(z*;-Dt2{|g2EyvE# zC@N`?P+5iwMKeXs#8|%jopCzn`(Nk$x9hvU>*|_$J@50}%kTc(_w(G(^t0X8^>d{b zNFfL^cjJb&+Yv-G20<`EIB^(xYL#w+AU{TLTx;zR{OV(O_p!G|isH>%o^xdOMtvGy z%ToL0A=X1IL)u|1!~UzHgP79Ixzp}vh{p(9b1jC?R!AC6gjW&2)udZRSc14A=8PH^ zzG?XX?++3Y^#0#|JmXG({x&-LX6*CSyAEIa)Lhb*y4A)_bs<~1Q&?O~t;Tli(Lo+F zBL4gr=8lv}<7oJDe(B0DBF%1gPtzWB7^|-Z8x@~e z+gXeGrF#tV=faeiJ{kRzte(;8IQk4AXPTOd&+aFk#b$Wna51E%>i5^$VZVtsV2jGM!vkc1X3EDc{~=!uV9O<#t-_@*prBZGLQocW*_MZ$IMTWbGs zF2dHqV#&=a*vOq`XC^GgX!wHjnh05gh{rgFJjY|M#Ce>UO3|YqiAIJI#2^b3SNU^OiDb) z<0bll(LgFg~L zu-Zvqs@9@<5-%k*LswM{ORha`k4&7^cb=fbT2Sn_5XIz#l349Md$1C${XR|b;6dvs zjqA1%fvGfn=r7lXf2~CXQ)8Z0MVRXAb!ZG$>Q zdPqhaH@m!UNTk*W4c?!f6L<+yg@yoFf&iezYD8%P{6GlXWpOd+6hY*{Y2m|nDZr&e zjg7Ll>mkHofFNWAm!yRNqU!{wSedf;tnoGKC7Zzv;kEZ z<*oBKxj#Yt%mV=@R4{unN&w(3xcw)xWTt$XThdVA!kI$82$BNjyHcB$&@;gZ%F#?T_h2XZovUTbWOE<`QR{zC zvS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?9DuG#&@?T;b_*N~JypL{+<>YRvv-~C1ce!YKB^LszA{OrS{4nMskKNyPVEI{fhK@L67hB_Q zpjF=mQ{q9`PI`+@q_W`JE;sv~y}GMx5?onjT-xh@+wNz#iO%E11nFaX%T&^I2C^y) zbM;j%bnxq@^KSXc$>F@rw`&~PPj>M0(Ru*4JfvXag4cyb_4i75r6#QNO=y`o*W%e{ zQS$idt4PDr$+8zDCyMv=^s~E%U5*y7Q7*=of0mnrpAP3_iqHLl`?ygKfk6}_b`WJPNAtUVCOPz!^FC{{uc6PGO*SWucA3mIbE?*dnC|L0 z@ogZ5IQUsB(VlQKC&@l{No!rlFEgual2#4Ybp|J-6}>;0oL01>!Oyp&m>aUKq<9u(C$C1g!4IW2wCfddez644Nen;~h+WF-Xd)Gdq%e|-GKYQADjGb#K zXM}vDUeu{AJ?#`;5wLNveG&DDdC4?;fo)l`iEleSf0Cai+Sf|WE`6$c_R4OX0{gkp zRgsiK^S3wz8H^Gb*{b$W=ch9pa-lG^@b1_sRePnj*@$2KNyhWRv7d*e+f9ABRr!Nw z_AJJ)6C1rXeu6n!9I#as-Tk_ziWUdmy;J-Vq%%i$Bv~B^8DJkUz^$k-%(lhTF(^5$v&s)4d4`G!{U#oW&esmyHVddsCrCd<$^=FqJ% zar7P?uGD~xuszNGf&T9qbP)c*AUggZ{ZX61OYRlzE3Ju;6v#l(<^R?P`r{&k+VcPX g@oyOD@?=J&v*zZBV4uueU?j59X6xEKvPaba0CaNvK>z>% diff --git a/plugins/Toolbox/resources/images/shop.svg b/plugins/Toolbox/resources/images/shop.svg new file mode 100644 index 0000000000..64862834b0 --- /dev/null +++ b/plugins/Toolbox/resources/images/shop.svg @@ -0,0 +1,3 @@ + + + diff --git a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml index de64eefff1..48d6c4836b 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2020 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -92,11 +92,12 @@ Item Image { id: cloudMarketplaceButton - source: "../../images/marketplace.png" + source: "../../images/shop.svg" height: 45 width: height + sourceSize.width: width + sourceSize.height: height //width: UM.Theme.getSize("toolbox_header_tab").width - mipmap: true fillMode: Image.PreserveAspectFit MouseArea { From 1d110c2c33f6d7970ace3d15b851bbb6b4f4c59b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 28 Jan 2020 11:31:10 +0100 Subject: [PATCH 04/16] Reduce size of web marketplace link button Contributes to issue CURA-7071. --- plugins/Toolbox/resources/qml/components/ToolboxHeader.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml index 48d6c4836b..e980a063bf 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml @@ -81,7 +81,7 @@ Item UM.TooltipArea { width: childrenRect.width; - height: childrenRect.height; + height: parent.height text: catalog.i18nc("@info:tooltip", "Go to Web Marketplace") anchors { @@ -93,11 +93,11 @@ Item { id: cloudMarketplaceButton source: "../../images/shop.svg" - height: 45 + height: parent.height / 2 width: height + anchors.verticalCenter: parent.verticalCenter sourceSize.width: width sourceSize.height: height - //width: UM.Theme.getSize("toolbox_header_tab").width fillMode: Image.PreserveAspectFit MouseArea { From e6856b02a4d12b54f10d764202a40f183ebda7eb Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 28 Jan 2020 11:33:25 +0100 Subject: [PATCH 05/16] Make entire tooltip area clickable Also saves on another component. And it's more logical, easier to use and fault-tolerant. Contributes to issue CURA-7071. --- .../Toolbox/resources/qml/components/ToolboxHeader.qml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml index e980a063bf..817134590c 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml @@ -80,7 +80,7 @@ Item UM.TooltipArea { - width: childrenRect.width; + width: childrenRect.width height: parent.height text: catalog.i18nc("@info:tooltip", "Go to Web Marketplace") anchors @@ -89,6 +89,7 @@ Item rightMargin: UM.Theme.getSize("default_margin").width verticalCenter: parent.verticalCenter } + onClicked: Qt.openUrlExternally(toolbox.getWebMarketplaceUrl) Image { id: cloudMarketplaceButton @@ -99,11 +100,6 @@ Item sourceSize.width: width sourceSize.height: height fillMode: Image.PreserveAspectFit - MouseArea - { - anchors.fill: parent - onClicked: Qt.openUrlExternally(toolbox.getWebMarketplaceUrl) - } } } From 654a28450d789f77837eaef73bf7acc5fdf2536a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 28 Jan 2020 11:36:42 +0100 Subject: [PATCH 06/16] Fix dark theme icon colour Contributes to issue CURA-7071. --- plugins/Toolbox/resources/qml/components/ToolboxHeader.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml index 817134590c..f751663670 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml @@ -90,16 +90,16 @@ Item verticalCenter: parent.verticalCenter } onClicked: Qt.openUrlExternally(toolbox.getWebMarketplaceUrl) - Image + UM.RecolorImage { id: cloudMarketplaceButton source: "../../images/shop.svg" + color: UM.Theme.getColor("text") height: parent.height / 2 width: height anchors.verticalCenter: parent.verticalCenter sourceSize.width: width sourceSize.height: height - fillMode: Image.PreserveAspectFit } } From ad2b8f140e085a13f813b56f403d3ef3f4df00af Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 28 Jan 2020 11:52:46 +0100 Subject: [PATCH 07/16] 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. --- CMakeLists.txt | 1 + cura/CuraVersion.py.in | 3 ++- plugins/Toolbox/src/Toolbox.py | 9 +++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4954ac46dc..f662c2b50f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ set(CURA_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'") set(CURA_CLOUD_API_ROOT "" CACHE STRING "Alternative Cura cloud API root") set(CURA_CLOUD_API_VERSION "" CACHE STRING "Alternative Cura cloud API version") set(CURA_CLOUD_ACCOUNT_API_ROOT "" CACHE STRING "Alternative Cura cloud account API version") +set(CURA_MARKETPLACE_ROOT "" CACHE STRING "Alternative Marketplace location") configure_file(${CMAKE_SOURCE_DIR}/cura.desktop.in ${CMAKE_BINARY_DIR}/cura.desktop @ONLY) diff --git a/cura/CuraVersion.py.in b/cura/CuraVersion.py.in index 4583e76f67..32a67b8baa 100644 --- a/cura/CuraVersion.py.in +++ b/cura/CuraVersion.py.in @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Ultimaker B.V. +# Copyright (c) 2020 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. CuraAppName = "@CURA_APP_NAME@" @@ -9,3 +9,4 @@ CuraDebugMode = True if "@_cura_debugmode@" == "ON" else False CuraCloudAPIRoot = "@CURA_CLOUD_API_ROOT@" CuraCloudAPIVersion = "@CURA_CLOUD_API_VERSION@" CuraCloudAccountAPIRoot = "@CURA_CLOUD_ACCOUNT_API_ROOT@" +CuraMarketplaceRoot = "@CURA_MARKETPLACE_ROOT@" \ No newline at end of file diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index c7ea5bf7cc..7f4bd919dd 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -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: # -------------------------------------------------------------------------- From 13644f7e41037e3b787fc3ac1b1547be1b592826 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 28 Jan 2020 11:57:40 +0100 Subject: [PATCH 08/16] 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. --- .../Toolbox/resources/qml/components/ToolboxHeader.qml | 10 +++++++++- plugins/Toolbox/src/Toolbox.py | 6 +++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml index f751663670..df1a43911e 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml @@ -89,7 +89,15 @@ Item rightMargin: UM.Theme.getSize("default_margin").width 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 { id: cloudMarketplaceButton diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 7f4bd919dd..c957a0c10c 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -767,12 +767,12 @@ class Toolbox(QObject, Extension): def materialsGenericModel(self) -> PackagesModel: return self._materials_generic_model - @pyqtProperty(str, constant=True) - def getWebMarketplaceUrl(self) -> str: + @pyqtSlot(str, result = str) + def getWebMarketplaceUrl(self, page: str) -> str: root = CuraMarketplaceRoot if root == "": root = DEFAULT_MARKETPLACE_ROOT - return root + "/app/cura/materials" + return root + "/app/cura/" + page # Filter Models: # -------------------------------------------------------------------------- From 1c79193f9a325fd1a564da2ec25edcae8ce18e5c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 28 Jan 2020 13:25:27 +0100 Subject: [PATCH 09/16] Always go to plug-ins page regardless of active tab This was a requirement from UX. Apparently we're adding a link to the materials elsewhere. Contributes to issue CURA-7071. --- .../Toolbox/resources/qml/components/ToolboxHeader.qml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml index df1a43911e..e0cdb44d7d 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml @@ -89,15 +89,7 @@ Item rightMargin: UM.Theme.getSize("default_margin").width verticalCenter: parent.verticalCenter } - onClicked: - { - let page = "plugins"; //Online page to go to on the Marketplace subdomain. - if(materialsTabButton.active) - { - page = "materials"; - } - Qt.openUrlExternally(toolbox.getWebMarketplaceUrl(page)); - } + onClicked: Qt.openUrlExternally(toolbox.getWebMarketplaceUrl("plugins")) UM.RecolorImage { id: cloudMarketplaceButton From e51a1b18bed3ae320463a9e2848eea73fe303592 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 28 Jan 2020 14:19:33 +0100 Subject: [PATCH 10/16] Add link text to marketplace search page Contributes to issue CURA-7071. --- .../components/ToolboxDownloadsShowcase.qml | 35 ++++++++++++++----- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml index 72dd6f91a2..26d691ea8e 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml @@ -14,17 +14,36 @@ Rectangle Column { height: childrenRect.height + 2 * padding - spacing: UM.Theme.getSize("default_margin").width + spacing: UM.Theme.getSize("default_margin").height width: parent.width padding: UM.Theme.getSize("wide_margin").height - Label + Item { - id: heading - text: catalog.i18nc("@label", "Featured") - width: parent.width - color: UM.Theme.getColor("text_medium") - font: UM.Theme.getFont("large") - renderType: Text.NativeRendering + width: parent.width - parent.padding * 2 + height: childrenRect.height + Label + { + id: heading + text: catalog.i18nc("@label", "Featured") + width: contentWidth + height: contentHeight + color: UM.Theme.getColor("text_medium") + font: UM.Theme.getFont("large") + renderType: Text.NativeRendering + } + Label + { + text: catalog.i18nc("@label", "Search materials") + width: parent.width - heading.width + height: contentHeight + anchors.right: parent.right + horizontalAlignment: Text.AlignRight + elide: Text.ElideLeft + color: UM.Theme.getColor("text_medium") + font: UM.Theme.getFont("medium") + renderType: Text.NativeRendering + visible: toolbox.viewCategory === "material" + } } Grid { From 38e7a9e4df3555d187ba8d50ceca7c0a2b7b0ed8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 28 Jan 2020 14:37:59 +0100 Subject: [PATCH 11/16] Turn Marketplace link into an actual link With consistent styling. The original design didn't have the link underlined but since the rest of the Cura UI has it underlined I let that happen here too. Contributes to issue CURA-7071. --- .../components/ToolboxDownloadsShowcase.qml | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml index 26d691ea8e..048ef937d1 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml @@ -31,18 +31,26 @@ Rectangle font: UM.Theme.getFont("large") renderType: Text.NativeRendering } - Label + UM.TooltipArea { - text: catalog.i18nc("@label", "Search materials") - width: parent.width - heading.width - height: contentHeight + width: childrenRect.width + height: childrenRect.height anchors.right: parent.right - horizontalAlignment: Text.AlignRight - elide: Text.ElideLeft - color: UM.Theme.getColor("text_medium") - font: UM.Theme.getFont("medium") - renderType: Text.NativeRendering - visible: toolbox.viewCategory === "material" + text: catalog.i18nc("@info:tooltip", "Go to Web Marketplace") + Label + { + text: "".arg(toolbox.getWebMarketplaceUrl("materials")) + catalog.i18nc("@label", "Search materials") + "" + width: contentWidth + height: contentHeight + horizontalAlignment: Text.AlignRight + font: UM.Theme.getFont("medium") + renderType: Text.NativeRendering + + linkColor: UM.Theme.getColor("text_link") + onLinkActivated: Qt.openUrlExternally(link) + + visible: toolbox.viewCategory === "material" + } } } Grid From 6553443f3b95527d45a1f2ddc89e948c97f3f1b0 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 28 Jan 2020 14:41:29 +0100 Subject: [PATCH 12/16] Make marketplace materials link slightly smaller Contributes to issue CURA-7071. --- .../resources/qml/components/ToolboxDownloadsShowcase.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml index 048ef937d1..9b34952ab6 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml @@ -43,7 +43,7 @@ Rectangle width: contentWidth height: contentHeight horizontalAlignment: Text.AlignRight - font: UM.Theme.getFont("medium") + font: UM.Theme.getFont("default") renderType: Text.NativeRendering linkColor: UM.Theme.getColor("text_link") From 242da1b3aa27620aaa14812aca21536cf9b71148 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 28 Jan 2020 14:47:00 +0100 Subject: [PATCH 13/16] Give web marketplace button a hover colour It needs to be the same as the bar beneath the marketplace tab buttons when highlit. Contributes to issue CURA-7071. --- plugins/Toolbox/resources/qml/components/ToolboxHeader.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml index e0cdb44d7d..3cba9a9ece 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml @@ -80,6 +80,7 @@ Item UM.TooltipArea { + id: webMarketplaceButtonTooltipArea width: childrenRect.width height: parent.height text: catalog.i18nc("@info:tooltip", "Go to Web Marketplace") @@ -94,7 +95,7 @@ Item { id: cloudMarketplaceButton source: "../../images/shop.svg" - color: UM.Theme.getColor("text") + color: UM.Theme.getColor(webMarketplaceButtonTooltipArea.containsMouse ? "primary" : "text") height: parent.height / 2 width: height anchors.verticalCenter: parent.verticalCenter From e79b3beed11717cbdec5567ea6e872bfdeefed19 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 30 Jan 2020 09:39:56 +0100 Subject: [PATCH 14/16] Remove unused URL CURA-7071 --- cura/ApplicationMetadata.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/cura/ApplicationMetadata.py b/cura/ApplicationMetadata.py index 449cc6848a..85b097c0ba 100644 --- a/cura/ApplicationMetadata.py +++ b/cura/ApplicationMetadata.py @@ -56,5 +56,3 @@ try: except ImportError: CuraAppDisplayName = DEFAULT_CURA_DISPLAY_NAME - -WEB_MARKETPLACE_URL = "https://marketplace.ultimaker.com/app/cura/materials" \ No newline at end of file From 18163af5a355eb7ee997cd5096fb92352b344992 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 30 Jan 2020 09:42:51 +0100 Subject: [PATCH 15/16] Ensure that the default default marketplace URL is used when not defined CURA-7071 --- plugins/Toolbox/src/Toolbox.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index c957a0c10c..d2ce4c9011 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -16,7 +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 @@ -35,6 +35,11 @@ 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 From d15e64cc5b81a1caba013361c02d096298d38ebe Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 30 Jan 2020 09:44:15 +0100 Subject: [PATCH 16/16] Remove unused import --- plugins/Toolbox/src/Toolbox.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index d2ce4c9011..dac985c28a 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -24,7 +24,6 @@ from plugins.Toolbox.src.CloudApiModel import CloudApiModel from .AuthorsModel import AuthorsModel from .CloudSync.LicenseModel import LicenseModel from .PackagesModel import PackagesModel -from .CloudSync.SubscribedPackagesModel import SubscribedPackagesModel from .UltimakerCloudScope import UltimakerCloudScope if TYPE_CHECKING: