From 9bdeb823142469cc78766e686704908fe94bb3fe Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 30 Aug 2021 10:51:27 +0200 Subject: [PATCH 1/7] Add the missing preference upgrade for 4.9 to 4.10 This could break backups in certain cases CURA-8521 --- .../VersionUpgrade49to410.py | 19 +++++++++++++++++++ .../VersionUpgrade49to410/__init__.py | 1 + 2 files changed, 20 insertions(+) diff --git a/plugins/VersionUpgrade/VersionUpgrade49to410/VersionUpgrade49to410.py b/plugins/VersionUpgrade/VersionUpgrade49to410/VersionUpgrade49to410.py index 7d9186e06b..b04c396a00 100644 --- a/plugins/VersionUpgrade/VersionUpgrade49to410/VersionUpgrade49to410.py +++ b/plugins/VersionUpgrade/VersionUpgrade49to410/VersionUpgrade49to410.py @@ -104,6 +104,25 @@ class VersionUpgrade49to410(VersionUpgrade): "g" : "D060" } + def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """ + Upgrades preferences to have the new version number. + :param serialized: The original contents of the preferences file. + :param filename: The file name of the preferences file. + :return: A list of new file names, and a list of the new contents for + those files. + """ + parser = configparser.ConfigParser(interpolation = None) + parser.read_string(serialized) + + # Update version number. + parser["metadata"]["setting_version"] = "17" + + result = io.StringIO() + parser.write(result) + return [filename], [result.getvalue()] + + def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: """Upgrades instance containers to have the new version number. diff --git a/plugins/VersionUpgrade/VersionUpgrade49to410/__init__.py b/plugins/VersionUpgrade/VersionUpgrade49to410/__init__.py index 0d5128473f..7c8dd424d1 100644 --- a/plugins/VersionUpgrade/VersionUpgrade49to410/__init__.py +++ b/plugins/VersionUpgrade/VersionUpgrade49to410/__init__.py @@ -21,6 +21,7 @@ def getMetaData() -> Dict[str, Any]: ("quality_changes", 4000016): ("quality_changes", 4000017, upgrade.upgradeInstanceContainer), ("quality", 4000016): ("quality", 4000017, upgrade.upgradeInstanceContainer), ("user", 4000016): ("user", 4000017, upgrade.upgradeInstanceContainer), + ("preferences", 7000016): ("preferences", 7000017, upgrade.upgradePreferences), }, "sources": { "machine_stack": { From a1378f9a06e20052b8b821c6c3df0a3676e7504e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 30 Aug 2021 13:28:00 +0200 Subject: [PATCH 2/7] Replace the textfield with cura.Textfield This way we don't have to use the html in the setting item and we dont have to re-do the whole hover logic in the search text field. THis also makes the search magnifier themed, so it looks a lot better in the dark theme CURA-8498 --- resources/qml/Settings/SettingView.qml | 68 +++++++++----------------- 1 file changed, 22 insertions(+), 46 deletions(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 26d88db911..3c67a9b97e 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -19,26 +19,9 @@ Item property Action configureSettings property bool findingSettings - Rectangle + Item { id: filterContainer - visible: true - - radius: UM.Theme.getSize("setting_control_radius").width - border.width: UM.Theme.getSize("default_lining").width - border.color: - { - if (hoverMouseArea.containsMouse || clearFilterButton.containsMouse) - { - return UM.Theme.getColor("setting_control_border_highlight") - } - else - { - return UM.Theme.getColor("setting_control_border") - } - } - - color: UM.Theme.getColor("setting_control") anchors { @@ -48,6 +31,7 @@ Item rightMargin: UM.Theme.getSize("default_margin").width } height: UM.Theme.getSize("print_setup_big_item").height + Timer { id: settingsSearchTimer @@ -57,33 +41,34 @@ Item repeat: false } - TextField + Cura.TextField { id: filter height: parent.height anchors.left: parent.left - anchors.right: clearFilterButton.left - anchors.rightMargin: Math.round(UM.Theme.getSize("thick_margin").width) - - placeholderText: - { - var imageSize = "width='" + UM.Theme.getSize("small_button_icon").width + "' height='" + UM.Theme.getSize("small_button_icon").height - var imageSource = "' src='"+ UM.Theme.getIcon("Magnifier") - var searchPlaceholder = catalog.i18nc("@label:textbox", "Search settings") - return "" + "
" + searchPlaceholder - } - - style: TextFieldStyle - { - textColor: UM.Theme.getColor("setting_control_text") - placeholderTextColor: UM.Theme.getColor("setting_filter_field") - font: UM.Theme.getFont("default_italic") - background: Item {} - } + anchors.right: parent.right + leftPadding: searchIcon.width + UM.Theme.getSize("default_margin").width * 2 + placeholderText: catalog.i18nc("@label:textbox", "Search settings") property var expandedCategories property bool lastFindingSettings: false + UM.RecolorImage + { + id: searchIcon + + anchors + { + verticalCenter: parent.verticalCenter + left: parent.left + leftMargin: UM.Theme.getSize("default_margin").width + } + source: UM.Theme.getIcon("search") + height: UM.Theme.getSize("small_button_icon").height + width: height + color: UM.Theme.getColor("text") + } + onTextChanged: { settingsSearchTimer.restart() @@ -127,15 +112,6 @@ Item } } - MouseArea - { - id: hoverMouseArea - anchors.fill: parent - hoverEnabled: true - acceptedButtons: Qt.NoButton - cursorShape: Qt.IBeamCursor - } - UM.SimpleButton { id: clearFilterButton From 2548fd8014c98d1d99c8f2da77df11965defc09b Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Mon, 30 Aug 2021 13:39:12 +0200 Subject: [PATCH 3/7] Fix greyed out cluster printers The PrintWindow still used an old style combobox. This resulted in a Mac user not being able to specify which clustered printer he wanted to send a slice to. Using the new QtQuick.Controls and specifically setting the currentIndex fixed it for Mac. --- plugins/UM3NetworkPrinting/resources/qml/PrintWindow.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrintWindow.qml b/plugins/UM3NetworkPrinting/resources/qml/PrintWindow.qml index 6d9f375788..441766a8e7 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/PrintWindow.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/PrintWindow.qml @@ -2,7 +2,8 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 import QtQuick.Window 2.2 -import QtQuick.Controls 1.2 +import QtQuick.Controls 2.15 + import UM 1.1 as UM UM.Dialog { @@ -84,6 +85,7 @@ UM.Dialog { ComboBox { id: printerComboBox; + currentIndex: 0; Behavior on height { NumberAnimation { duration: 100 } } height: 40 * screenScaleFactor; model: ListModel { From 5ba1e8eda8218ca81b7549832b478b9690023cdb Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Mon, 30 Aug 2021 14:20:09 +0200 Subject: [PATCH 4/7] Settings search field uses italic style Restored italic font style for the search field. To not break look and feel with the old TextField behaviour --- resources/qml/Settings/SettingView.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 3c67a9b97e..d364fba039 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -49,6 +49,7 @@ Item anchors.right: parent.right leftPadding: searchIcon.width + UM.Theme.getSize("default_margin").width * 2 placeholderText: catalog.i18nc("@label:textbox", "Search settings") + font.italic: true property var expandedCategories property bool lastFindingSettings: false From f730959f780ef6d69733dc69d2f9a1dfbe802af3 Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Mon, 30 Aug 2021 16:15:02 +0200 Subject: [PATCH 5/7] fixed discard or keep combobox on Mac Use the new controls ComboBox --- resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml index 2ddacb6d79..0a9d317d2d 100644 --- a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml @@ -3,6 +3,7 @@ import QtQuick 2.1 import QtQuick.Controls 1.1 +import QtQuick.Controls 2.15 as NewControls import QtQuick.Dialogs 1.2 import QtQuick.Window 2.1 @@ -145,10 +146,11 @@ UM.Dialog anchors.margins: UM.Theme.getSize("default_margin").width height: childrenRect.height - ComboBox + NewControls.ComboBox { id: discardOrKeepProfileChangesDropDownButton width: 300 + textRole: "text" model: ListModel { @@ -217,4 +219,4 @@ UM.Dialog } } } -} \ No newline at end of file +} From d97c4e2c9494e2fd5fdcebf65a0570b4f91fcaeb Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Tue, 31 Aug 2021 09:34:23 +0200 Subject: [PATCH 6/7] Don't use new controls for the buttons --- plugins/UM3NetworkPrinting/resources/qml/PrintWindow.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrintWindow.qml b/plugins/UM3NetworkPrinting/resources/qml/PrintWindow.qml index 441766a8e7..dcfed2f7b4 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/PrintWindow.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/PrintWindow.qml @@ -2,7 +2,8 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 import QtQuick.Window 2.2 -import QtQuick.Controls 2.15 +import QtQuick.Controls 1.1 +import QtQuick.Controls 2.15 as NewControls import UM 1.1 as UM @@ -83,7 +84,7 @@ UM.Dialog { renderType: Text.NativeRendering; } - ComboBox { + NewControls.ComboBox { id: printerComboBox; currentIndex: 0; Behavior on height { NumberAnimation { duration: 100 } } From 9ea025885a94e725d1f5e91f32f609e4118e072c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 31 Aug 2021 12:07:11 +0200 Subject: [PATCH 7/7] Update links to network troubleshooting page The new links also have campaign identifiers. Because apparently the website doesn't read the HTTP metadata information saying that it redirected from Cura, and it adds information which button it came from. The old links will remain working via redirects, for older Cura versions. Contributes to issue CURA-8528. --- plugins/MonitorStage/MonitorMain.qml | 2 +- resources/qml/WelcomePages/AddPrinterByIpContent.qml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/MonitorStage/MonitorMain.qml b/plugins/MonitorStage/MonitorMain.qml index cb16b91cb8..cfd33a70fe 100644 --- a/plugins/MonitorStage/MonitorMain.qml +++ b/plugins/MonitorStage/MonitorMain.qml @@ -159,7 +159,7 @@ Rectangle { anchors.fill: parent hoverEnabled: true - onClicked: Qt.openUrlExternally("https://ultimaker.com/en/resources/manuals/ultimaker-3d-printers") + onClicked: Qt.openUrlExternally("https://ultimaker.com/in/cura/troubleshooting/network?utm_source=cura&utm_medium=software&utm_campaign=monitor-not-connected") onEntered: manageQueueText.font.underline = true onExited: manageQueueText.font.underline = false } diff --git a/resources/qml/WelcomePages/AddPrinterByIpContent.qml b/resources/qml/WelcomePages/AddPrinterByIpContent.qml index 9a69b78a83..2207bd1708 100644 --- a/resources/qml/WelcomePages/AddPrinterByIpContent.qml +++ b/resources/qml/WelcomePages/AddPrinterByIpContent.qml @@ -203,12 +203,12 @@ Item { if (addPrinterByIpScreen.hasRequestFinished) { - return catalog.i18nc("@label", "Could not connect to device.") + "

" + return catalog.i18nc("@label", "Could not connect to device.") + "

" + catalog.i18nc("@label", "Can't connect to your Ultimaker printer?") + ""; } else { - return catalog.i18nc("@label", "The printer at this address has not responded yet.") + "

" + return catalog.i18nc("@label", "The printer at this address has not responded yet.") + "

" + catalog.i18nc("@label", "Can't connect to your Ultimaker printer?") + ""; } }