From 1f402569ad2ee5f8f4add72b9e79d538df134e81 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 11 Jun 2020 16:51:42 +0200 Subject: [PATCH 01/17] Move properties into account details itself There isn't really a point to setting them from when the object is created... CURA-7418 --- resources/qml/Account/AccountDetails.qml | 7 ++++--- resources/qml/Account/AccountWidget.qml | 7 +------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/resources/qml/Account/AccountDetails.qml b/resources/qml/Account/AccountDetails.qml index 265842e2b4..e81fdb1fb2 100644 --- a/resources/qml/Account/AccountDetails.qml +++ b/resources/qml/Account/AccountDetails.qml @@ -9,9 +9,10 @@ import Cura 1.1 as Cura Column { - property var profile: null - property var loggedIn: false - property var profileImage: "" + property var profile: Cura.API.account.userProfile + property bool loggedIn: Cura.API.account.isLoggedIn + property var profileImage: Cura.API.account.profileImageUrl + padding: UM.Theme.getSize("wide_margin").height spacing: UM.Theme.getSize("wide_margin").height diff --git a/resources/qml/Account/AccountWidget.qml b/resources/qml/Account/AccountWidget.qml index eed711e745..8c4d4c91e8 100644 --- a/resources/qml/Account/AccountWidget.qml +++ b/resources/qml/Account/AccountWidget.qml @@ -133,12 +133,7 @@ Item Behavior on opacity { NumberAnimation { duration: 100 } } contentItem: AccountDetails - { - id: panel - profile: Cura.API.account.userProfile - loggedIn: Cura.API.account.isLoggedIn - profileImage: Cura.API.account.profileImageUrl - } + {} background: UM.PointingRectangle { From 6d86cbf03cf7b3ce4a24e98202bccb68a44e1687 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 11 Jun 2020 16:58:28 +0200 Subject: [PATCH 02/17] Convert the account details into an item No idea why it was a column. CURA-7454 --- resources/qml/Account/AccountDetails.qml | 10 +++------- resources/qml/Account/AccountWidget.qml | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/resources/qml/Account/AccountDetails.qml b/resources/qml/Account/AccountDetails.qml index e81fdb1fb2..031e376a21 100644 --- a/resources/qml/Account/AccountDetails.qml +++ b/resources/qml/Account/AccountDetails.qml @@ -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. import QtQuick 2.10 @@ -7,20 +7,16 @@ import QtQuick.Controls 2.3 import UM 1.4 as UM import Cura 1.1 as Cura -Column +Item { property var profile: Cura.API.account.userProfile property bool loggedIn: Cura.API.account.isLoggedIn property var profileImage: Cura.API.account.profileImageUrl - - padding: UM.Theme.getSize("wide_margin").height - spacing: UM.Theme.getSize("wide_margin").height - Loader { id: accountOperations - anchors.horizontalCenter: parent.horizontalCenter + anchors.centerIn: parent sourceComponent: loggedIn ? userOperations : generalOperations } diff --git a/resources/qml/Account/AccountWidget.qml b/resources/qml/Account/AccountWidget.qml index 8c4d4c91e8..22c876b857 100644 --- a/resources/qml/Account/AccountWidget.qml +++ b/resources/qml/Account/AccountWidget.qml @@ -131,7 +131,7 @@ Item opacity: opened ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 100 } } - + padding: UM.Theme.getSize("wide_margin").height contentItem: AccountDetails {} From d8d3f16c9f776f73a5672ddf33bb25a87718be0a Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 11 Jun 2020 17:01:04 +0200 Subject: [PATCH 03/17] Remove unneeded width property CURA-7418 --- resources/qml/Account/UserOperations.qml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/resources/qml/Account/UserOperations.qml b/resources/qml/Account/UserOperations.qml index c0f33c74cd..a39e7f1074 100644 --- a/resources/qml/Account/UserOperations.qml +++ b/resources/qml/Account/UserOperations.qml @@ -9,11 +9,6 @@ import Cura 1.1 as Cura Column { - width: Math.max( - Math.max(title.width, accountButton.width) + 2 * UM.Theme.getSize("default_margin").width, - syncRow.width - ) - spacing: UM.Theme.getSize("default_margin").height SystemPalette @@ -32,7 +27,8 @@ Column color: UM.Theme.getColor("text") } - SyncState { + SyncState + { id: syncRow } @@ -76,5 +72,4 @@ Column onExited: signOutButton.font.underline = false } } - } From f4c5a134c27bf9c08137b65bb8cb550b7f0c9e57 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 11 Jun 2020 17:02:37 +0200 Subject: [PATCH 04/17] Move palette to syncstate It should be there, since that is the only place it's being used CURA-7418 --- resources/qml/Account/SyncState.qml | 5 +++++ resources/qml/Account/UserOperations.qml | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/qml/Account/SyncState.qml b/resources/qml/Account/SyncState.qml index 98e5991b5a..0eb67d0c00 100644 --- a/resources/qml/Account/SyncState.qml +++ b/resources/qml/Account/SyncState.qml @@ -13,6 +13,11 @@ Row // sync state icon + message anchors.horizontalCenter: parent.horizontalCenter spacing: UM.Theme.getSize("narrow_margin").height + SystemPalette + { + id: palette + } + UM.RecolorImage { id: icon diff --git a/resources/qml/Account/UserOperations.qml b/resources/qml/Account/UserOperations.qml index a39e7f1074..63215a0540 100644 --- a/resources/qml/Account/UserOperations.qml +++ b/resources/qml/Account/UserOperations.qml @@ -11,11 +11,6 @@ Column { spacing: UM.Theme.getSize("default_margin").height - SystemPalette - { - id: palette - } - Label { id: title From d33529f932472907324adfd197db4d8da6c2b3f5 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 11 Jun 2020 17:31:19 +0200 Subject: [PATCH 05/17] Use property & states instead of listening to changed signal It makes a lot more sense to me to use states and an actual property. CURA-7418 --- cura/API/Account.py | 5 +++ resources/qml/Account/SyncState.qml | 66 +++++++++++++++-------------- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/cura/API/Account.py b/cura/API/Account.py index ef46368474..4868204a94 100644 --- a/cura/API/Account.py +++ b/cura/API/Account.py @@ -103,6 +103,11 @@ class Account(QObject): self._authorization_service.accessTokenChanged.connect(self._onAccessTokenChanged) self._authorization_service.loadAuthDataFromPreferences() + + @pyqtProperty(int, notify=syncStateChanged) + def syncState(self): + return self._sync_state + def setSyncState(self, service_name: str, state: int) -> None: """ Can be used to register sync services and update account sync states diff --git a/resources/qml/Account/SyncState.qml b/resources/qml/Account/SyncState.qml index 0eb67d0c00..729a38c3c5 100644 --- a/resources/qml/Account/SyncState.qml +++ b/resources/qml/Account/SyncState.qml @@ -4,8 +4,9 @@ import QtQuick.Controls 2.3 import UM 1.4 as UM import Cura 1.1 as Cura -Row // sync state icon + message +Row // Sync state icon + message { + property var syncState: Cura.API.account.syncState id: syncRow width: childrenRect.width @@ -13,11 +14,42 @@ Row // sync state icon + message anchors.horizontalCenter: parent.horizontalCenter spacing: UM.Theme.getSize("narrow_margin").height + states: [ + State + { + name: "idle" + when: syncState == Cura.AccountSyncState.IDLE + PropertyChanges { target: icon; source: UM.Theme.getIcon("update")} + }, + State + { + name: "syncing" + when: syncState == Cura.AccountSyncState.SYNCING + PropertyChanges { target: icon; source: UM.Theme.getIcon("update") } + PropertyChanges { target: stateLabel; text: catalog.i18nc("@label", "Checking...")} + }, + State + { + name: "up_to_date" + when: syncState == Cura.AccountSyncState.SUCCESS + PropertyChanges { target: icon; source: UM.Theme.getIcon("checked") } + PropertyChanges { target: stateLabel; text: catalog.i18nc("@label", "You are in sync with your account")} + }, + State + { + name: "error" + when: syncState == Cura.AccountSyncState.ERROR + PropertyChanges { target: icon; source: UM.Theme.getIcon("warning_light") } + PropertyChanges { target: stateLabel; text: catalog.i18nc("@label", "Something went wrong...")} + } + ] + SystemPalette { id: palette } + UM.RecolorImage { id: icon @@ -35,7 +67,7 @@ Row // sync state icon + message to: 360 duration: 1000 loops: Animation.Infinite - running: true + running: syncState == Cura.AccountSyncState.SYNCING // reset rotation when stopped onRunningChanged: { @@ -70,7 +102,6 @@ Row // sync state icon + message font: UM.Theme.getFont("medium") renderType: Text.NativeRendering visible: Cura.API.account.manualSyncEnabled - height: visible ? accountSyncButton.intrinsicHeight : 0 MouseArea { @@ -82,33 +113,4 @@ Row // sync state icon + message } } } - - signal syncStateChanged(string newState) - - onSyncStateChanged: { - if(newState == Cura.AccountSyncState.IDLE){ - icon.source = UM.Theme.getIcon("update") - } else if(newState == Cura.AccountSyncState.SYNCING){ - icon.source = UM.Theme.getIcon("update") - stateLabel.text = catalog.i18nc("@label", "Checking...") - } else if (newState == Cura.AccountSyncState.SUCCESS) { - icon.source = UM.Theme.getIcon("checked") - stateLabel.text = catalog.i18nc("@label", "You are in sync with your account") - } else if (newState == Cura.AccountSyncState.ERROR) { - icon.source = UM.Theme.getIcon("warning_light") - stateLabel.text = catalog.i18nc("@label", "Something went wrong...") - } else { - print("Error: unexpected sync state: " + newState) - } - - if(newState == Cura.AccountSyncState.SYNCING){ - updateAnimator.running = true - } else { - updateAnimator.running = false - } - } - - Component.onCompleted: Cura.API.account.syncStateChanged.connect(syncStateChanged) - - } \ No newline at end of file From 200e3d6ee73e2d621703e62bc37b65422017d217 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 15 Jun 2020 13:19:50 +0200 Subject: [PATCH 06/17] Add tertiary button as a reusable component CURA-7418 --- resources/qml/ActionButton.qml | 10 ++++++++++ resources/qml/TertiaryButton.qml | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 resources/qml/TertiaryButton.qml diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index a38b47df8f..0c1be007b5 100644 --- a/resources/qml/ActionButton.qml +++ b/resources/qml/ActionButton.qml @@ -33,6 +33,8 @@ Button property alias shadowEnabled: shadow.visible property alias busy: busyIndicator.visible + property bool underlineTextOnHover: false + property alias toolTipContentAlignment: tooltip.contentAlignment // This property is used to indicate whether the button has a fixed width or the width would depend on the contents @@ -49,6 +51,14 @@ Button height: UM.Theme.getSize("action_button").height hoverEnabled: true + onHoveredChanged: + { + if(underlineTextOnHover) + { + buttonText.font.underline = hovered + } + } + contentItem: Row { spacing: UM.Theme.getSize("narrow_margin").width diff --git a/resources/qml/TertiaryButton.qml b/resources/qml/TertiaryButton.qml new file mode 100644 index 0000000000..31b56193eb --- /dev/null +++ b/resources/qml/TertiaryButton.qml @@ -0,0 +1,21 @@ +// Copyright (c) 2020 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.2 + +import UM 1.4 as UM +import Cura 1.1 as Cura + + +Cura.ActionButton +{ + shadowEnabled: true + shadowColor: enabled ? UM.Theme.getColor("secondary_button_shadow"): UM.Theme.getColor("action_button_disabled_shadow") + color: "transparent" + textColor: UM.Theme.getColor("secondary_button_text") + outlineColor: "transparent" + disabledColor: UM.Theme.getColor("action_button_disabled") + textDisabledColor: UM.Theme.getColor("action_button_disabled_text") + hoverColor: "transparent" + underlineTextOnHover: true +} \ No newline at end of file From a7e7ddf4b5a999f5ff1b3e488c5f9b1dc4063545 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 15 Jun 2020 13:33:47 +0200 Subject: [PATCH 07/17] Add the digital factory button CURA-7418 --- cura/CuraApplication.py | 4 + .../UltimakerCloudAuthentication.py | 8 ++ resources/qml/Account/SyncState.qml | 4 + resources/qml/Account/UserOperations.qml | 110 +++++++++++------- 4 files changed, 84 insertions(+), 42 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 75b1d67697..3af6ebeaf8 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -261,6 +261,10 @@ class CuraApplication(QtApplication): def ultimakerCloudAccountRootUrl(self) -> str: return UltimakerCloudAuthentication.CuraCloudAccountAPIRoot + @pyqtProperty(str, constant=True) + def ultimakerDigitalFactoryUrl(self) -> str: + return UltimakerCloudAuthentication.CuraDigitalFactoryURL + def addCommandLineOptions(self): """Adds command line options to the command line parser. diff --git a/cura/UltimakerCloud/UltimakerCloudAuthentication.py b/cura/UltimakerCloud/UltimakerCloudAuthentication.py index c8346e5c4e..707b814d34 100644 --- a/cura/UltimakerCloud/UltimakerCloudAuthentication.py +++ b/cura/UltimakerCloud/UltimakerCloudAuthentication.py @@ -7,6 +7,7 @@ DEFAULT_CLOUD_API_ROOT = "https://api.ultimaker.com" # type: str DEFAULT_CLOUD_API_VERSION = "1" # type: str DEFAULT_CLOUD_ACCOUNT_API_ROOT = "https://account.ultimaker.com" # type: str +DEFAULT_DIGITAL_FACTORY_URL = "https://digitalfactory.ultimaker.com" # type: str try: from cura.CuraVersion import CuraCloudAPIRoot # type: ignore @@ -28,3 +29,10 @@ try: CuraCloudAccountAPIRoot = DEFAULT_CLOUD_ACCOUNT_API_ROOT except ImportError: CuraCloudAccountAPIRoot = DEFAULT_CLOUD_ACCOUNT_API_ROOT + +try: + from cura.CuraVersion import CuraDigitalFactoryURL + if CuraDigitalFactoryURL == "": + CuraDigitalFactoryURL = DEFAULT_DIGITAL_FACTORY_URL +except ImportError: + CuraDigitalFactoryURL = DEFAULT_DIGITAL_FACTORY_URL \ No newline at end of file diff --git a/resources/qml/Account/SyncState.qml b/resources/qml/Account/SyncState.qml index 729a38c3c5..a362c93e21 100644 --- a/resources/qml/Account/SyncState.qml +++ b/resources/qml/Account/SyncState.qml @@ -91,6 +91,8 @@ Row // Sync state icon + message color: UM.Theme.getColor("text") font: UM.Theme.getFont("medium") renderType: Text.NativeRendering + height: contentHeight + verticalAlignment: Text.AlignVCenter visible: !Cura.API.account.manualSyncEnabled } @@ -101,6 +103,8 @@ Row // Sync state icon + message color: UM.Theme.getColor("secondary_button_text") font: UM.Theme.getFont("medium") renderType: Text.NativeRendering + verticalAlignment: Text.AlignVCenter + height: contentHeight visible: Cura.API.account.manualSyncEnabled MouseArea diff --git a/resources/qml/Account/UserOperations.qml b/resources/qml/Account/UserOperations.qml index 63215a0540..e660286257 100644 --- a/resources/qml/Account/UserOperations.qml +++ b/resources/qml/Account/UserOperations.qml @@ -9,62 +9,88 @@ import Cura 1.1 as Cura Column { - spacing: UM.Theme.getSize("default_margin").height + spacing: UM.Theme.getSize("narrow_margin").height - Label + Item { - id: title - anchors.horizontalCenter: parent.horizontalCenter - horizontalAlignment: Text.AlignHCenter - renderType: Text.NativeRendering - text: catalog.i18nc("@label The argument is a username.", "Hi %1").arg(profile.username) - font: UM.Theme.getFont("large_bold") - color: UM.Theme.getColor("text") + width: childrenRect.width + height: childrenRect.height + AvatarImage + { + id: avatar + + width: UM.Theme.getSize("main_window_header").height + height: UM.Theme.getSize("main_window_header").height + + source: profile["profile_image_url"] ? profile["profile_image_url"] : "" + outlineColor: "transparent" + } + Column + { + anchors.left: avatar.right + anchors.leftMargin: UM.Theme.getSize("default_margin").width + spacing: UM.Theme.getSize("narrow_margin").height + Label + { + id: username + renderType: Text.NativeRendering + text: profile.username + font: UM.Theme.getFont("large_bold") + color: UM.Theme.getColor("text") + } + + SyncState + { + id: syncRow + } + Label + { + id: lastSyncLabel + renderType: Text.NativeRendering + text: catalog.i18nc("@label The argument is a timestamp", "Last update: %1").arg(Cura.API.account.lastSyncDateTime) + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text_medium") + } + } } - SyncState + Rectangle { - id: syncRow + width: parent.width + color: UM.Theme.getColor("lining") + height: UM.Theme.getSize("default_lining").height } - - Label + Cura.TertiaryButton { - id: lastSyncLabel - anchors.horizontalCenter: parent.horizontalCenter - horizontalAlignment: Text.AlignHCenter - renderType: Text.NativeRendering - text: catalog.i18nc("@label The argument is a timestamp", "Last update: %1").arg(Cura.API.account.lastSyncDateTime) - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text_medium") - } - - Cura.SecondaryButton - { - id: accountButton - anchors.horizontalCenter: parent.horizontalCenter + id: cloudButton width: UM.Theme.getSize("account_button").width height: UM.Theme.getSize("account_button").height - text: catalog.i18nc("@button", "Ultimaker account") + text: catalog.i18nc("@button", "Ultimaker Digital Factory") + onClicked: Qt.openUrlExternally(CuraApplication.ultimakerDigitalFactoryUrl) + fixedWidthMode: false + } + + Cura.TertiaryButton + { + id: accountButton + width: UM.Theme.getSize("account_button").width + height: UM.Theme.getSize("account_button").height + text: catalog.i18nc("@button", "Ultimaker Account") onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl) fixedWidthMode: false } - Label + Rectangle + { + width: parent.width + color: UM.Theme.getColor("lining") + height: UM.Theme.getSize("default_lining").height + } + + Cura.TertiaryButton { id: signOutButton - anchors.horizontalCenter: parent.horizontalCenter - text: catalog.i18nc("@button", "Sign out") - color: UM.Theme.getColor("secondary_button_text") - font: UM.Theme.getFont("medium") - renderType: Text.NativeRendering - - MouseArea - { - anchors.fill: parent - onClicked: Cura.API.account.logout() - hoverEnabled: true - onEntered: signOutButton.font.underline = true - onExited: signOutButton.font.underline = false - } + onClicked: Cura.API.account.logout() + text: catalog.i18nc("@button", "Sign Out") } } From 0edb93176a6f4698065686f8f4645adc569cb5f8 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 15 Jun 2020 14:09:01 +0200 Subject: [PATCH 08/17] Fix some layout issues CURA-7418 --- resources/qml/Account/AccountWidget.qml | 2 +- resources/qml/Account/GeneralOperations.qml | 2 +- resources/qml/Account/SyncState.qml | 4 ++-- resources/qml/Account/UserOperations.qml | 8 ++++++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/resources/qml/Account/AccountWidget.qml b/resources/qml/Account/AccountWidget.qml index 22c876b857..48c05f8a11 100644 --- a/resources/qml/Account/AccountWidget.qml +++ b/resources/qml/Account/AccountWidget.qml @@ -131,7 +131,7 @@ Item opacity: opened ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 100 } } - padding: UM.Theme.getSize("wide_margin").height + padding: 0 contentItem: AccountDetails {} diff --git a/resources/qml/Account/GeneralOperations.qml b/resources/qml/Account/GeneralOperations.qml index bea90c1d67..9562f940a4 100644 --- a/resources/qml/Account/GeneralOperations.qml +++ b/resources/qml/Account/GeneralOperations.qml @@ -10,7 +10,7 @@ import Cura 1.1 as Cura Column { spacing: UM.Theme.getSize("default_margin").width - + padding: UM.Theme.getSize("default_margin").width Image { id: machinesImage diff --git a/resources/qml/Account/SyncState.qml b/resources/qml/Account/SyncState.qml index a362c93e21..aa81688e45 100644 --- a/resources/qml/Account/SyncState.qml +++ b/resources/qml/Account/SyncState.qml @@ -11,7 +11,6 @@ Row // Sync state icon + message id: syncRow width: childrenRect.width height: childrenRect.height - anchors.horizontalCenter: parent.horizontalCenter spacing: UM.Theme.getSize("narrow_margin").height states: [ @@ -49,7 +48,6 @@ Row // Sync state icon + message id: palette } - UM.RecolorImage { id: icon @@ -91,6 +89,7 @@ Row // Sync state icon + message color: UM.Theme.getColor("text") font: UM.Theme.getFont("medium") renderType: Text.NativeRendering + width: contentWidth + UM.Theme.getSize("default_margin").height height: contentHeight verticalAlignment: Text.AlignVCenter visible: !Cura.API.account.manualSyncEnabled @@ -105,6 +104,7 @@ Row // Sync state icon + message renderType: Text.NativeRendering verticalAlignment: Text.AlignVCenter height: contentHeight + width: contentWidth + UM.Theme.getSize("default_margin").height visible: Cura.API.account.manualSyncEnabled MouseArea diff --git a/resources/qml/Account/UserOperations.qml b/resources/qml/Account/UserOperations.qml index e660286257..e897e97d2e 100644 --- a/resources/qml/Account/UserOperations.qml +++ b/resources/qml/Account/UserOperations.qml @@ -10,11 +10,17 @@ import Cura 1.1 as Cura Column { spacing: UM.Theme.getSize("narrow_margin").height + topPadding: UM.Theme.getSize("default_margin").height + bottomPadding: UM.Theme.getSize("default_margin").height + width: childrenRect.width Item { + id: accountInfo width: childrenRect.width height: childrenRect.height + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width AvatarImage { id: avatar @@ -30,6 +36,8 @@ Column anchors.left: avatar.right anchors.leftMargin: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("narrow_margin").height + width: childrenRect.width + height: childrenRect.height Label { id: username From c58ef1b53105df2bc194c4c6283514cf9e06b000 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 15 Jun 2020 14:20:34 +0200 Subject: [PATCH 09/17] Fix mypy issues CURA-7418 --- cura/CuraApplication.py | 2 +- cura/UltimakerCloud/UltimakerCloudConstants.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 90197f8037..dfb5c6cac1 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -264,7 +264,7 @@ class CuraApplication(QtApplication): @pyqtProperty(str, constant=True) def ultimakerDigitalFactoryUrl(self) -> str: - return UltimakerCloudAuthentication.CuraDigitalFactoryURL + return UltimakerCloudConstants.CuraDigitalFactoryURL def addCommandLineOptions(self): """Adds command line options to the command line parser. diff --git a/cura/UltimakerCloud/UltimakerCloudConstants.py b/cura/UltimakerCloud/UltimakerCloudConstants.py index f3f862b689..8c95817ccf 100644 --- a/cura/UltimakerCloud/UltimakerCloudConstants.py +++ b/cura/UltimakerCloud/UltimakerCloudConstants.py @@ -35,7 +35,7 @@ except ImportError: CuraCloudAccountAPIRoot = DEFAULT_CLOUD_ACCOUNT_API_ROOT try: - from cura.CuraVersion import CuraDigitalFactoryURL + from cura.CuraVersion import CuraDigitalFactoryURL # type: ignore if CuraDigitalFactoryURL == "": CuraDigitalFactoryURL = DEFAULT_DIGITAL_FACTORY_URL except ImportError: From ec1ed80c9ffa85d1e5967cd09c76ea59cd1ea991 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 16 Jun 2020 09:17:58 +0200 Subject: [PATCH 10/17] Add initials when no avatar is set CURA-7418 --- resources/qml/Account/UserOperations.qml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/resources/qml/Account/UserOperations.qml b/resources/qml/Account/UserOperations.qml index e897e97d2e..68bac07ec1 100644 --- a/resources/qml/Account/UserOperations.qml +++ b/resources/qml/Account/UserOperations.qml @@ -31,6 +31,25 @@ Column source: profile["profile_image_url"] ? profile["profile_image_url"] : "" outlineColor: "transparent" } + Rectangle + { + id: initialCircle + width: avatar.width + height: avatar.height + radius: width + color: UM.Theme.getColor("action_button_disabled") + Label + { + id: initialLabel + anchors.centerIn: parent + text: profile["username"].charAt(0).toUpperCase() + font: UM.Theme.getFont("large_bold") + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + renderType: Text.NativeRendering + } + } + Column { anchors.left: avatar.right From 87a97afd84146b8a5830af0b6ec69417f0473cb3 Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Tue, 16 Jun 2020 13:35:28 +0200 Subject: [PATCH 11/17] Add newlines at the end of files CURA-7418 --- cura/UltimakerCloud/UltimakerCloudConstants.py | 2 +- resources/qml/Account/SyncState.qml | 2 +- resources/qml/TertiaryButton.qml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cura/UltimakerCloud/UltimakerCloudConstants.py b/cura/UltimakerCloud/UltimakerCloudConstants.py index 8c95817ccf..0c8ea0c9c7 100644 --- a/cura/UltimakerCloud/UltimakerCloudConstants.py +++ b/cura/UltimakerCloud/UltimakerCloudConstants.py @@ -39,4 +39,4 @@ try: if CuraDigitalFactoryURL == "": CuraDigitalFactoryURL = DEFAULT_DIGITAL_FACTORY_URL except ImportError: - CuraDigitalFactoryURL = DEFAULT_DIGITAL_FACTORY_URL \ No newline at end of file + CuraDigitalFactoryURL = DEFAULT_DIGITAL_FACTORY_URL diff --git a/resources/qml/Account/SyncState.qml b/resources/qml/Account/SyncState.qml index aa81688e45..bcf436777a 100644 --- a/resources/qml/Account/SyncState.qml +++ b/resources/qml/Account/SyncState.qml @@ -117,4 +117,4 @@ Row // Sync state icon + message } } } -} \ No newline at end of file +} diff --git a/resources/qml/TertiaryButton.qml b/resources/qml/TertiaryButton.qml index 31b56193eb..e3840dbdd3 100644 --- a/resources/qml/TertiaryButton.qml +++ b/resources/qml/TertiaryButton.qml @@ -18,4 +18,4 @@ Cura.ActionButton textDisabledColor: UM.Theme.getColor("action_button_disabled_text") hoverColor: "transparent" underlineTextOnHover: true -} \ No newline at end of file +} From 2b517a03ccec3656004c8d731bb1bbdca9450efd Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Tue, 16 Jun 2020 14:39:50 +0200 Subject: [PATCH 12/17] Fix typo CURA-7418 --- resources/qml/Account/AvatarImage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Account/AvatarImage.qml b/resources/qml/Account/AvatarImage.qml index a4f922a10d..120173366f 100644 --- a/resources/qml/Account/AvatarImage.qml +++ b/resources/qml/Account/AvatarImage.qml @@ -54,6 +54,6 @@ Item visible: hasAvatar source: UM.Theme.getIcon("circle_outline") sourceSize: Qt.size(parent.width, parent.height) - color: UM.Theme.getColor("account_widget_ouline_active") + color: UM.Theme.getColor("account_widget_outline_active") } } From 78bd5520bd7ab3ab9c05f1b07cacea409e8acf41 Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Tue, 16 Jun 2020 14:41:23 +0200 Subject: [PATCH 13/17] Add theme color for sync state icon CURA-7418 --- resources/qml/Account/SyncState.qml | 2 +- resources/themes/cura-dark/theme.json | 2 ++ resources/themes/cura-light/theme.json | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/qml/Account/SyncState.qml b/resources/qml/Account/SyncState.qml index bcf436777a..14198c1c4a 100644 --- a/resources/qml/Account/SyncState.qml +++ b/resources/qml/Account/SyncState.qml @@ -55,7 +55,7 @@ Row // Sync state icon + message height: width source: Cura.API.account.manualSyncEnabled ? UM.Theme.getIcon("update") : UM.Theme.getIcon("checked") - color: palette.text + color: UM.Theme.getColor("account_sync_state_icon") RotationAnimator { diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 37c2462633..69bd14765a 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -24,6 +24,8 @@ "main_window_header_button_text_inactive": [128, 128, 128, 255], + "account_sync_state_icon": [255, 255, 255, 204], + "machine_selector_bar": [39, 44, 48, 255], "machine_selector_active": [39, 44, 48, 255], "machine_selector_printer_icon": [204, 204, 204, 255], diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 0bc09701b2..cab2dfe89c 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -183,6 +183,7 @@ "main_window_header_button_background_hovered": [117, 114, 159, 255], "account_widget_outline_active": [70, 66, 126, 255], + "account_sync_state_icon": [25, 25, 25, 255], "machine_selector_bar": [31, 36, 39, 255], "machine_selector_active": [68, 72, 75, 255], From a9de95a1eb494a08dcb96f6cd92af9c451d20f04 Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Tue, 16 Jun 2020 14:41:52 +0200 Subject: [PATCH 14/17] Fix minor visual issues The following issues are fixed: * The visibility of the placeholder rectangle, according the existence of the avatar image * The initial letter not being visible in the dark theme * Vertical alignment of the avatar CURA-7418 --- resources/qml/Account/UserOperations.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/qml/Account/UserOperations.qml b/resources/qml/Account/UserOperations.qml index 68bac07ec1..e996e41b20 100644 --- a/resources/qml/Account/UserOperations.qml +++ b/resources/qml/Account/UserOperations.qml @@ -24,12 +24,13 @@ Column AvatarImage { id: avatar + anchors.verticalCenter: parent.verticalCenter width: UM.Theme.getSize("main_window_header").height height: UM.Theme.getSize("main_window_header").height source: profile["profile_image_url"] ? profile["profile_image_url"] : "" - outlineColor: "transparent" + outlineColor: UM.Theme.getColor("main_background") } Rectangle { @@ -37,13 +38,16 @@ Column width: avatar.width height: avatar.height radius: width + anchors.verticalCenter: parent.verticalCenter color: UM.Theme.getColor("action_button_disabled") + visible: !avatar.hasAvatar Label { id: initialLabel anchors.centerIn: parent text: profile["username"].charAt(0).toUpperCase() font: UM.Theme.getFont("large_bold") + color: UM.Theme.getColor("text") verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter renderType: Text.NativeRendering From 60e38402fb72072d11fb48ca84b99ee0ff69ebf8 Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Tue, 16 Jun 2020 14:50:06 +0200 Subject: [PATCH 15/17] Remove system palette The SystemPalette was not properly reflecting the text color in the dark theme (the icon remained black). For that reason, the palette is removed and color for the icon have been added in the themes. CURA-7418 --- resources/qml/Account/SyncState.qml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/resources/qml/Account/SyncState.qml b/resources/qml/Account/SyncState.qml index 14198c1c4a..cd8f29b364 100644 --- a/resources/qml/Account/SyncState.qml +++ b/resources/qml/Account/SyncState.qml @@ -43,11 +43,6 @@ Row // Sync state icon + message } ] - SystemPalette - { - id: palette - } - UM.RecolorImage { id: icon From 9204ed4a02d5c4c47d2eb7037827d825e28dd12d Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 17 Jun 2020 11:02:41 +0200 Subject: [PATCH 16/17] Fixes #7943 / Replacing an arbitrary value with a better one. Not the most elegant way, but it _is_ the ultimate answer after all. --- resources/definitions/fdmprinter.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index e7f8094089..323e9e16a7 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -5702,7 +5702,7 @@ "minimum_value": "0", "maximum_value": "min(0.5 * machine_width, 0.5 * machine_depth)", "minimum_value_warning": "max(extruderValues('prime_tower_line_width')) * 2", - "maximum_value_warning": "20", + "maximum_value_warning": "42", "settable_per_mesh": false, "settable_per_extruder": false }, From 6a02abefcdd61ca15acf3e85477ae45ae3f32c2b Mon Sep 17 00:00:00 2001 From: Nino van Hooff Date: Wed, 17 Jun 2020 15:34:13 +0200 Subject: [PATCH 17/17] Change copy of "Your are in sync with your account" to "Account synced" Don't think the duplication I found is necessary, but I don't dare to deduplicate it as I found some logic inconsistencies CURA-7418 --- resources/qml/Account/SyncState.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Account/SyncState.qml b/resources/qml/Account/SyncState.qml index cd8f29b364..4e5543f751 100644 --- a/resources/qml/Account/SyncState.qml +++ b/resources/qml/Account/SyncState.qml @@ -32,7 +32,7 @@ Row // Sync state icon + message name: "up_to_date" when: syncState == Cura.AccountSyncState.SUCCESS PropertyChanges { target: icon; source: UM.Theme.getIcon("checked") } - PropertyChanges { target: stateLabel; text: catalog.i18nc("@label", "You are in sync with your account")} + PropertyChanges { target: stateLabel; text: catalog.i18nc("@label", "Account synced")} }, State { @@ -80,7 +80,7 @@ Row // Sync state icon + message Label { id: stateLabel - text: catalog.i18nc("@state", catalog.i18nc("@label", "You are in sync with your account")) + text: catalog.i18nc("@state", catalog.i18nc("@label", "Account synced")) color: UM.Theme.getColor("text") font: UM.Theme.getFont("medium") renderType: Text.NativeRendering