From 7c18d320c4aed9697ca6909f0095f7ed195c4046 Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Tue, 4 Oct 2016 11:13:33 +0200 Subject: [PATCH 1/8] SettingView: Only removeUnusedValue when no resolve. Contributes to CURA-2232 --- resources/qml/Settings/SettingView.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index d96923d36c..a0d055eec3 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -137,6 +137,8 @@ ScrollView key: model.key ? model.key : "" watchedProperties: [ "value", "enabled", "state", "validationState", "settable_per_extruder", "resolve" ] storeIndex: 0 + // Due to the way setPropertyValue works, removeUnusedValue gives the correct output in case of resolve + removeUnusedValue: model.resolve == undefined } Connections From 04545406cdfc5b1a0641e357a9984faab39692a7 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Oct 2016 11:29:44 +0200 Subject: [PATCH 2/8] Add Turkish language to drop-down The translation files are already in there (though the template all languages were based on is not entirely complete). But it wasn't yet in the drop-down so it couldn't be selected. Contributes to issue CURA-570. --- resources/qml/Preferences/GeneralPage.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 2839e1bc72..d254d5c15b 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -97,6 +97,7 @@ UM.PreferencesPage append({ text: catalog.i18nc("@item:inlistbox", "Italian"), code: "it" }) append({ text: catalog.i18nc("@item:inlistbox", "Dutch"), code: "nl" }) append({ text: catalog.i18nc("@item:inlistbox", "Spanish"), code: "es" }) + append({ text: catalog.i18nc("@item:inlistbox", "Turkish"), code: "tr" }) } } From 5339fc8e8d08423bb0d365423204a8fb69248d87 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Oct 2016 11:40:06 +0200 Subject: [PATCH 3/8] Put translation drop-down in their native language This makes it slightly easier to select your native language if you don't know the current language. Of course, you have to find the drop-down first... But this is how many applications do it. Contributes to issue CURA-570. --- resources/qml/Preferences/GeneralPage.qml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index d254d5c15b..86dc3886a9 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -90,14 +90,14 @@ UM.PreferencesPage id: languageList Component.onCompleted: { - append({ text: catalog.i18nc("@item:inlistbox", "English"), code: "en" }) - append({ text: catalog.i18nc("@item:inlistbox", "Finnish"), code: "fi" }) - append({ text: catalog.i18nc("@item:inlistbox", "French"), code: "fr" }) - append({ text: catalog.i18nc("@item:inlistbox", "German"), code: "de" }) - append({ text: catalog.i18nc("@item:inlistbox", "Italian"), code: "it" }) - append({ text: catalog.i18nc("@item:inlistbox", "Dutch"), code: "nl" }) - append({ text: catalog.i18nc("@item:inlistbox", "Spanish"), code: "es" }) - append({ text: catalog.i18nc("@item:inlistbox", "Turkish"), code: "tr" }) + append({ text: "English", code: "en" }) + append({ text: "Suomi", code: "fi" }) + append({ text: "Français", code: "fr" }) + append({ text: "Deutsch", code: "de" }) + append({ text: "Italiano", code: "it" }) + append({ text: "Nederlands", code: "nl" }) + append({ text: "Español", code: "es" }) + append({ text: "Türkçe", code: "tr" }) } } From 9f41d81e86447849683a2876922b2b45d686d6a3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Oct 2016 11:41:24 +0200 Subject: [PATCH 4/8] Sort language list by language code This makes it slightly easier to find your language. English is an exception, it is always put in front. Contributes to issue CURA-570. --- resources/qml/Preferences/GeneralPage.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 86dc3886a9..f727af5a10 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -91,12 +91,12 @@ UM.PreferencesPage Component.onCompleted: { append({ text: "English", code: "en" }) + append({ text: "Deutsch", code: "de" }) + append({ text: "Español", code: "es" }) append({ text: "Suomi", code: "fi" }) append({ text: "Français", code: "fr" }) - append({ text: "Deutsch", code: "de" }) append({ text: "Italiano", code: "it" }) append({ text: "Nederlands", code: "nl" }) - append({ text: "Español", code: "es" }) append({ text: "Türkçe", code: "tr" }) } } From d0019cee162d0f8290e16b5e176ac6935a19e294 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Oct 2016 12:02:08 +0200 Subject: [PATCH 5/8] Fix bounding box string in Turkish This is a key and should not have been translated. Contributes to issue CURA-570. --- resources/i18n/tr/cura.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/i18n/tr/cura.po b/resources/i18n/tr/cura.po index c354782764..7c8b4d265e 100644 --- a/resources/i18n/tr/cura.po +++ b/resources/i18n/tr/cura.po @@ -654,7 +654,7 @@ msgstr "Arayüz yükleniyor..." #, python-format msgctxt "@info" msgid "%(width).1f x %(depth).1f x %(height).1f mm" -msgstr "%(genişlik).1f x %(derinlik).1f x %(yükseklik).1f mm" +msgstr "%(width).1f x %(depth).1f x %(height).1f mm" #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.qml:27 msgctxt "@title" From 10dc8f98b8901f9c7cd438ad68bfc6d390bcfc68 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Tue, 4 Oct 2016 13:14:04 +0200 Subject: [PATCH 6/8] Highlight quality_changes values in manage profiles tabs... and strike out values that are overridden by a user value CURA-2514 --- cura/Settings/QualitySettingsModel.py | 9 +++++++-- resources/qml/Preferences/ProfileTab.qml | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/cura/Settings/QualitySettingsModel.py b/cura/Settings/QualitySettingsModel.py index e57e09e862..d0ba7f4e11 100644 --- a/cura/Settings/QualitySettingsModel.py +++ b/cura/Settings/QualitySettingsModel.py @@ -16,8 +16,9 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel): LabelRole = Qt.UserRole + 2 UnitRole = Qt.UserRole + 3 ProfileValueRole = Qt.UserRole + 4 - UserValueRole = Qt.UserRole + 5 - CategoryRole = Qt.UserRole + 6 + ProfileValueSourceRole = Qt.UserRole + 5 + UserValueRole = Qt.UserRole + 6 + CategoryRole = Qt.UserRole + 7 def __init__(self, parent = None): super().__init__(parent = parent) @@ -33,6 +34,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel): self.addRoleName(self.LabelRole, "label") self.addRoleName(self.UnitRole, "unit") self.addRoleName(self.ProfileValueRole, "profile_value") + self.addRoleName(self.ProfileValueSourceRole, "profile_value_source") self.addRoleName(self.UserValueRole, "user_value") self.addRoleName(self.CategoryRole, "category") @@ -170,9 +172,11 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel): continue profile_value = None + profile_value_source = "" for container in containers: new_value = container.getProperty(definition.key, "value") if new_value is not None: + profile_value_source = container.getMetaDataEntry("type") profile_value = new_value user_value = None @@ -201,6 +205,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel): "label": definition.label, "unit": definition.unit, "profile_value": "" if profile_value is None else str(profile_value), # it is for display only + "profile_value_source": profile_value_source, "user_value": "" if user_value is None else str(user_value), "category": current_category }) diff --git a/resources/qml/Preferences/ProfileTab.qml b/resources/qml/Preferences/ProfileTab.qml index 630d524871..4a7192d4a7 100644 --- a/resources/qml/Preferences/ProfileTab.qml +++ b/resources/qml/Preferences/ProfileTab.qml @@ -32,6 +32,26 @@ Tab role: "profile_value" title: catalog.i18nc("@title:column", "Profile") width: parent.width * 0.18 + delegate: Rectangle + { + property var setting: qualitySettings.getItem(styleData.row) + height: childrenRect.height + color: "transparent" + width: (parent != null) ? parent.width : 0 + Label + { + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + anchors.right: parent.right + text: styleData.value + font.weight: (setting.profile_value_source == "quality_changes") ? Font.Bold : Font.Normal + font.strikeout: quality == Cura.MachineManager.activeQualityId && setting.user_value != "" + opacity: font.strikeout ? 0.5 : 1 + color: styleData.textColor + elide: Text.ElideRight + } + } + } TableViewColumn { @@ -56,10 +76,13 @@ Tab model: Cura.QualitySettingsModel { + id: qualitySettings extruderId: base.extruderId extruderDefinition: base.extruderDefinition quality: base.quality != null ? base.quality : "" material: base.material != null ? base.material : "" } + + SystemPalette { id: palette } } } From fc310f2732a017e4588fbf30356b177efb12b781 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Tue, 4 Oct 2016 13:21:17 +0200 Subject: [PATCH 7/8] Fix duplicating profiles CURA-2478 --- cura/Settings/ContainerManager.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cura/Settings/ContainerManager.py b/cura/Settings/ContainerManager.py index 294ca4297a..8625e78e09 100644 --- a/cura/Settings/ContainerManager.py +++ b/cura/Settings/ContainerManager.py @@ -674,6 +674,7 @@ class ContainerManager(QObject): global_changes_id = new_unique_id new_change_instances.append(new_container) self._container_registry.addContainer(new_container) + profile_index += 1 return new_change_instances From 5a14c5e5bac30b356039c1ea306221ad6fdfbdb2 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 4 Oct 2016 12:54:52 +0200 Subject: [PATCH 8/8] Replace manual function calls to updateCurrentIndex with an explicit binding This is mostly in support of Uranium PR #165 . That changes SettingPropertyProvider so that the "properties" property does not always change. However, in general this is the more correct approach. Relates to CURA-2232 --- resources/qml/Settings/SettingComboBox.qml | 46 +++++++++++----------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/resources/qml/Settings/SettingComboBox.qml b/resources/qml/Settings/SettingComboBox.qml index 0f6bab438d..c4ca637506 100644 --- a/resources/qml/Settings/SettingComboBox.qml +++ b/resources/qml/Settings/SettingComboBox.qml @@ -87,34 +87,32 @@ SettingItem } onActivated: { forceActiveFocus(); propertyProvider.setPropertyValue("value", definition.options[index].key) } - onModelChanged: updateCurrentIndex(); - Connections + Binding { - target: propertyProvider - onPropertiesChanged: control.updateCurrentIndex() - } - - function updateCurrentIndex() { - // FIXME this needs to go away once 'resolve' is combined with 'value' in our data model. - var value; - if ((propertyProvider.properties.resolve != "None") && (stackLevel != 0) && (stackLevel != 1)) { - // We have a resolve function. Indicates that the setting is not settable per extruder and that - // we have to choose between the resolved value (default) and the global value - // (if user has explicitly set this). - value = propertyProvider.properties.resolve; - } else { - value = propertyProvider.properties.value; - } - - for(var i = 0; i < definition.options.length; ++i) { - if(definition.options[i].key == value) { - currentIndex = i; - return; + target: control + property: "currentIndex" + value: + { + // FIXME this needs to go away once 'resolve' is combined with 'value' in our data model. + var value; + if ((propertyProvider.properties.resolve != "None") && (base.stackLevel != 0) && (base.stackLevel != 1)) { + // We have a resolve function. Indicates that the setting is not settable per extruder and that + // we have to choose between the resolved value (default) and the global value + // (if user has explicitly set this). + value = propertyProvider.properties.resolve; + } else { + value = propertyProvider.properties.value; } - } - currentIndex = -1; + for(var i = 0; i < control.model.length; ++i) { + if(control.model[i].key == value) { + return i; + } + } + + return -1; + } } } }