diff options
Diffstat (limited to 'resources/qml/Preferences')
12 files changed, 66 insertions, 53 deletions
diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index c4200e2351..2934edf508 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -201,7 +201,6 @@ UM.PreferencesPage append({ text: "Русский", code: "ru_RU" }) append({ text: "Türkçe", code: "tr_TR" }) append({ text: "简体中文", code: "zh_CN" }) - append({ text: "正體字", code: "zh_TW" }) var date_object = new Date(); if (date_object.getUTCMonth() == 8 && date_object.getUTCDate() == 19) //Only add Pirate on the 19th of September. @@ -211,6 +210,7 @@ UM.PreferencesPage // incomplete and/or abandoned append({ text: catalog.i18nc("@heading", "-- incomplete --"), code: "" }) + append({ text: "正體字", code: "zh_TW" }) append({ text: "Magyar", code: "hu_HU" }) append({ text: "Suomi", code: "fi_FI" }) append({ text: "Polski", code: "pl_PL" }) @@ -224,7 +224,7 @@ UM.PreferencesPage textRole: "text" model: languageList implicitWidth: UM.Theme.getSize("combobox").width - implicitHeight: currencyField.height + height: currencyField.height function setCurrentIndex() { var code = UM.Preferences.getValue("general/language"); @@ -264,6 +264,7 @@ UM.PreferencesPage selectByMouse: true text: UM.Preferences.getValue("cura/currency") implicitWidth: UM.Theme.getSize("combobox").width + implicitHeight: UM.Theme.getSize("setting_control").height onTextChanged: UM.Preferences.setValue("cura/currency", text) } @@ -293,7 +294,7 @@ UM.PreferencesPage model: themeList textRole: "text" implicitWidth: UM.Theme.getSize("combobox").width - implicitHeight: currencyField.height + height: currencyField.height currentIndex: { diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index 93a35ff9bb..9b6f5bf609 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -12,6 +12,7 @@ import Cura 1.0 as Cura UM.ManagementPage { id: base + Item { enabled: false; UM.I18nCatalog { id: catalog; name: "cura"} } title: catalog.i18nc("@title:tab", "Printers") detailsPlaneCaption: base.currentItem && base.currentItem.name ? base.currentItem.name : "" @@ -93,8 +94,6 @@ UM.ManagementPage maximumHeight: minimumHeight * 3 } - UM.I18nCatalog { id: catalog; name: "cura"; } - UM.ConfirmRemoveDialog { id: confirmDialog diff --git a/resources/qml/Preferences/Materials/MaterialsBrandSection.qml b/resources/qml/Preferences/Materials/MaterialsBrandSection.qml index 9f7eeccc54..6f404ad738 100644 --- a/resources/qml/Preferences/Materials/MaterialsBrandSection.qml +++ b/resources/qml/Preferences/Materials/MaterialsBrandSection.qml @@ -2,7 +2,7 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 import UM 1.5 as UM diff --git a/resources/qml/Preferences/Materials/MaterialsList.qml b/resources/qml/Preferences/Materials/MaterialsList.qml index bb40187825..913e213dae 100644 --- a/resources/qml/Preferences/Materials/MaterialsList.qml +++ b/resources/qml/Preferences/Materials/MaterialsList.qml @@ -2,8 +2,8 @@ // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 import QtQuick.Layouts 1.3 +import QtQuick.Dialogs import UM 1.2 as UM import Cura 1.0 as Cura diff --git a/resources/qml/Preferences/Materials/MaterialsPage.qml b/resources/qml/Preferences/Materials/MaterialsPage.qml index 2774c2a204..d677658a37 100644 --- a/resources/qml/Preferences/Materials/MaterialsPage.qml +++ b/resources/qml/Preferences/Materials/MaterialsPage.qml @@ -3,7 +3,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.15 -import QtQuick.Dialogs 1.2 +import QtQuick.Dialogs import UM 1.5 as UM import Cura 1.5 as Cura @@ -11,7 +11,7 @@ import Cura 1.5 as Cura UM.ManagementPage { id: base - + Item { enabled: false; UM.I18nCatalog { id: catalog; name: "cura"} } // Keep PreferencesDialog happy property var resetEnabled: false property var currentItem: null @@ -226,12 +226,12 @@ UM.ManagementPage { id: importMaterialDialog title: catalog.i18nc("@title:window", "Import Material") - selectExisting: true + fileMode: FileDialog.OpenFile nameFilters: Cura.ContainerManager.getContainerNameFilters("material") - folder: CuraApplication.getDefaultPath("dialog_material_path") + currentFolder: CuraApplication.getDefaultPath("dialog_material_path") onAccepted: { - const result = Cura.ContainerManager.importMaterialContainer(fileUrl); + const result = Cura.ContainerManager.importMaterialContainer(selectedFile); const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base); messageDialog.standardButtons = Dialog.Ok; @@ -239,14 +239,14 @@ UM.ManagementPage switch (result.status) { case "success": - messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag <filename>!", "Successfully imported material <filename>%1</filename>").arg(fileUrl); + messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag <filename>!", "Successfully imported material <filename>%1</filename>").arg(selectedFile); break; default: - messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags <filename> or <message>!", "Could not import material <filename>%1</filename>: <message>%2</message>").arg(fileUrl).arg(result.message); + messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags <filename> or <message>!", "Could not import material <filename>%1</filename>: <message>%2</message>").arg(selectedFile).arg(result.message); break; } messageDialog.open(); - CuraApplication.setDefaultPath("dialog_material_path", folder); + CuraApplication.setDefaultPath("dialog_material_path", currentFolder); } } @@ -254,12 +254,14 @@ UM.ManagementPage { id: exportMaterialDialog title: catalog.i18nc("@title:window", "Export Material") - selectExisting: false + fileMode: FileDialog.SaveFile nameFilters: Cura.ContainerManager.getContainerNameFilters("material") - folder: CuraApplication.getDefaultPath("dialog_material_path") + currentFolder: CuraApplication.getDefaultPath("dialog_material_path") onAccepted: { - const result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, selectedNameFilter, fileUrl); + const nameFilterString = selectedNameFilter.index >= 0 ? nameFilters[selectedNameFilter.index] : nameFilters[0]; + + const result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, nameFilterString, selectedFile); const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base); messageDialog.title = catalog.i18nc("@title:window", "Export Material"); @@ -267,7 +269,7 @@ UM.ManagementPage switch (result.status) { case "error": - messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags <filename> and <message>!", "Failed to export material to <filename>%1</filename>: <message>%2</message>").arg(fileUrl).arg(result.message); + messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags <filename> and <message>!", "Failed to export material to <filename>%1</filename>: <message>%2</message>").arg(selectedFile).arg(result.message); break; case "success": messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag <filename>!", "Successfully exported material to <filename>%1</filename>").arg(result.path); @@ -275,7 +277,7 @@ UM.ManagementPage } messageDialog.open(); - CuraApplication.setDefaultPath("dialog_material_path", folder); + CuraApplication.setDefaultPath("dialog_material_path", currentFolder); } } } diff --git a/resources/qml/Preferences/Materials/MaterialsSlot.qml b/resources/qml/Preferences/Materials/MaterialsSlot.qml index f124736fd0..8292fbe6da 100644 --- a/resources/qml/Preferences/Materials/MaterialsSlot.qml +++ b/resources/qml/Preferences/Materials/MaterialsSlot.qml @@ -106,7 +106,7 @@ Rectangle anchors.right: materialSlot.right visible: false - UM.RecolorImage + UM.ColorImage { id: favoriteIndicator anchors.centerIn: parent diff --git a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml index e592be6d5d..08ea2efd5b 100644 --- a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml +++ b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml @@ -3,9 +3,10 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 -import QtQuick.Dialogs 1.2 +import QtQuick.Dialogs import QtQuick.Layouts 1.15 import QtQuick.Window 2.1 + import Cura 1.1 as Cura import UM 1.5 as UM @@ -230,7 +231,6 @@ Window { id: syncStatusLabel anchors.left: parent.left - wrapMode: Text.Wrap elide: Text.ElideRight visible: text !== "" font: UM.Theme.getFont("medium") @@ -297,7 +297,7 @@ Window iconSize: UM.Theme.getSize("machine_selector_icon").width //Printer status badge (always cloud, but whether it's online or offline). - UM.RecolorImage + UM.ColorImage { width: UM.Theme.getSize("printer_status_icon").width height: UM.Theme.getSize("printer_status_icon").height @@ -325,7 +325,7 @@ Window } } - UM.RecolorImage + UM.ColorImage { id: printerSpinner width: UM.Theme.getSize("section_icon").width @@ -402,7 +402,7 @@ Window UM.Label { Layout.fillWidth: true - Layout.alignment: Qt.AlignVCenter + Layout.alignment: Qt.AlignmentFlag.AlignVCenter text: catalog.i18nc("@text Asking the user whether printers are missing in a list.", "Printers missing?") + "\n" + catalog.i18nc("@text", "Make sure all your printers are turned ON and connected to Digital Factory.") @@ -413,7 +413,7 @@ Window Cura.SecondaryButton { id: refreshListButton - Layout.alignment: Qt.AlignVCenter + Layout.alignment: Qt.AlignmentFlag.AlignVCenter text: catalog.i18nc("@button", "Refresh List") iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight") onClicked: Cura.API.account.sync(true) @@ -490,7 +490,7 @@ Window visible: !syncButton.visible - UM.RecolorImage + UM.ColorImage { id: syncingIcon height: UM.Theme.getSize("action_button_icon").height @@ -558,7 +558,6 @@ Window text: catalog.i18nc("@text", "It seems like you don't have any compatible printers connected to Digital Factory. Make sure your printer is connected and it's running the latest firmware.") Layout.fillWidth: true horizontalAlignment: Text.AlignHCenter - wrapMode: Text.Wrap } Item @@ -632,7 +631,6 @@ Window { text: catalog.i18nc("@text In the UI this is followed by a list of steps the user needs to take.", "Follow the following steps to load the new material profiles to your printer.") font: UM.Theme.getFont("medium") - wrapMode: Text.Wrap Layout.fillWidth: true } @@ -700,7 +698,7 @@ Window { if(!materialsSyncDialog.hasExportedUsb) { - exportUsbDialog.folder = syncModel.getPreferredExportAllPath(); + exportUsbDialog.currentFolder = syncModel.getPreferredExportAllPath(); exportUsbDialog.open(); } else @@ -731,13 +729,13 @@ Window property variant exportUsbDialog: FileDialog { title: catalog.i18nc("@title:window", "Export All Materials") - selectExisting: false nameFilters: ["Material archives (*.umm)", "All files (*)"] + fileMode: FileDialog.SaveFile onAccepted: { - syncModel.exportAll(fileUrl); + syncModel.exportAll(selectedFile); CuraApplication.setDefaultPath("dialog_material_path", folder); materialsSyncDialog.hasExportedUsb = true; } } -}
\ No newline at end of file +} diff --git a/resources/qml/Preferences/Materials/MaterialsTypeSection.qml b/resources/qml/Preferences/Materials/MaterialsTypeSection.qml index d781218027..2e6a255014 100644 --- a/resources/qml/Preferences/Materials/MaterialsTypeSection.qml +++ b/resources/qml/Preferences/Materials/MaterialsTypeSection.qml @@ -2,7 +2,7 @@ // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 import UM 1.5 as UM diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 2cbadc6bd6..d37150075b 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -3,8 +3,8 @@ import QtQuick 2.7 import QtQuick.Controls 2.15 -import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.3 +import QtQuick.Dialogs import UM 1.5 as UM import Cura 1.0 as Cura @@ -206,7 +206,8 @@ Item { height: informationPage.rowHeight width: informationPage.columnWidth - verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Color") + verticalAlignment: Qt.AlignVCenter + text: catalog.i18nc("@label", "Color") } Row @@ -573,11 +574,11 @@ Item elide: Text.ElideRight verticalAlignment: Qt.AlignVCenter } - Cura.SpinBox + Cura.NumericTextFieldWithUnit { id: spinBox anchors.left: label.right - value: + valueText: { // In case the setting is not in the material... if (!isNaN(parseFloat(materialPropertyProvider.properties.value))) @@ -597,11 +598,15 @@ Item return 0; } width: settingsPage.columnWidth - suffix: " " + model.unit - to: 99999 + maximum: 99999 + unitText: model.unit decimals: model.unit == "mm" ? 2 : 0 + enabled: base.editingEnabled - onEditingFinished: materialPropertyProvider.setPropertyValue("value", value) + editingFinishedFunction: function() + { + materialPropertyProvider.setPropertyValue("value", parseFloat(valueText.replace(",", "."))) + } } UM.ContainerPropertyProvider diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 9ea23194e7..b7030f242b 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 -import QtQuick.Dialogs 1.2 +import QtQuick.Dialogs import UM 1.5 as UM import Cura 1.6 as Cura @@ -13,6 +13,7 @@ import Cura 1.6 as Cura UM.ManagementPage { id: base + Item { enabled: false; UM.I18nCatalog { id: catalog; name: "cura"} } property var extrudersModel: CuraApplication.getExtrudersModel() property var qualityManagementModel: CuraApplication.getQualityManagementModel() @@ -58,7 +59,7 @@ UM.ManagementPage scrollviewCaption: catalog.i18nc("@label", "Profiles compatible with active printer:") + "<br><b>" + Cura.MachineManager.activeMachine.name + "</b>" hamburgerButtonVisible: hasCurrentItem - onHamburgeButtonClicked: { + onHamburgeButtonClicked: (hamburger_button) => { const hamburerButtonHeight = hamburger_button.height; menu.popup(hamburger_button, -menu.width + hamburger_button.width / 2, hamburger_button.height); @@ -349,13 +350,18 @@ UM.ManagementPage { id: exportDialog title: catalog.i18nc("@title:window", "Export Profile") - selectExisting: false + fileMode: FileDialog.SaveFile nameFilters: base.qualityManagementModel.getFileNameFilters("profile_writer") - folder: CuraApplication.getDefaultPath("dialog_profile_path") + currentFolder: CuraApplication.getDefaultPath("dialog_profile_path") onAccepted: { + + // If nameFilters contains only 1 item, the index of selectedNameFilter will always be -1 + // This fetches the nameFilter at index selectedNameFilter.index if it is positive + const nameFilterString = selectedNameFilter.index >= 0 ? nameFilters[selectedNameFilter.index] : nameFilters[0]; + var result = Cura.ContainerManager.exportQualityChangesGroup(base.currentItem.quality_changes_group, - fileUrl, selectedNameFilter); + selectedFile, nameFilterString); if (result && result.status == "error") { @@ -365,7 +371,7 @@ UM.ManagementPage } // else pop-up Message thing from python code - CuraApplication.setDefaultPath("dialog_profile_path", folder); + CuraApplication.setDefaultPath("dialog_profile_path", currentFolder); } } @@ -385,7 +391,7 @@ UM.ManagementPage title: catalog.i18nc("@title:window", "Confirm Remove") text: catalog.i18nc("@label (%1 is object name)", "Are you sure you wish to remove %1? This cannot be undone!").arg(base.currentItemName) - standardButtons: StandardButton.Yes | StandardButton.No + standardButtons: Dialog.Yes | Dialog.No modal: true onAccepted: @@ -414,12 +420,12 @@ UM.ManagementPage { id: importDialog title: catalog.i18nc("@title:window", "Import Profile") - selectExisting: true + fileMode: FileDialog.OpenFile nameFilters: base.qualityManagementModel.getFileNameFilters("profile_reader") - folder: CuraApplication.getDefaultPath("dialog_profile_path") + currentFolder: CuraApplication.getDefaultPath("dialog_profile_path") onAccepted: { - var result = Cura.ContainerManager.importProfile(fileUrl); + var result = Cura.ContainerManager.importProfile(selectedFile); messageDialog.title = catalog.i18nc("@title:window", "Import Profile") messageDialog.text = result.message; messageDialog.open(); diff --git a/resources/qml/Preferences/SettingVisibilityItem.qml b/resources/qml/Preferences/SettingVisibilityItem.qml index b7edd54c35..8905c15124 100644 --- a/resources/qml/Preferences/SettingVisibilityItem.qml +++ b/resources/qml/Preferences/SettingVisibilityItem.qml @@ -74,7 +74,7 @@ Item } } - UM.RecolorImage + UM.ColorImage { anchors.centerIn: parent width: Math.round(check.height * 0.75) | 0 diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index 035f121537..476ba999cf 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -12,6 +12,8 @@ UM.PreferencesPage { title: catalog.i18nc("@title:tab", "Setting Visibility") + Item { enabled: false; UM.I18nCatalog { id: catalog; name: "cura"} } + property QtObject settingVisibilityPresetsModel: CuraApplication.getSettingVisibilityPresetsModel() property int scrollToIndex: 0 |