From 6c2e80d2a1a07389fefd7e01078074531db8fce4 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 12 Mar 2019 09:54:07 +0100 Subject: [PATCH 01/33] WIP: Create new Machine Settings dialog widgets --- .../MachineSettings/ComboBoxWithOptions.qml | 105 +++++++ .../qml/MachineSettings/GcodeTextArea.qml | 55 ++++ .../MachineSettingsContent.qml | 55 ++++ .../NumericTextFieldWithUnit.qml | 123 ++++++++ .../qml/MachineSettings/PolygonTextField.qml | 120 ++++++++ .../qml/MachineSettings/PrintSetupContent.qml | 272 ++++++++++++++++++ .../qml/MachineSettings/SimpleCheckBox.qml | 53 ++++ 7 files changed, 783 insertions(+) create mode 100644 resources/qml/MachineSettings/ComboBoxWithOptions.qml create mode 100644 resources/qml/MachineSettings/GcodeTextArea.qml create mode 100644 resources/qml/MachineSettings/MachineSettingsContent.qml create mode 100644 resources/qml/MachineSettings/NumericTextFieldWithUnit.qml create mode 100644 resources/qml/MachineSettings/PolygonTextField.qml create mode 100644 resources/qml/MachineSettings/PrintSetupContent.qml create mode 100644 resources/qml/MachineSettings/SimpleCheckBox.qml diff --git a/resources/qml/MachineSettings/ComboBoxWithOptions.qml b/resources/qml/MachineSettings/ComboBoxWithOptions.qml new file mode 100644 index 0000000000..1a8f208bd6 --- /dev/null +++ b/resources/qml/MachineSettings/ComboBoxWithOptions.qml @@ -0,0 +1,105 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 + +import UM 1.3 as UM +import Cura 1.1 as Cura + + +// +// ComboBox with dropdown options in the Machine Settings dialog. +// +UM.TooltipArea +{ + id: comboBoxWithOptions + + UM.I18nCatalog { id: catalog; name: "cura"; } + + height: childrenRect.height + width: childrenRect.width + text: tooltip + + property alias containerStackId: propertyProvider.containerStackId + property alias settingKey: propertyProvider.key + property alias settingStoreIndex: propertyProvider.storeIndex + + property alias labelText: fieldLabel.text + property alias labelWidth: fieldLabel.width + + property string tooltip: propertyProvider.properties.description + + // callback functions + property var afterOnActivateFunction: dummy_func + property var forceUpdateOnChangeFunction: dummy_func + + // a dummy function for default property values + function dummy_func() {} + + UM.SettingPropertyProvider + { + id: propertyProvider + watchedProperties: [ "value", "options", "description" ] + } + + Row + { + spacing: UM.Theme.getSize("default_margin").width + + Label + { + id: fieldLabel + anchors.verticalCenter: comboBox.verticalCenter + visible: text != "" + elide: Text.ElideRight + //width: Math.max(0, settingsTabs.labelColumnWidth) + } + ComboBox + { + id: comboBox + model: ListModel + { + id: optionsModel + Component.onCompleted: + { + // Options come in as a string-representation of an OrderedDict + var options = propertyProvider.properties.options.match(/^OrderedDict\(\[\((.*)\)\]\)$/) + if (options) + { + options = options[1].split("), (") + for (var i = 0; i < options.length; i++) + { + var option = options[i].substring(1, options[i].length - 1).split("', '") + optionsModel.append({text: option[1], value: option[0]}); + } + } + } + } + currentIndex: + { + var currentValue = propertyProvider.properties.value + var index = 0 + for (var i = 0; i < optionsModel.count; i++) + { + if (optionsModel.get(i).value == currentValue) + { + index = i + break + } + } + return index + } + onActivated: + { + if(propertyProvider.properties.value != optionsModel.get(index).value) + { + propertyProvider.setPropertyValue("value", optionsModel.get(index).value); + forceUpdateOnChangeFunction() + afterOnActivateFunction() + } + } + } + } +} diff --git a/resources/qml/MachineSettings/GcodeTextArea.qml b/resources/qml/MachineSettings/GcodeTextArea.qml new file mode 100644 index 0000000000..748111a8e2 --- /dev/null +++ b/resources/qml/MachineSettings/GcodeTextArea.qml @@ -0,0 +1,55 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 + +import UM 1.3 as UM +import Cura 1.1 as Cura + + +// +// TextArea widget for editing Gcode in the Machine Settings dialog. +// +UM.TooltipArea +{ + id: gcodeTextArea + + UM.I18nCatalog { id: catalog; name: "cura"; } + + height: childrenRect.height + width: childrenRect.width + text: tooltip + + property alias containerStackId: propertyProvider.containerStackId + property alias settingKey: propertyProvider.key + property alias settingStoreIndex: propertyProvider.storeIndex + + property string tooltip: propertyProvider.properties.description + + UM.SettingPropertyProvider + { + id: propertyProvider + watchedProperties: [ "value", "description" ] + } + + // TODO: put label here + + TextArea + { + id: gcodeArea + width: areaWidth + height: areaHeight + font: UM.Theme.getFont("fixed") + text: (propertyProvider.properties.value) ? propertyProvider.properties.value : "" + wrapMode: TextEdit.NoWrap + onActiveFocusChanged: + { + if (!activeFocus) + { + propertyProvider.setPropertyValue("value", text) + } + } + } +} diff --git a/resources/qml/MachineSettings/MachineSettingsContent.qml b/resources/qml/MachineSettings/MachineSettingsContent.qml new file mode 100644 index 0000000000..daa41d4c5d --- /dev/null +++ b/resources/qml/MachineSettings/MachineSettingsContent.qml @@ -0,0 +1,55 @@ +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 + + +Item +{ + id: base + anchors.fill: parent + + TabBar + { + id: bar + width: parent.width + TabButton + { + text: "Printer" + } + + Repeater + { + id: extrudersTabsRepeater + model: ["Extruder 1", "Extruder 2", "Extruder 3"] + + TabButton + { + text: modelData + } + } + } + + StackLayout + { + width: parent.width + currentIndex: bar.currentIndex + Item + { + id: printerTab + } + Repeater + { + model: ["Extruder 1", "Extruder 2", "Extruder 3"] + Item + { + anchors.centerIn: parent + + Label // TODO: this is a dummy + { + anchors.centerIn: parent + text: modelData + } + } + } + } +} diff --git a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml new file mode 100644 index 0000000000..f8b476d6f4 --- /dev/null +++ b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml @@ -0,0 +1,123 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 + +import UM 1.3 as UM +import Cura 1.1 as Cura + + +// +// TextField widget with validation for editing numeric data in the Machine Settings dialog. +// +UM.TooltipArea +{ + id: numericTextFieldWithUnit + + UM.I18nCatalog { id: catalog; name: "cura"; } + + height: childrenRect.height + width: childrenRect.width + text: tooltip + + property alias containerStackId: propertyProvider.containerStackId + property alias settingKey: propertyProvider.key + property alias settingStoreIndex: propertyProvider.storeIndex + + property alias labelText: fieldLabel.text + property alias labelWidth: fieldLabel.width + property alias unitText: unitLabel.text + + property string tooltip: propertyProvider.properties.description + + // whether negative value is allowed. This affects the validation of the input field. + property bool allowNegativeValue: false + + // callback functions + property var afterOnEditingFinishedFunction: dummy_func + property var forceUpdateOnChangeFunction: dummy_func + property var setValueFunction: null + + // a dummy function for default property values + function dummy_func() {} + + UM.SettingPropertyProvider + { + id: propertyProvider + watchedProperties: [ "value", "description" ] + } + + Row + { + id: itemRow + spacing: UM.Theme.getSize("default_margin").width + + Label + { + id: fieldLabel + anchors.verticalCenter: textFieldWithUnit.verticalCenter + visible: text != "" + elide: Text.ElideRight + renderType: Text.NativeRendering + //width: Math.max(0, settingsTabs.labelColumnWidth) + } + + Item + { + id: textFieldWithUnit + + width: textField.width + height: textField.height + + TextField + { + id: textField + text: + { + const value = propertyProvider.properties.value + return value ? value : "" + } + validator: RegExpValidator { regExp: allowNegativeValue ? /-?[0-9\.,]{0,6}/ : /[0-9\.,]{0,6}/ } + onEditingFinished: + { + if (propertyProvider && text != propertyProvider.properties.value) + { + // For some properties like the extruder-compatible material diameter, they need to + // trigger many updates, such as the available materials, the current material may + // need to be switched, etc. Although setting the diameter can be done directly via + // the provider, all the updates that need to be triggered then need to depend on + // the metadata update, a signal that can be fired way too often. The update functions + // can have if-checks to filter out the irrelevant updates, but still it incurs unnecessary + // overhead. + // The ExtruderStack class has a dedicated function for this call "setCompatibleMaterialDiameter()", + // and it triggers the diameter update signals only when it is needed. Here it is optionally + // choose to use setCompatibleMaterialDiameter() or other more specific functions that + // are available. + if (setValueFunction !== null) + { + setValueFunction(text) + } + else + { + propertyProvider.setPropertyValue("value", text) + } + forceUpdateOnChangeFunction() + afterOnEditingFinished() + } + } + } + + Label + { + id: unitLabel + anchors.right: textField.right + anchors.rightMargin: y - textField.y + anchors.verticalCenter: textField.verticalCenter + text: unitText + renderType: Text.NativeRendering + } + } + } +} diff --git a/resources/qml/MachineSettings/PolygonTextField.qml b/resources/qml/MachineSettings/PolygonTextField.qml new file mode 100644 index 0000000000..59664b9f23 --- /dev/null +++ b/resources/qml/MachineSettings/PolygonTextField.qml @@ -0,0 +1,120 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 + +import UM 1.3 as UM +import Cura 1.1 as Cura + + +// +// TextField for editing polygon data in the Machine Settings dialog. +// +UM.TooltipArea +{ + UM.I18nCatalog { id: catalog; name: "cura"; } + + height: textField.height + width: textField.width + text: tooltip + + property alias containerStackId: propertyProvider.containerStackId + property alias settingKey: propertyProvider.key + property alias settingStoreIndex: propertyProvider.storeIndex + + property alias labelText: fieldLabel.text + property alias labelWidth: fieldLabel.width + property string unitText: catalog.i18nc("@label", "mm") + + // callback functions + property var forceUpdateOnChangeFunction: dummy_func + + // a dummy function for default property values + function dummy_func() {} + + property var printHeadPolygon: + { + "x": { + "min": 0, + "max": 0, + }, + "y": { + "min": 0, + "max": 0, + }, + } + + UM.SettingPropertyProvider + { + id: propertyProvider + watchedProperties: [ "value" ] + } + + Row + { + spacing: UM.Theme.getSize("default_margin").width + + Label + { + id: fieldLabel + anchors.verticalCenter: textFieldWithUnit.verticalCenter + visible: text != "" + elide: Text.ElideRight + //width: Math.max(0, settingsTabs.labelColumnWidth) + } + + Item + { + id: textFieldWithUnit + width: textField.width + height: textField.height + + TextField + { + id: textField + text: + { + var polygon = JSON.parse(propertyProvider.properties.value) + var item = (axis == "x") ? 0 : 1 + var result = polygon[0][item] + for (var i = 1; i < polygon.length; i++) { + result = (side == "min") + ? Math.min(result, polygon[i][item]) + : Math.max(result, polygon[i][item]) + } + result = Math.abs(result) + printHeadPolygon[axis][side] = result + return result + } + validator: RegExpValidator { regExp: /[0-9\.,]{0,6}/ } + onEditingFinished: + { + printHeadPolygon[axis][side] = parseFloat(textField.text.replace(',','.')) + var polygon = [ + [-printHeadPolygon["x"]["min"], printHeadPolygon["y"]["max"]], + [-printHeadPolygon["x"]["min"], -printHeadPolygon["y"]["min"]], + [ printHeadPolygon["x"]["max"], printHeadPolygon["y"]["max"]], + [ printHeadPolygon["x"]["max"], -printHeadPolygon["y"]["min"]] + ] + var polygon_string = JSON.stringify(polygon) + if (polygon_string != propertyProvider.properties.value) + { + propertyProvider.setPropertyValue("value", polygon_string) + forceUpdateOnChangeFunction() + } + } + } + + Label + { + id: unitLabel + text: unitText + anchors.right: textField.right + anchors.rightMargin: y - textField.y + anchors.verticalCenter: textField.verticalCenter + } + } + } +} diff --git a/resources/qml/MachineSettings/PrintSetupContent.qml b/resources/qml/MachineSettings/PrintSetupContent.qml new file mode 100644 index 0000000000..d2469ff71d --- /dev/null +++ b/resources/qml/MachineSettings/PrintSetupContent.qml @@ -0,0 +1,272 @@ +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 + + +Column +{ + spacing: UM.Theme.getSize("default_margin").height + + Row + { + width: parent.width + spacing: UM.Theme.getSize("default_margin").height + + Column + { + width: settingsTabs.columnWidth + spacing: UM.Theme.getSize("default_lining").height + + Label + { + text: catalog.i18nc("@label", "Printer Settings") + font.bold: true + renderType: Text.NativeRendering + } + + Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } + + Loader + { + id: buildAreaWidthField + sourceComponent: numericTextFieldWithUnit + property string settingKey: "machine_width" + property string label: catalog.i18nc("@label", "X (Width)") + property string unit: catalog.i18nc("@label", "mm") + property bool forceUpdateOnChange: true + } + + Loader + { + id: buildAreaDepthField + sourceComponent: numericTextFieldWithUnit + property string settingKey: "machine_depth" + property string label: catalog.i18nc("@label", "Y (Depth)") + property string unit: catalog.i18nc("@label", "mm") + property bool forceUpdateOnChange: true + } + + Loader + { + id: buildAreaHeightField + sourceComponent: numericTextFieldWithUnit + property string settingKey: "machine_height" + property string label: catalog.i18nc("@label", "Z (Height)") + property string unit: catalog.i18nc("@label", "mm") + property bool forceUpdateOnChange: true + } + + Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } + + Loader + { + id: shapeComboBox + sourceComponent: comboBoxWithOptions + property string settingKey: "machine_shape" + property string label: catalog.i18nc("@label", "Build plate shape") + property bool forceUpdateOnChange: true + } + + Loader + { + id: centerIsZeroCheckBox + sourceComponent: simpleCheckBox + property string settingKey: "machine_center_is_zero" + property string label: catalog.i18nc("@option:check", "Origin at center") + property bool forceUpdateOnChange: true + } + Loader + { + id: heatedBedCheckBox + sourceComponent: simpleCheckBox + property var settingKey: "machine_heated_bed" + property string label: catalog.i18nc("@option:check", "Heated bed") + property bool forceUpdateOnChange: true + } + + Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } + + Loader + { + id: gcodeFlavorComboBox + sourceComponent: comboBoxWithOptions + property string settingKey: "machine_gcode_flavor" + property string label: catalog.i18nc("@label", "G-code flavor") + property bool forceUpdateOnChange: true + property var afterOnActivate: manager.updateHasMaterialsMetadata + } + } + + Column + { + width: settingsTabs.columnWidth + spacing: UM.Theme.getSize("default_lining").height + + Label + { + text: catalog.i18nc("@label", "Printhead Settings") + font.bold: true + renderType: Text.NativeRendering + } + + Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } + + Loader + { + id: printheadXMinField + sourceComponent: headPolygonTextField + property string label: catalog.i18nc("@label", "X min") + property string tooltip: catalog.i18nc("@tooltip", "Distance from the left of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".") + property string axis: "x" + property string side: "min" + } + + Loader + { + id: printheadYMinField + sourceComponent: headPolygonTextField + property string label: catalog.i18nc("@label", "Y min") + property string tooltip: catalog.i18nc("@tooltip", "Distance from the front of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".") + property string axis: "y" + property string side: "min" + } + + Loader + { + id: printheadXMaxField + sourceComponent: headPolygonTextField + property string label: catalog.i18nc("@label", "X max") + property string tooltip: catalog.i18nc("@tooltip", "Distance from the right of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".") + property string axis: "x" + property string side: "max" + } + + Loader + { + id: printheadYMaxField + sourceComponent: headPolygonTextField + property string label: catalog.i18nc("@label", "Y max") + property string tooltip: catalog.i18nc("@tooltip", "Distance from the rear of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".") + property string axis: "y" + property string side: "max" + } + + Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } + + Loader + { + id: gantryHeightField + sourceComponent: numericTextFieldWithUnit + property string settingKey: "gantry_height" + property string label: catalog.i18nc("@label", "Gantry height") + property string unit: catalog.i18nc("@label", "mm") + property string tooltip: catalog.i18nc("@tooltip", "The height difference between the tip of the nozzle and the gantry system (X and Y axes). Used to prevent collisions between previous prints and the gantry when printing \"One at a Time\".") + property bool forceUpdateOnChange: true + } + + Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } + + UM.TooltipArea + { + height: childrenRect.height + width: childrenRect.width + text: machineExtruderCountProvider.properties.description + visible: extruderCountModel.count >= 2 + + Row + { + spacing: UM.Theme.getSize("default_margin").width + + Label + { + anchors.verticalCenter: extruderCountComboBox.verticalCenter + width: Math.max(0, settingsTabs.labelColumnWidth) + text: catalog.i18nc("@label", "Number of Extruders") + elide: Text.ElideRight + renderType: Text.NativeRendering + } + ComboBox + { + id: extruderCountComboBox + model: ListModel + { + id: extruderCountModel + Component.onCompleted: + { + for(var i = 0; i < manager.definedExtruderCount; i++) + { + extruderCountModel.append({text: String(i + 1), value: i}) + } + } + } + + Connections + { + target: manager + onDefinedExtruderCountChanged: + { + extruderCountModel.clear(); + for(var i = 0; i < manager.definedExtruderCount; ++i) + { + extruderCountModel.append({text: String(i + 1), value: i}); + } + } + } + + currentIndex: machineExtruderCountProvider.properties.value - 1 + onActivated: + { + manager.setMachineExtruderCount(index + 1); + } + } + } + } + } + } + + Row + { + spacing: UM.Theme.getSize("default_margin").width + anchors.left: parent.left + anchors.right: parent.right + height: parent.height - y + Column + { + height: parent.height + width: settingsTabs.columnWidth + Label + { + text: catalog.i18nc("@label", "Start G-code") + font.bold: true + } + Loader + { + id: machineStartGcodeField + sourceComponent: gcodeTextArea + property int areaWidth: parent.width + property int areaHeight: parent.height - y + property string settingKey: "machine_start_gcode" + property string tooltip: catalog.i18nc("@tooltip", "G-code commands to be executed at the very start.") + } + } + + Column { + height: parent.height + width: settingsTabs.columnWidth + Label + { + text: catalog.i18nc("@label", "End G-code") + font.bold: true + } + Loader + { + id: machineEndGcodeField + sourceComponent: gcodeTextArea + property int areaWidth: parent.width + property int areaHeight: parent.height - y + property string settingKey: "machine_end_gcode" + property string tooltip: catalog.i18nc("@tooltip", "G-code commands to be executed at the very end.") + } + } + } +} diff --git a/resources/qml/MachineSettings/SimpleCheckBox.qml b/resources/qml/MachineSettings/SimpleCheckBox.qml new file mode 100644 index 0000000000..ab8877f935 --- /dev/null +++ b/resources/qml/MachineSettings/SimpleCheckBox.qml @@ -0,0 +1,53 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 + +import UM 1.3 as UM +import Cura 1.1 as Cura + + +// +// CheckBox widget for the on/off or true/false settings in the Machine Settings Dialog. +// +UM.TooltipArea +{ + UM.I18nCatalog { id: catalog; name: "cura"; } + + height: childrenRect.height + width: childrenRect.width + text: tooltip + + property alias containerStackId: propertyProvider.containerStackId + property alias settingKey: propertyProvider.key + property alias settingStoreIndex: propertyProvider.storeIndex + + property alias labelText: checkBox.text + + property string tooltip: propertyProvider.properties.description + + // callback functions + property var forceUpdateOnChangeFunction: dummy_func + + // a dummy function for default property values + function dummy_func() {} + + UM.SettingPropertyProvider + { + id: propertyProvider + watchedProperties: [ "value", "description" ] + } + + CheckBox + { + id: checkBox + checked: String(propertyProvider.properties.value).toLowerCase() != 'false' + onClicked: + { + propertyProvider.setPropertyValue("value", checked) + forceUpdateOnChangeFunction() + } + } +} From 3e4624774ac7b4f35d28db4e76f3ad1e19a00e9b Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 12 Mar 2019 13:07:21 +0100 Subject: [PATCH 02/33] WIP: Create new machine settings page --- cura/UI/WelcomePagesModel.py | 12 +- .../MachineSettings/ComboBoxWithOptions.qml | 46 ++++--- .../NumericTextFieldWithUnit.qml | 6 +- resources/qml/WelcomePages/TestContent.qml | 126 ++++++++++++++++++ 4 files changed, 166 insertions(+), 24 deletions(-) create mode 100644 resources/qml/WelcomePages/TestContent.qml diff --git a/cura/UI/WelcomePagesModel.py b/cura/UI/WelcomePagesModel.py index b4fd199a28..87158b35c3 100644 --- a/cura/UI/WelcomePagesModel.py +++ b/cura/UI/WelcomePagesModel.py @@ -3,7 +3,7 @@ import os from typing import TYPE_CHECKING, Optional -from PyQt5.QtCore import QUrl, Qt, pyqtSlot +from PyQt5.QtCore import QUrl, Qt from UM.Qt.ListModel import ListModel from UM.Resources import Resources @@ -29,6 +29,14 @@ class WelcomePagesModel(ListModel): def initialize(self) -> None: from cura.CuraApplication import CuraApplication + + self._pages.append({"id": "test", + "page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, + os.path.join("WelcomePages", + "TestContent.qml"))), + }) + + # Add default welcome pages self._pages.append({"id": "welcome", "page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, @@ -68,8 +76,8 @@ class WelcomePagesModel(ListModel): self.setItems(self._pages) - def addPage(self): pass + __all__ = ["WelcomePagesModel"] diff --git a/resources/qml/MachineSettings/ComboBoxWithOptions.qml b/resources/qml/MachineSettings/ComboBoxWithOptions.qml index 1a8f208bd6..289e4398fe 100644 --- a/resources/qml/MachineSettings/ComboBoxWithOptions.qml +++ b/resources/qml/MachineSettings/ComboBoxWithOptions.qml @@ -20,7 +20,7 @@ UM.TooltipArea height: childrenRect.height width: childrenRect.width - text: tooltip + text: tooltipText property alias containerStackId: propertyProvider.containerStackId property alias settingKey: propertyProvider.key @@ -29,7 +29,7 @@ UM.TooltipArea property alias labelText: fieldLabel.text property alias labelWidth: fieldLabel.width - property string tooltip: propertyProvider.properties.description + property string tooltipText: propertyProvider.properties.description // callback functions property var afterOnActivateFunction: dummy_func @@ -56,34 +56,40 @@ UM.TooltipArea elide: Text.ElideRight //width: Math.max(0, settingsTabs.labelColumnWidth) } - ComboBox + + ListModel { - id: comboBox - model: ListModel + id: optionsModel + Component.onCompleted: { - id: optionsModel - Component.onCompleted: + // Options come in as a string-representation of an OrderedDict + var options = propertyProvider.properties.options.match(/^OrderedDict\(\[\((.*)\)\]\)$/) + if (options) { - // Options come in as a string-representation of an OrderedDict - var options = propertyProvider.properties.options.match(/^OrderedDict\(\[\((.*)\)\]\)$/) - if (options) + options = options[1].split("), (") + for (var i = 0; i < options.length; i++) { - options = options[1].split("), (") - for (var i = 0; i < options.length; i++) - { - var option = options[i].substring(1, options[i].length - 1).split("', '") - optionsModel.append({text: option[1], value: option[0]}); - } + var option = options[i].substring(1, options[i].length - 1).split("', '") + optionsModel.append({text: option[1], value: option[0]}) } } } + } + + ComboBox + { + id: comboBox + model: optionsModel + + textRole: "text" + currentIndex: { var currentValue = propertyProvider.properties.value var index = 0 - for (var i = 0; i < optionsModel.count; i++) + for (var i = 0; i < model.count; i++) { - if (optionsModel.get(i).value == currentValue) + if (model.get(i).value == currentValue) { index = i break @@ -93,9 +99,9 @@ UM.TooltipArea } onActivated: { - if(propertyProvider.properties.value != optionsModel.get(index).value) + if(propertyProvider.properties.value != model.get(index).value) { - propertyProvider.setPropertyValue("value", optionsModel.get(index).value); + propertyProvider.setPropertyValue("value", model.get(index).value) forceUpdateOnChangeFunction() afterOnActivateFunction() } diff --git a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml index f8b476d6f4..bb431cb6ad 100644 --- a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml +++ b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml @@ -20,7 +20,8 @@ UM.TooltipArea height: childrenRect.height width: childrenRect.width - text: tooltip + + text: tooltipText property alias containerStackId: propertyProvider.containerStackId property alias settingKey: propertyProvider.key @@ -30,7 +31,7 @@ UM.TooltipArea property alias labelWidth: fieldLabel.width property alias unitText: unitLabel.text - property string tooltip: propertyProvider.properties.description + property string tooltipText: propertyProvider.properties.description // whether negative value is allowed. This affects the validation of the input field. property bool allowNegativeValue: false @@ -43,6 +44,7 @@ UM.TooltipArea // a dummy function for default property values function dummy_func() {} + UM.SettingPropertyProvider { id: propertyProvider diff --git a/resources/qml/WelcomePages/TestContent.qml b/resources/qml/WelcomePages/TestContent.qml new file mode 100644 index 0000000000..31506b8285 --- /dev/null +++ b/resources/qml/WelcomePages/TestContent.qml @@ -0,0 +1,126 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 + +import UM 1.3 as UM +import Cura 1.1 as Cura + +import "../MachineSettings" + + +// +// This component contains the content for the "Welcome" page of the welcome on-boarding process. +// + +Row +{ + id: base + UM.I18nCatalog { id: catalog; name: "cura" } + + property int labelWidth: 100 + + // Left-side column for "Printer Settings" + Column + { + spacing: 10 + + Label + { + text: catalog.i18nc("@title:label", "Printer Settings") + font: UM.Theme.getFont("medium_bold") + } + + NumericTextFieldWithUnit // "X (Width)" + { + id: machineXWidthField + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_width" + settingStoreIndex: 1 // TODO + labelText: catalog.i18nc("@label", "X (Width)") + labelWidth: base.labelWidth + unitText: catalog.i18nc("@label", "mm") + // TODO: add forceUpdateOnChangeFunction: + } + + NumericTextFieldWithUnit // "Y (Depth)" + { + id: machineYDepthField + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_depth" + settingStoreIndex: 1 // TODO + labelText: catalog.i18nc("@label", "Y (Depth)") + labelWidth: base.labelWidth + unitText: catalog.i18nc("@label", "mm") + // TODO: add forceUpdateOnChangeFunction: + } + + NumericTextFieldWithUnit // "Z (Height)" + { + id: machineZHeightField + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_height" + settingStoreIndex: 1 // TODO + labelText: catalog.i18nc("@label", "Z (Height)") + labelWidth: base.labelWidth + unitText: catalog.i18nc("@label", "mm") + // TODO: add forceUpdateOnChangeFunction: + } + + ComboBoxWithOptions // "Build plate shape" + { + id: buildPlateShapeComboBox + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_shape" + settingStoreIndex: 1 // TODO + labelText: catalog.i18nc("@label", "Build plate shape") + labelWidth: base.labelWidth + // TODO: add forceUpdateOnChangeFunction: + } + + SimpleCheckBox // "Origin at center" + { + id: originAtCenterCheckBox + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_center_is_zero" + settingStoreIndex: 1 // TODO + labelText: catalog.i18nc("@label", "Origin at center") + // TODO: add forceUpdateOnChangeFunction: + } + + SimpleCheckBox // "Heated bed" + { + id: heatedBedCheckBox + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_heated_bed" + settingStoreIndex: 1 // TODO + labelText: catalog.i18nc("@label", "Heated bed") + // TODO: add forceUpdateOnChangeFunction: + } + + ComboBoxWithOptions // "G-code flavor" + { + id: gcodeFlavorComboBox + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_gcode_flavor" + settingStoreIndex: 1 // TODO + labelText: catalog.i18nc("@label", "G-code flavor") + labelWidth: base.labelWidth + // TODO: add forceUpdateOnChangeFunction: + // TODO: add afterOnActivate: manager.updateHasMaterialsMetadata + } + } + + // Right-side column for "Printhead Settings" + Column + { + spacing: 10 + + Label + { + text: catalog.i18nc("@title:label", "Printhead Settings") + font: UM.Theme.getFont("medium_bold") + } + } +} From 752a48cacd65a221df6a6f8a3a3b3c8283c6a8ea Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 12 Mar 2019 14:36:08 +0100 Subject: [PATCH 03/33] WIP: Refactor and create reusable CuraComboBox --- .../MachineSettings/ComboBoxWithOptions.qml | 9 +- resources/qml/Settings/SettingComboBox.qml | 144 ++--------------- resources/qml/WelcomePages/TestContent.qml | 3 + resources/qml/Widgets/CuraComboBox.qml | 152 ++++++++++++++++++ 4 files changed, 175 insertions(+), 133 deletions(-) create mode 100644 resources/qml/Widgets/CuraComboBox.qml diff --git a/resources/qml/MachineSettings/ComboBoxWithOptions.qml b/resources/qml/MachineSettings/ComboBoxWithOptions.qml index 289e4398fe..de69ba3478 100644 --- a/resources/qml/MachineSettings/ComboBoxWithOptions.qml +++ b/resources/qml/MachineSettings/ComboBoxWithOptions.qml @@ -8,6 +8,8 @@ import QtQuick.Layouts 1.3 import UM 1.3 as UM import Cura 1.1 as Cura +import "../Widgets" + // // ComboBox with dropdown options in the Machine Settings dialog. @@ -54,7 +56,6 @@ UM.TooltipArea anchors.verticalCenter: comboBox.verticalCenter visible: text != "" elide: Text.ElideRight - //width: Math.max(0, settingsTabs.labelColumnWidth) } ListModel @@ -76,11 +77,12 @@ UM.TooltipArea } } - ComboBox + CuraComboBox { id: comboBox + width: 100 + height: UM.Theme.getSize("action_button").height model: optionsModel - textRole: "text" currentIndex: @@ -97,6 +99,7 @@ UM.TooltipArea } return index } + onActivated: { if(propertyProvider.properties.value != model.get(index).value) diff --git a/resources/qml/Settings/SettingComboBox.qml b/resources/qml/Settings/SettingComboBox.qml index 768872d2f7..d9ea47ac4d 100644 --- a/resources/qml/Settings/SettingComboBox.qml +++ b/resources/qml/Settings/SettingComboBox.qml @@ -1,17 +1,20 @@ // Copyright (c) 2019 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.7 -import QtQuick.Controls 2.0 +import QtQuick 2.10 +import QtQuick.Controls 2.3 + +import UM 1.3 as UM + +import "../Widgets" as Widgets -import UM 1.1 as UM SettingItem { id: base property var focusItem: control - contents: ComboBox + contents: Widgets.CuraComboBox { id: control @@ -20,125 +23,6 @@ SettingItem anchors.fill: parent - background: Rectangle - { - color: - { - if (!enabled) - { - return UM.Theme.getColor("setting_control_disabled") - } - - if (control.hovered || control.activeFocus) - { - return UM.Theme.getColor("setting_control_highlight") - } - - return UM.Theme.getColor("setting_control") - } - - radius: UM.Theme.getSize("setting_control_radius").width - border.width: UM.Theme.getSize("default_lining").width - border.color: - { - if (!enabled) - { - return UM.Theme.getColor("setting_control_disabled_border") - } - - if (control.hovered || control.activeFocus) - { - return UM.Theme.getColor("setting_control_border_highlight") - } - - return UM.Theme.getColor("setting_control_border") - } - } - - indicator: UM.RecolorImage - { - id: downArrow - x: control.width - width - control.rightPadding - y: control.topPadding + Math.round((control.availableHeight - height) / 2) - - source: UM.Theme.getIcon("arrow_bottom") - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 * screenScaleFactor - sourceSize.height: width + 5 * screenScaleFactor - - color: UM.Theme.getColor("setting_control_button") - } - - contentItem: Label - { - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width - anchors.verticalCenter: parent.verticalCenter - anchors.right: downArrow.left - - text: control.currentText - textFormat: Text.PlainText - renderType: Text.NativeRendering - font: UM.Theme.getFont("default") - color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } - - popup: Popup - { - y: control.height - UM.Theme.getSize("default_lining").height - width: control.width - implicitHeight: contentItem.implicitHeight + 2 * UM.Theme.getSize("default_lining").width - padding: UM.Theme.getSize("default_lining").width - - contentItem: ListView - { - clip: true - implicitHeight: contentHeight - model: control.popup.visible ? control.delegateModel : null - currentIndex: control.highlightedIndex - - ScrollIndicator.vertical: ScrollIndicator { } - } - - background: Rectangle - { - color: UM.Theme.getColor("setting_control") - border.color: UM.Theme.getColor("setting_control_border") - } - } - - delegate: ItemDelegate - { - width: control.width - 2 * UM.Theme.getSize("default_lining").width - height: control.height - highlighted: control.highlightedIndex == index - - contentItem: Label - { - // FIXME: Somehow the top/bottom anchoring is not correct on Linux and it results in invisible texts. - anchors.fill: parent - anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width - anchors.rightMargin: UM.Theme.getSize("setting_unit_margin").width - - text: modelData.value - textFormat: Text.PlainText - renderType: Text.NativeRendering - color: control.contentItem.color - font: UM.Theme.getFont("default") - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } - - background: Rectangle - { - color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent" - border.color: parent.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent" - } - } - onActivated: { forceActiveFocus() @@ -170,29 +54,29 @@ SettingItem value: { // FIXME this needs to go away once 'resolve' is combined with 'value' in our data model. - var value = undefined; + var value = undefined if ((base.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 = base.resolve; + value = base.resolve } if (value == undefined) { - value = propertyProvider.properties.value; + value = propertyProvider.properties.value } - for(var i = 0; i < control.model.length; ++i) + for (var i = 0; i < control.model.length; i++) { - if(control.model[i].key == value) + if (control.model[i].key == value) { - return i; + return i } } - return -1; + return -1 } } } diff --git a/resources/qml/WelcomePages/TestContent.qml b/resources/qml/WelcomePages/TestContent.qml index 31506b8285..b7a3da3d71 100644 --- a/resources/qml/WelcomePages/TestContent.qml +++ b/resources/qml/WelcomePages/TestContent.qml @@ -122,5 +122,8 @@ Row text: catalog.i18nc("@title:label", "Printhead Settings") font: UM.Theme.getFont("medium_bold") } + + + } } diff --git a/resources/qml/Widgets/CuraComboBox.qml b/resources/qml/Widgets/CuraComboBox.qml new file mode 100644 index 0000000000..6ce7c6da45 --- /dev/null +++ b/resources/qml/Widgets/CuraComboBox.qml @@ -0,0 +1,152 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 + +import UM 1.3 as UM +import Cura 1.1 as Cura + + +// +// ComboBox with Cura styling. +// +ComboBox +{ + id: control + + background: Rectangle + { + color: + { + if (!enabled) + { + return UM.Theme.getColor("setting_control_disabled") + } + + if (control.hovered || control.activeFocus) + { + return UM.Theme.getColor("setting_control_highlight") + } + + return UM.Theme.getColor("setting_control") + } + + radius: UM.Theme.getSize("setting_control_radius").width + border.width: UM.Theme.getSize("default_lining").width + border.color: + { + if (!enabled) + { + return UM.Theme.getColor("setting_control_disabled_border") + } + + if (control.hovered || control.activeFocus) + { + return UM.Theme.getColor("setting_control_border_highlight") + } + + return UM.Theme.getColor("setting_control_border") + } + } + + indicator: UM.RecolorImage + { + id: downArrow + x: control.width - width - control.rightPadding + y: control.topPadding + Math.round((control.availableHeight - height) / 2) + + source: UM.Theme.getIcon("arrow_bottom") + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + sourceSize.width: width + 5 * screenScaleFactor + sourceSize.height: width + 5 * screenScaleFactor + + color: UM.Theme.getColor("setting_control_button") + } + + contentItem: Label + { + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width + anchors.verticalCenter: parent.verticalCenter + anchors.right: downArrow.left + + text: control.currentText + textFormat: Text.PlainText + renderType: Text.NativeRendering + font: UM.Theme.getFont("default") + color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter + } + + popup: Popup + { + y: control.height - UM.Theme.getSize("default_lining").height + width: control.width + implicitHeight: contentItem.implicitHeight + 2 * UM.Theme.getSize("default_lining").width + padding: UM.Theme.getSize("default_lining").width + + contentItem: ListView + { + clip: true + implicitHeight: contentHeight + model: control.popup.visible ? control.delegateModel : null + currentIndex: control.highlightedIndex + + ScrollIndicator.vertical: ScrollIndicator { } + } + + background: Rectangle + { + color: UM.Theme.getColor("setting_control") + border.color: UM.Theme.getColor("setting_control_border") + } + } + + delegate: ItemDelegate + { + id: delegateItem + width: control.width - 2 * UM.Theme.getSize("default_lining").width + height: control.height + highlighted: control.highlightedIndex == index + text: + // FIXME: Maybe there is a better way to do this. Check model and modelData doc page: + // https://doc.qt.io/qt-5/qtquick-modelviewsdata-modelview.html + { + var _val = undefined + if (typeof _val === 'undefined') // try to get textRole from "model". + { + _val = model[textRole] + } + if (typeof _val === 'undefined') // try to get textRole from "modelData" if it's still undefined. + { + _val = modelData[textRole] + } + return (typeof _val !== 'undefined') ? _val : "" + } + + contentItem: Label + { + // FIXME: Somehow the top/bottom anchoring is not correct on Linux and it results in invisible texts. + anchors.fill: parent + anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width + anchors.rightMargin: UM.Theme.getSize("setting_unit_margin").width + + text: delegateItem.text + textFormat: Text.PlainText + renderType: Text.NativeRendering + color: control.contentItem.color + font: UM.Theme.getFont("default") + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter + } + + background: Rectangle + { + color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent" + border.color: parent.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent" + } + } +} From cf0e3effc7777237a0aa7cb0bf11d66330f08006 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 18 Mar 2019 08:48:29 +0100 Subject: [PATCH 04/33] WIP: Refactor NumericTextFieldWithUnit --- plugins/Toolbox/src/Toolbox.py | 1 - .../NumericTextFieldWithUnit.qml | 147 +++++++++++++----- 2 files changed, 109 insertions(+), 39 deletions(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 7d8d359831..add138b859 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -50,7 +50,6 @@ class Toolbox(QObject, Extension): self._request_headers = [] # type: List[Tuple[bytes, bytes]] self._updateRequestHeader() - self._request_urls = {} # type: Dict[str, QUrl] self._to_update = [] # type: List[str] # Package_ids that are waiting to be updated self._old_plugin_ids = set() # type: Set[str] diff --git a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml index bb431cb6ad..473f90d863 100644 --- a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml +++ b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml @@ -21,6 +21,9 @@ UM.TooltipArea height: childrenRect.height width: childrenRect.width + property int controlWidth: UM.Theme.getSize("setting_control").width + property int controlHeight: UM.Theme.getSize("setting_control").height + text: tooltipText property alias containerStackId: propertyProvider.containerStackId @@ -63,62 +66,130 @@ UM.TooltipArea visible: text != "" elide: Text.ElideRight renderType: Text.NativeRendering - //width: Math.max(0, settingsTabs.labelColumnWidth) } - Item + TextField { id: textFieldWithUnit - width: textField.width - height: textField.height + width: numericTextFieldWithUnit.controlWidth + height: numericTextFieldWithUnit.controlHeight - TextField + // Background is a rounded-cornered box with filled color as state indication (normal, warning, error, etc.) + background: Rectangle { - id: textField - text: + anchors.fill: parent + anchors.margins: Math.round(UM.Theme.getSize("default_lining").width) + radius: UM.Theme.getSize("setting_control_radius").width + + border.color: { - const value = propertyProvider.properties.value - return value ? value : "" - } - validator: RegExpValidator { regExp: allowNegativeValue ? /-?[0-9\.,]{0,6}/ : /[0-9\.,]{0,6}/ } - onEditingFinished: - { - if (propertyProvider && text != propertyProvider.properties.value) + if (!textFieldWithUnit.enabled) { - // For some properties like the extruder-compatible material diameter, they need to - // trigger many updates, such as the available materials, the current material may - // need to be switched, etc. Although setting the diameter can be done directly via - // the provider, all the updates that need to be triggered then need to depend on - // the metadata update, a signal that can be fired way too often. The update functions - // can have if-checks to filter out the irrelevant updates, but still it incurs unnecessary - // overhead. - // The ExtruderStack class has a dedicated function for this call "setCompatibleMaterialDiameter()", - // and it triggers the diameter update signals only when it is needed. Here it is optionally - // choose to use setCompatibleMaterialDiameter() or other more specific functions that - // are available. - if (setValueFunction !== null) - { - setValueFunction(text) - } - else - { - propertyProvider.setPropertyValue("value", text) - } - forceUpdateOnChangeFunction() - afterOnEditingFinished() + return UM.Theme.getColor("setting_control_disabled_border") } + switch (propertyProvider.properties.validationState) + { + case "ValidatorState.Exception": + case "ValidatorState.MinimumError": + case "ValidatorState.MaximumError": + return UM.Theme.getColor("setting_validation_error") + case "ValidatorState.MinimumWarning": + case "ValidatorState.MaximumWarning": + return UM.Theme.getColor("setting_validation_warning") + } + // Validation is OK. + if (textFieldWithUnit.hovered || textFieldWithUnit.activeFocus) + { + return UM.Theme.getColor("setting_control_border_highlight") + } + return UM.Theme.getColor("setting_control_border") + } + + color: + { + if (!textFieldWithUnit.enabled) + { + return UM.Theme.getColor("setting_control_disabled") + } + switch (propertyProvider.properties.validationState) + { + case "ValidatorState.Exception": + case "ValidatorState.MinimumError": + case "ValidatorState.MaximumError": + return UM.Theme.getColor("setting_validation_error_background") + case "ValidatorState.MinimumWarning": + case "ValidatorState.MaximumWarning": + return UM.Theme.getColor("setting_validation_warning_background") + case "ValidatorState.Valid": + return UM.Theme.getColor("setting_validation_ok") + default: + return UM.Theme.getColor("setting_control") + } + } + } + + hoverEnabled: true + selectByMouse: true + font: UM.Theme.getFont("default") + renderType: Text.NativeRendering + + // When the textbox gets focused by TAB, select all text + onActiveFocusChanged: + { + if (activeFocus && (focusReason == Qt.TabFocusReason || focusReason == Qt.BacktabFocusReason)) + { + selectAll() + } + } + + text: + { + const value = propertyProvider.properties.value + return value ? value : "" + } + validator: RegExpValidator { regExp: allowNegativeValue ? /-?[0-9\.,]{0,6}/ : /[0-9\.,]{0,6}/ } + + onEditingFinished: + { + if (propertyProvider && text != propertyProvider.properties.value) + { + // For some properties like the extruder-compatible material diameter, they need to + // trigger many updates, such as the available materials, the current material may + // need to be switched, etc. Although setting the diameter can be done directly via + // the provider, all the updates that need to be triggered then need to depend on + // the metadata update, a signal that can be fired way too often. The update functions + // can have if-checks to filter out the irrelevant updates, but still it incurs unnecessary + // overhead. + // The ExtruderStack class has a dedicated function for this call "setCompatibleMaterialDiameter()", + // and it triggers the diameter update signals only when it is needed. Here it is optionally + // choose to use setCompatibleMaterialDiameter() or other more specific functions that + // are available. + if (setValueFunction !== null) + { + setValueFunction(text) + } + else + { + propertyProvider.setPropertyValue("value", text) + } + forceUpdateOnChangeFunction() + afterOnEditingFinished() } } Label { id: unitLabel - anchors.right: textField.right - anchors.rightMargin: y - textField.y - anchors.verticalCenter: textField.verticalCenter + anchors.right: parent.right + anchors.rightMargin: Math.round(UM.Theme.getSize("setting_unit_margin").width) + anchors.verticalCenter: parent.verticalCenter text: unitText + textFormat: Text.PlainText + verticalAlignment: Text.AlignVCenter renderType: Text.NativeRendering + color: UM.Theme.getColor("setting_unit") + font: UM.Theme.getFont("default") } } } From 0fb9ee6c9a8928f36998e76535a709e975489c64 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 18 Mar 2019 08:53:41 +0100 Subject: [PATCH 05/33] WIP: Add CheckBox and fix styles --- .../MachineSettings/ComboBoxWithOptions.qml | 11 ++- .../NumericTextFieldWithUnit.qml | 3 +- .../qml/MachineSettings/SimpleCheckBox.qml | 11 ++- resources/qml/WelcomePages/TestContent.qml | 7 ++ resources/qml/Widgets/CuraCheckBox.qml | 76 +++++++++++++++++++ 5 files changed, 103 insertions(+), 5 deletions(-) create mode 100644 resources/qml/Widgets/CuraCheckBox.qml diff --git a/resources/qml/MachineSettings/ComboBoxWithOptions.qml b/resources/qml/MachineSettings/ComboBoxWithOptions.qml index de69ba3478..6d566f6c62 100644 --- a/resources/qml/MachineSettings/ComboBoxWithOptions.qml +++ b/resources/qml/MachineSettings/ComboBoxWithOptions.qml @@ -24,11 +24,15 @@ UM.TooltipArea width: childrenRect.width text: tooltipText + property int controlWidth: UM.Theme.getSize("setting_control").width + property int controlHeight: UM.Theme.getSize("setting_control").height + property alias containerStackId: propertyProvider.containerStackId property alias settingKey: propertyProvider.key property alias settingStoreIndex: propertyProvider.storeIndex property alias labelText: fieldLabel.text + property alias labelFont: fieldLabel.font property alias labelWidth: fieldLabel.width property string tooltipText: propertyProvider.properties.description @@ -55,7 +59,8 @@ UM.TooltipArea id: fieldLabel anchors.verticalCenter: comboBox.verticalCenter visible: text != "" - elide: Text.ElideRight + font: UM.Theme.getFont("medium") + renderType: Text.NativeRendering } ListModel @@ -80,8 +85,8 @@ UM.TooltipArea CuraComboBox { id: comboBox - width: 100 - height: UM.Theme.getSize("action_button").height + width: comboBoxWithOptions.controlWidth + height: comboBoxWithOptions.controlHeight model: optionsModel textRole: "text" diff --git a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml index 473f90d863..aacfd185a9 100644 --- a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml +++ b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml @@ -31,6 +31,7 @@ UM.TooltipArea property alias settingStoreIndex: propertyProvider.storeIndex property alias labelText: fieldLabel.text + property alias labelFont: fieldLabel.font property alias labelWidth: fieldLabel.width property alias unitText: unitLabel.text @@ -64,7 +65,7 @@ UM.TooltipArea id: fieldLabel anchors.verticalCenter: textFieldWithUnit.verticalCenter visible: text != "" - elide: Text.ElideRight + font: UM.Theme.getFont("medium") renderType: Text.NativeRendering } diff --git a/resources/qml/MachineSettings/SimpleCheckBox.qml b/resources/qml/MachineSettings/SimpleCheckBox.qml index ab8877f935..2147be9859 100644 --- a/resources/qml/MachineSettings/SimpleCheckBox.qml +++ b/resources/qml/MachineSettings/SimpleCheckBox.qml @@ -8,14 +8,20 @@ import QtQuick.Layouts 1.3 import UM 1.3 as UM import Cura 1.1 as Cura +import "../Widgets" + // // CheckBox widget for the on/off or true/false settings in the Machine Settings Dialog. // UM.TooltipArea { + id: simpleCheckBox + UM.I18nCatalog { id: catalog; name: "cura"; } + property int controlHeight: UM.Theme.getSize("setting_control").height + height: childrenRect.height width: childrenRect.width text: tooltip @@ -25,6 +31,7 @@ UM.TooltipArea property alias settingStoreIndex: propertyProvider.storeIndex property alias labelText: checkBox.text + property alias labelFont: checkBox.font property string tooltip: propertyProvider.properties.description @@ -40,10 +47,12 @@ UM.TooltipArea watchedProperties: [ "value", "description" ] } - CheckBox + CuraCheckBox { id: checkBox checked: String(propertyProvider.properties.value).toLowerCase() != 'false' + height: simpleCheckBox.controlHeight + font: UM.Theme.getFont("medium") onClicked: { propertyProvider.setPropertyValue("value", checked) diff --git a/resources/qml/WelcomePages/TestContent.qml b/resources/qml/WelcomePages/TestContent.qml index b7a3da3d71..193a1090e3 100644 --- a/resources/qml/WelcomePages/TestContent.qml +++ b/resources/qml/WelcomePages/TestContent.qml @@ -20,6 +20,7 @@ Row UM.I18nCatalog { id: catalog; name: "cura" } property int labelWidth: 100 + property var labelFont: UM.Theme.getFont("medium") // Left-side column for "Printer Settings" Column @@ -39,6 +40,7 @@ Row settingKey: "machine_width" settingStoreIndex: 1 // TODO labelText: catalog.i18nc("@label", "X (Width)") + labelFont: base.labelFont labelWidth: base.labelWidth unitText: catalog.i18nc("@label", "mm") // TODO: add forceUpdateOnChangeFunction: @@ -51,6 +53,7 @@ Row settingKey: "machine_depth" settingStoreIndex: 1 // TODO labelText: catalog.i18nc("@label", "Y (Depth)") + labelFont: base.labelFont labelWidth: base.labelWidth unitText: catalog.i18nc("@label", "mm") // TODO: add forceUpdateOnChangeFunction: @@ -63,6 +66,7 @@ Row settingKey: "machine_height" settingStoreIndex: 1 // TODO labelText: catalog.i18nc("@label", "Z (Height)") + labelFont: base.labelFont labelWidth: base.labelWidth unitText: catalog.i18nc("@label", "mm") // TODO: add forceUpdateOnChangeFunction: @@ -86,6 +90,7 @@ Row settingKey: "machine_center_is_zero" settingStoreIndex: 1 // TODO labelText: catalog.i18nc("@label", "Origin at center") + labelFont: base.labelFont // TODO: add forceUpdateOnChangeFunction: } @@ -96,6 +101,7 @@ Row settingKey: "machine_heated_bed" settingStoreIndex: 1 // TODO labelText: catalog.i18nc("@label", "Heated bed") + labelFont: base.labelFont // TODO: add forceUpdateOnChangeFunction: } @@ -106,6 +112,7 @@ Row settingKey: "machine_gcode_flavor" settingStoreIndex: 1 // TODO labelText: catalog.i18nc("@label", "G-code flavor") + labelFont: base.labelFont labelWidth: base.labelWidth // TODO: add forceUpdateOnChangeFunction: // TODO: add afterOnActivate: manager.updateHasMaterialsMetadata diff --git a/resources/qml/Widgets/CuraCheckBox.qml b/resources/qml/Widgets/CuraCheckBox.qml new file mode 100644 index 0000000000..865d9af5a2 --- /dev/null +++ b/resources/qml/Widgets/CuraCheckBox.qml @@ -0,0 +1,76 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 + +import UM 1.3 as UM +import Cura 1.1 as Cura + + +// +// ComboBox with Cura styling. +// +CheckBox +{ + id: control + + hoverEnabled: true + + indicator: Rectangle + { + width: control.height + height: control.height + + color: + { + if (!control.enabled) + { + return UM.Theme.getColor("setting_control_disabled") + } + if (control.hovered || control.activeFocus) + { + return UM.Theme.getColor("setting_control_highlight") + } + return UM.Theme.getColor("setting_control") + } + + radius: UM.Theme.getSize("setting_control_radius").width + border.width: UM.Theme.getSize("default_lining").width + border.color: + { + if (!enabled) + { + return UM.Theme.getColor("setting_control_disabled_border") + } + if (control.hovered || control.activeFocus) + { + return UM.Theme.getColor("setting_control_border_highlight") + } + return UM.Theme.getColor("setting_control_border") + } + + UM.RecolorImage + { + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + width: Math.round(parent.width / 2.5) + height: Math.round(parent.height / 2.5) + sourceSize.height: width + color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text"); + source: UM.Theme.getIcon("check") + opacity: control.checked ? 1 : 0 + Behavior on opacity { NumberAnimation { duration: 100; } } + } + } + + contentItem: Label + { + id: textLabel + leftPadding: control.indicator.width + control.spacing + text: control.text + font: control.font + renderType: Text.NativeRendering + verticalAlignment: Text.AlignVCenter + } +} From a2f845f90eb841386078037cac84d55c6d2869d9 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 18 Mar 2019 12:01:52 +0100 Subject: [PATCH 06/33] WIP: Add PrintHeadMinMaxTextField --- .../NumericTextFieldWithUnit.qml | 12 ++- .../PrintHeadMinMaxTextField.qml | 81 +++++++++++++++++++ 2 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 resources/qml/MachineSettings/PrintHeadMinMaxTextField.qml diff --git a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml index aacfd185a9..f3f4de6981 100644 --- a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml +++ b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml @@ -3,7 +3,6 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import QtQuick.Layouts 1.3 import UM 1.3 as UM import Cura 1.1 as Cura @@ -30,11 +29,16 @@ UM.TooltipArea property alias settingKey: propertyProvider.key property alias settingStoreIndex: propertyProvider.storeIndex + property alias propertyProvider: propertyProvider property alias labelText: fieldLabel.text property alias labelFont: fieldLabel.font property alias labelWidth: fieldLabel.width property alias unitText: unitLabel.text + property alias valueText: textFieldWithUnit.text + property alias valueValidator: textFieldWithUnit.validator + property alias editingFinishedFunction: textFieldWithUnit.editingFinishedFunction + property string tooltipText: propertyProvider.properties.description // whether negative value is allowed. This affects the validation of the input field. @@ -151,7 +155,11 @@ UM.TooltipArea } validator: RegExpValidator { regExp: allowNegativeValue ? /-?[0-9\.,]{0,6}/ : /[0-9\.,]{0,6}/ } - onEditingFinished: + onEditingFinished: editingFinishedFunction() + + property var editingFinishedFunction: defaultEditingFinishedFunction + + function defaultEditingFinishedFunction() { if (propertyProvider && text != propertyProvider.properties.value) { diff --git a/resources/qml/MachineSettings/PrintHeadMinMaxTextField.qml b/resources/qml/MachineSettings/PrintHeadMinMaxTextField.qml new file mode 100644 index 0000000000..236f9a7dd0 --- /dev/null +++ b/resources/qml/MachineSettings/PrintHeadMinMaxTextField.qml @@ -0,0 +1,81 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 + +import UM 1.3 as UM +import Cura 1.1 as Cura + + +// +// This is the widget for editing min and max X and Y for the print head. +// The print head is internally stored as a JSON array or array, representing a polygon of the print head. +// The polygon array is stored in the format illustrated below: +// [ [ -x_min, y_max ], +// [ -x_min, -y_min ], +// [ x_max, y_max ], +// [ x_max, -y_min ], +// ] +// +// In order to modify each field, the widget is configurable via "axisName" and "axisMinOrMax", where +// - axisName is "x" or "y" +// - axisMinOrMax is "min" or "max" +// +NumericTextFieldWithUnit +{ + id: machineXMaxField + UM.I18nCatalog { id: catalog; name: "cura" } + + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_head_with_fans_polygon" + settingStoreIndex: 1 + + property string axisName: "x" + property string axisMinOrMax: "min" + property var axisValue: + { + var polygon = JSON.parse(propertyProvider.properties.value) + var item = (axisName == "x") ? 0 : 1 + var result = polygon[0][item] + var func = (axisMinOrMax == "min") ? Math.min : Math.max + for (var i = 1; i < polygon.length; i++) + { + result = func(result, polygon[i][item]) + } + result = Math.abs(result) + return result + } + + valueValidator: RegExpValidator { regExp: /[0-9\.,]{0,6}/ } + valueText: axisValue + + editingFinishedFunction: function() + { + var polygon = JSON.parse(propertyProvider.properties.value) + + var newValue = parseFloat(valueText.replace(',', '.')) + if (axisName == "x") // x min/x max + { + var start_i1 = (axisMinOrMax == "min") ? 0 : 2 + var factor = (axisMinOrMax == "min") ? -1 : 1 + polygon[start_i1][0] = newValue * factor + polygon[start_i1 + 1][0] = newValue * factor + } + else // y min/y max + { + var start_i1 = (axisMinOrMax == "min") ? 1 : 0 + var factor = (axisMinOrMax == "min") ? -1 : 1 + polygon[start_i1][1] = newValue * factor + polygon[start_i1 + 2][1] = newValue * factor + } + var polygon_string = JSON.stringify(polygon) + if (polygon_string != propertyProvider.properties.value) + { + propertyProvider.setPropertyValue("value", polygon_string) + forceUpdateOnChangeFunction() + } + } + + // TODO: add forceUpdateOnChangeFunction: +} From 6c6ccb16b8f139a90347a9807c36d3353ed778c0 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 18 Mar 2019 12:02:25 +0100 Subject: [PATCH 07/33] WIP: Add X/Y min/max fields --- resources/qml/WelcomePages/TestContent.qml | 84 +++++++++++++++++++++- 1 file changed, 81 insertions(+), 3 deletions(-) diff --git a/resources/qml/WelcomePages/TestContent.qml b/resources/qml/WelcomePages/TestContent.qml index 193a1090e3..6db019785e 100644 --- a/resources/qml/WelcomePages/TestContent.qml +++ b/resources/qml/WelcomePages/TestContent.qml @@ -19,15 +19,24 @@ Row id: base UM.I18nCatalog { id: catalog; name: "cura" } - property int labelWidth: 100 + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + anchors.margins: UM.Theme.getSize("default_margin").width + + property int labelWidth: 110 property var labelFont: UM.Theme.getFont("medium") + spacing: 10 + + // ======================================= // Left-side column for "Printer Settings" + // ======================================= Column { spacing: 10 - Label + Label // Title Label { text: catalog.i18nc("@title:label", "Printer Settings") font: UM.Theme.getFont("medium_bold") @@ -119,18 +128,87 @@ Row } } + // ======================================= // Right-side column for "Printhead Settings" + // ======================================= Column { spacing: 10 - Label + Label // Title Label { text: catalog.i18nc("@title:label", "Printhead Settings") font: UM.Theme.getFont("medium_bold") } + PrintHeadMinMaxTextField // "X min" + { + id: machineXMinField + settingStoreIndex: 1 // TODO + labelText: catalog.i18nc("@label", "X min") + labelFont: base.labelFont + labelWidth: base.labelWidth + unitText: catalog.i18nc("@label", "mm") + + axisName: "x" + axisMinOrMax: "min" + + // TODO: add forceUpdateOnChangeFunction: + } + + PrintHeadMinMaxTextField // "Y min" + { + id: machineYMinField + + settingStoreIndex: 1 // TODO + + labelText: catalog.i18nc("@label", "Y min") + labelFont: base.labelFont + labelWidth: base.labelWidth + unitText: catalog.i18nc("@label", "mm") + + axisName: "y" + axisMinOrMax: "min" + + // TODO: add forceUpdateOnChangeFunction: + } + + PrintHeadMinMaxTextField // "X max" + { + id: machineXMaxField + + settingStoreIndex: 1 // TODO + + labelText: catalog.i18nc("@label", "X max") + labelFont: base.labelFont + labelWidth: base.labelWidth + unitText: catalog.i18nc("@label", "mm") + + axisName: "x" + axisMinOrMax: "max" + + // TODO: add forceUpdateOnChangeFunction: + } + + PrintHeadMinMaxTextField // "Y max" + { + id: machineYMaxField + + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_head_with_fans_polygon" + settingStoreIndex: 1 // TODO + + labelText: catalog.i18nc("@label", "Y max") + labelFont: base.labelFont + labelWidth: base.labelWidth + unitText: catalog.i18nc("@label", "mm") + + axisName: "y" + axisMinOrMax: "max" + + // TODO: add forceUpdateOnChangeFunction: + } } } From 449740a6311d705320f0e38046eacda27d16103f Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 18 Mar 2019 13:34:02 +0100 Subject: [PATCH 08/33] WIP: MachineSettings Printer tab --- cura/Settings/GlobalStack.py | 4 + .../MachineSettings/ComboBoxWithOptions.qml | 113 +++-- .../qml/MachineSettings/GcodeTextArea.qml | 47 +- .../NumericTextFieldWithUnit.qml | 267 ++++++----- .../qml/MachineSettings/SimpleCheckBox.qml | 19 +- resources/qml/WelcomePages/TestContent.qml | 438 +++++++++++------- 6 files changed, 524 insertions(+), 364 deletions(-) diff --git a/cura/Settings/GlobalStack.py b/cura/Settings/GlobalStack.py index 3940af7ecc..17a732c4b9 100755 --- a/cura/Settings/GlobalStack.py +++ b/cura/Settings/GlobalStack.py @@ -64,6 +64,10 @@ class GlobalStack(CuraContainerStack): machine_extruder_count = self.getProperty("machine_extruder_count", "value") return result_list[:machine_extruder_count] + @pyqtProperty(int, constant = True) + def maxExtruderCount(self): + return len(self.getMetaDataEntry("machine_extruder_trains")) + @classmethod def getLoadingPriority(cls) -> int: return 2 diff --git a/resources/qml/MachineSettings/ComboBoxWithOptions.qml b/resources/qml/MachineSettings/ComboBoxWithOptions.qml index 6d566f6c62..1d7f9307b6 100644 --- a/resources/qml/MachineSettings/ComboBoxWithOptions.qml +++ b/resources/qml/MachineSettings/ComboBoxWithOptions.qml @@ -34,6 +34,7 @@ UM.TooltipArea property alias labelText: fieldLabel.text property alias labelFont: fieldLabel.font property alias labelWidth: fieldLabel.width + property alias optionModel: comboBox.model property string tooltipText: propertyProvider.properties.description @@ -50,70 +51,68 @@ UM.TooltipArea watchedProperties: [ "value", "options", "description" ] } - Row + Label { - spacing: UM.Theme.getSize("default_margin").width + id: fieldLabel + anchors.left: parent.left + anchors.verticalCenter: comboBox.verticalCenter + visible: text != "" + font: UM.Theme.getFont("medium") + renderType: Text.NativeRendering + } - Label + ListModel + { + id: defaultOptionsModel + Component.onCompleted: { - id: fieldLabel - anchors.verticalCenter: comboBox.verticalCenter - visible: text != "" - font: UM.Theme.getFont("medium") - renderType: Text.NativeRendering - } - - ListModel - { - id: optionsModel - Component.onCompleted: + // Options come in as a string-representation of an OrderedDict + var options = propertyProvider.properties.options.match(/^OrderedDict\(\[\((.*)\)\]\)$/) + if (options) { - // Options come in as a string-representation of an OrderedDict - var options = propertyProvider.properties.options.match(/^OrderedDict\(\[\((.*)\)\]\)$/) - if (options) + options = options[1].split("), (") + for (var i = 0; i < options.length; i++) { - options = options[1].split("), (") - for (var i = 0; i < options.length; i++) - { - var option = options[i].substring(1, options[i].length - 1).split("', '") - optionsModel.append({text: option[1], value: option[0]}) - } - } - } - } - - CuraComboBox - { - id: comboBox - width: comboBoxWithOptions.controlWidth - height: comboBoxWithOptions.controlHeight - model: optionsModel - textRole: "text" - - currentIndex: - { - var currentValue = propertyProvider.properties.value - var index = 0 - for (var i = 0; i < model.count; i++) - { - if (model.get(i).value == currentValue) - { - index = i - break - } - } - return index - } - - onActivated: - { - if(propertyProvider.properties.value != model.get(index).value) - { - propertyProvider.setPropertyValue("value", model.get(index).value) - forceUpdateOnChangeFunction() - afterOnActivateFunction() + var option = options[i].substring(1, options[i].length - 1).split("', '") + defaultOptionsModel.append({text: option[1], value: option[0]}) } } } } + + CuraComboBox + { + id: comboBox + anchors.left: fieldLabel.right + anchors.leftMargin: UM.Theme.getSize("default_margin").width + width: comboBoxWithOptions.controlWidth + height: comboBoxWithOptions.controlHeight + model: defaultOptionsModel + textRole: "text" + + currentIndex: + { + var currentValue = propertyProvider.properties.value + var index = 0 + for (var i = 0; i < model.count; i++) + { + if (model.get(i).value == currentValue) + { + index = i + break + } + } + return index + } + + onActivated: + { + if(propertyProvider.properties.value != model.get(index).value) + { + propertyProvider.setPropertyValue("value", model.get(index).value) + forceUpdateOnChangeFunction() + afterOnActivateFunction() + } + } + } } diff --git a/resources/qml/MachineSettings/GcodeTextArea.qml b/resources/qml/MachineSettings/GcodeTextArea.qml index 748111a8e2..ef9540791e 100644 --- a/resources/qml/MachineSettings/GcodeTextArea.qml +++ b/resources/qml/MachineSettings/GcodeTextArea.qml @@ -14,12 +14,10 @@ import Cura 1.1 as Cura // UM.TooltipArea { - id: gcodeTextArea + id: control UM.I18nCatalog { id: catalog; name: "cura"; } - height: childrenRect.height - width: childrenRect.width text: tooltip property alias containerStackId: propertyProvider.containerStackId @@ -28,22 +26,57 @@ UM.TooltipArea property string tooltip: propertyProvider.properties.description + property alias labelText: titleLabel.text + property alias labelFont: titleLabel.font + UM.SettingPropertyProvider { id: propertyProvider watchedProperties: [ "value", "description" ] } - // TODO: put label here + Label // Title Label + { + id: titleLabel + anchors.top: parent.top + anchors.left: parent.left + font: UM.Theme.getFont("medium_bold") + renderType: Text.NativeRendering + } TextArea { - id: gcodeArea - width: areaWidth - height: areaHeight + id: gcodeTextArea + anchors.top: titleLabel.bottom + anchors.topMargin: UM.Theme.getSize("default_margin").height + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.right: parent.right + + hoverEnabled: true + selectByMouse: true + font: UM.Theme.getFont("fixed") + renderType: Text.NativeRendering text: (propertyProvider.properties.value) ? propertyProvider.properties.value : "" wrapMode: TextEdit.NoWrap + + background: Rectangle + { + border.color: + { + if (!gcodeTextArea.enabled) + { + return UM.Theme.getColor("setting_control_disabled_border") + } + if (gcodeTextArea.hovered || gcodeTextArea.activeFocus) + { + return UM.Theme.getColor("setting_control_border_highlight") + } + return UM.Theme.getColor("setting_control_border") + } + } + onActiveFocusChanged: { if (!activeFocus) diff --git a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml index f3f4de6981..a39fbba0c5 100644 --- a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml +++ b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml @@ -59,147 +59,144 @@ UM.TooltipArea watchedProperties: [ "value", "description" ] } - Row + Label { - id: itemRow - spacing: UM.Theme.getSize("default_margin").width + id: fieldLabel + anchors.left: parent.left + anchors.verticalCenter: textFieldWithUnit.verticalCenter + visible: text != "" + font: UM.Theme.getFont("medium") + renderType: Text.NativeRendering + } + + TextField + { + id: textFieldWithUnit + anchors.left: fieldLabel.right + anchors.leftMargin: UM.Theme.getSize("default_margin").width + + width: numericTextFieldWithUnit.controlWidth + height: numericTextFieldWithUnit.controlHeight + + // Background is a rounded-cornered box with filled color as state indication (normal, warning, error, etc.) + background: Rectangle + { + anchors.fill: parent + anchors.margins: Math.round(UM.Theme.getSize("default_lining").width) + radius: UM.Theme.getSize("setting_control_radius").width + + border.color: + { + if (!textFieldWithUnit.enabled) + { + return UM.Theme.getColor("setting_control_disabled_border") + } + switch (propertyProvider.properties.validationState) + { + case "ValidatorState.Exception": + case "ValidatorState.MinimumError": + case "ValidatorState.MaximumError": + return UM.Theme.getColor("setting_validation_error") + case "ValidatorState.MinimumWarning": + case "ValidatorState.MaximumWarning": + return UM.Theme.getColor("setting_validation_warning") + } + // Validation is OK. + if (textFieldWithUnit.hovered || textFieldWithUnit.activeFocus) + { + return UM.Theme.getColor("setting_control_border_highlight") + } + return UM.Theme.getColor("setting_control_border") + } + + color: + { + if (!textFieldWithUnit.enabled) + { + return UM.Theme.getColor("setting_control_disabled") + } + switch (propertyProvider.properties.validationState) + { + case "ValidatorState.Exception": + case "ValidatorState.MinimumError": + case "ValidatorState.MaximumError": + return UM.Theme.getColor("setting_validation_error_background") + case "ValidatorState.MinimumWarning": + case "ValidatorState.MaximumWarning": + return UM.Theme.getColor("setting_validation_warning_background") + case "ValidatorState.Valid": + return UM.Theme.getColor("setting_validation_ok") + default: + return UM.Theme.getColor("setting_control") + } + } + } + + hoverEnabled: true + selectByMouse: true + font: UM.Theme.getFont("default") + renderType: Text.NativeRendering + + // When the textbox gets focused by TAB, select all text + onActiveFocusChanged: + { + if (activeFocus && (focusReason == Qt.TabFocusReason || focusReason == Qt.BacktabFocusReason)) + { + selectAll() + } + } + + text: + { + const value = propertyProvider.properties.value + return value ? value : "" + } + validator: RegExpValidator { regExp: allowNegativeValue ? /-?[0-9\.,]{0,6}/ : /[0-9\.,]{0,6}/ } + + onEditingFinished: editingFinishedFunction() + + property var editingFinishedFunction: defaultEditingFinishedFunction + + function defaultEditingFinishedFunction() + { + if (propertyProvider && text != propertyProvider.properties.value) + { + // For some properties like the extruder-compatible material diameter, they need to + // trigger many updates, such as the available materials, the current material may + // need to be switched, etc. Although setting the diameter can be done directly via + // the provider, all the updates that need to be triggered then need to depend on + // the metadata update, a signal that can be fired way too often. The update functions + // can have if-checks to filter out the irrelevant updates, but still it incurs unnecessary + // overhead. + // The ExtruderStack class has a dedicated function for this call "setCompatibleMaterialDiameter()", + // and it triggers the diameter update signals only when it is needed. Here it is optionally + // choose to use setCompatibleMaterialDiameter() or other more specific functions that + // are available. + if (setValueFunction !== null) + { + setValueFunction(text) + } + else + { + propertyProvider.setPropertyValue("value", text) + } + forceUpdateOnChangeFunction() + afterOnEditingFinished() + } + } Label { - id: fieldLabel - anchors.verticalCenter: textFieldWithUnit.verticalCenter - visible: text != "" - font: UM.Theme.getFont("medium") + id: unitLabel + anchors.right: parent.right + anchors.rightMargin: Math.round(UM.Theme.getSize("setting_unit_margin").width) + anchors.verticalCenter: parent.verticalCenter + text: unitText + textFormat: Text.PlainText + verticalAlignment: Text.AlignVCenter renderType: Text.NativeRendering - } - - TextField - { - id: textFieldWithUnit - - width: numericTextFieldWithUnit.controlWidth - height: numericTextFieldWithUnit.controlHeight - - // Background is a rounded-cornered box with filled color as state indication (normal, warning, error, etc.) - background: Rectangle - { - anchors.fill: parent - anchors.margins: Math.round(UM.Theme.getSize("default_lining").width) - radius: UM.Theme.getSize("setting_control_radius").width - - border.color: - { - if (!textFieldWithUnit.enabled) - { - return UM.Theme.getColor("setting_control_disabled_border") - } - switch (propertyProvider.properties.validationState) - { - case "ValidatorState.Exception": - case "ValidatorState.MinimumError": - case "ValidatorState.MaximumError": - return UM.Theme.getColor("setting_validation_error") - case "ValidatorState.MinimumWarning": - case "ValidatorState.MaximumWarning": - return UM.Theme.getColor("setting_validation_warning") - } - // Validation is OK. - if (textFieldWithUnit.hovered || textFieldWithUnit.activeFocus) - { - return UM.Theme.getColor("setting_control_border_highlight") - } - return UM.Theme.getColor("setting_control_border") - } - - color: - { - if (!textFieldWithUnit.enabled) - { - return UM.Theme.getColor("setting_control_disabled") - } - switch (propertyProvider.properties.validationState) - { - case "ValidatorState.Exception": - case "ValidatorState.MinimumError": - case "ValidatorState.MaximumError": - return UM.Theme.getColor("setting_validation_error_background") - case "ValidatorState.MinimumWarning": - case "ValidatorState.MaximumWarning": - return UM.Theme.getColor("setting_validation_warning_background") - case "ValidatorState.Valid": - return UM.Theme.getColor("setting_validation_ok") - default: - return UM.Theme.getColor("setting_control") - } - } - } - - hoverEnabled: true - selectByMouse: true + color: UM.Theme.getColor("setting_unit") font: UM.Theme.getFont("default") - renderType: Text.NativeRendering - - // When the textbox gets focused by TAB, select all text - onActiveFocusChanged: - { - if (activeFocus && (focusReason == Qt.TabFocusReason || focusReason == Qt.BacktabFocusReason)) - { - selectAll() - } - } - - text: - { - const value = propertyProvider.properties.value - return value ? value : "" - } - validator: RegExpValidator { regExp: allowNegativeValue ? /-?[0-9\.,]{0,6}/ : /[0-9\.,]{0,6}/ } - - onEditingFinished: editingFinishedFunction() - - property var editingFinishedFunction: defaultEditingFinishedFunction - - function defaultEditingFinishedFunction() - { - if (propertyProvider && text != propertyProvider.properties.value) - { - // For some properties like the extruder-compatible material diameter, they need to - // trigger many updates, such as the available materials, the current material may - // need to be switched, etc. Although setting the diameter can be done directly via - // the provider, all the updates that need to be triggered then need to depend on - // the metadata update, a signal that can be fired way too often. The update functions - // can have if-checks to filter out the irrelevant updates, but still it incurs unnecessary - // overhead. - // The ExtruderStack class has a dedicated function for this call "setCompatibleMaterialDiameter()", - // and it triggers the diameter update signals only when it is needed. Here it is optionally - // choose to use setCompatibleMaterialDiameter() or other more specific functions that - // are available. - if (setValueFunction !== null) - { - setValueFunction(text) - } - else - { - propertyProvider.setPropertyValue("value", text) - } - forceUpdateOnChangeFunction() - afterOnEditingFinished() - } - } - - Label - { - id: unitLabel - anchors.right: parent.right - anchors.rightMargin: Math.round(UM.Theme.getSize("setting_unit_margin").width) - anchors.verticalCenter: parent.verticalCenter - text: unitText - textFormat: Text.PlainText - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering - color: UM.Theme.getColor("setting_unit") - font: UM.Theme.getFont("default") - } } } } diff --git a/resources/qml/MachineSettings/SimpleCheckBox.qml b/resources/qml/MachineSettings/SimpleCheckBox.qml index 2147be9859..8aa65eff95 100644 --- a/resources/qml/MachineSettings/SimpleCheckBox.qml +++ b/resources/qml/MachineSettings/SimpleCheckBox.qml @@ -30,8 +30,9 @@ UM.TooltipArea property alias settingKey: propertyProvider.key property alias settingStoreIndex: propertyProvider.storeIndex - property alias labelText: checkBox.text - property alias labelFont: checkBox.font + property alias labelText: fieldLabel.text + property alias labelFont: fieldLabel.font + property alias labelWidth: fieldLabel.width property string tooltip: propertyProvider.properties.description @@ -47,12 +48,24 @@ UM.TooltipArea watchedProperties: [ "value", "description" ] } + Label + { + id: fieldLabel + anchors.left: parent.left + anchors.verticalCenter: checkBox.verticalCenter + visible: text != "" + font: UM.Theme.getFont("medium") + renderType: Text.NativeRendering + } + CuraCheckBox { id: checkBox + anchors.left: fieldLabel.right + anchors.leftMargin: UM.Theme.getSize("default_margin").width checked: String(propertyProvider.properties.value).toLowerCase() != 'false' height: simpleCheckBox.controlHeight - font: UM.Theme.getFont("medium") + text: "" onClicked: { propertyProvider.setPropertyValue("value", checked) diff --git a/resources/qml/WelcomePages/TestContent.qml b/resources/qml/WelcomePages/TestContent.qml index 6db019785e..e0a2212998 100644 --- a/resources/qml/WelcomePages/TestContent.qml +++ b/resources/qml/WelcomePages/TestContent.qml @@ -14,7 +14,7 @@ import "../MachineSettings" // This component contains the content for the "Welcome" page of the welcome on-boarding process. // -Row +Item { id: base UM.I18nCatalog { id: catalog; name: "cura" } @@ -22,193 +22,307 @@ Row anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top - anchors.margins: UM.Theme.getSize("default_margin").width - property int labelWidth: 110 + property int labelWidth: 130 + property int controlWidth: UM.Theme.getSize("setting_control").width * 3 / 4 property var labelFont: UM.Theme.getFont("medium") - spacing: 10 + property int columnWidth: (parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2 + property int columnSpacing: 10 + property int propertyStoreIndex: 5 // definition_changes - // ======================================= - // Left-side column for "Printer Settings" - // ======================================= - Column + Item { - spacing: 10 + id: upperBlock + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: UM.Theme.getSize("default_margin").width - Label // Title Label + height: childrenRect.height + + // ======================================= + // Left-side column for "Printer Settings" + // ======================================= + Column { - text: catalog.i18nc("@title:label", "Printer Settings") - font: UM.Theme.getFont("medium_bold") + anchors.top: parent.top + anchors.left: parent.left + width: base.columnWidth + + spacing: base.columnSpacing + + Label // Title Label + { + text: catalog.i18nc("@title:label", "Printer Settings") + font: UM.Theme.getFont("medium_bold") + renderType: Text.NativeRendering + } + + NumericTextFieldWithUnit // "X (Width)" + { + id: machineXWidthField + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_width" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "X (Width)") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + // TODO: add forceUpdateOnChangeFunction: + } + + NumericTextFieldWithUnit // "Y (Depth)" + { + id: machineYDepthField + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_depth" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Y (Depth)") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + // TODO: add forceUpdateOnChangeFunction: + } + + NumericTextFieldWithUnit // "Z (Height)" + { + id: machineZHeightField + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_height" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Z (Height)") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + // TODO: add forceUpdateOnChangeFunction: + } + + ComboBoxWithOptions // "Build plate shape" + { + id: buildPlateShapeComboBox + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_shape" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Build plate shape") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + // TODO: add forceUpdateOnChangeFunction: + } + + SimpleCheckBox // "Origin at center" + { + id: originAtCenterCheckBox + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_center_is_zero" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Origin at center") + labelFont: base.labelFont + labelWidth: base.labelWidth + // TODO: add forceUpdateOnChangeFunction: + } + + SimpleCheckBox // "Heated bed" + { + id: heatedBedCheckBox + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_heated_bed" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Heated bed") + labelFont: base.labelFont + labelWidth: base.labelWidth + // TODO: add forceUpdateOnChangeFunction: + } + + ComboBoxWithOptions // "G-code flavor" + { + id: gcodeFlavorComboBox + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_gcode_flavor" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "G-code flavor") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + // TODO: add forceUpdateOnChangeFunction: + // TODO: add afterOnActivate: manager.updateHasMaterialsMetadata + } } - NumericTextFieldWithUnit // "X (Width)" + // ======================================= + // Right-side column for "Printhead Settings" + // ======================================= + Column { - id: machineXWidthField - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_width" - settingStoreIndex: 1 // TODO - labelText: catalog.i18nc("@label", "X (Width)") - labelFont: base.labelFont - labelWidth: base.labelWidth - unitText: catalog.i18nc("@label", "mm") - // TODO: add forceUpdateOnChangeFunction: - } + anchors.top: parent.top + anchors.right: parent.right + width: base.columnWidth - NumericTextFieldWithUnit // "Y (Depth)" - { - id: machineYDepthField - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_depth" - settingStoreIndex: 1 // TODO - labelText: catalog.i18nc("@label", "Y (Depth)") - labelFont: base.labelFont - labelWidth: base.labelWidth - unitText: catalog.i18nc("@label", "mm") - // TODO: add forceUpdateOnChangeFunction: - } + spacing: base.columnSpacing - NumericTextFieldWithUnit // "Z (Height)" - { - id: machineZHeightField - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_height" - settingStoreIndex: 1 // TODO - labelText: catalog.i18nc("@label", "Z (Height)") - labelFont: base.labelFont - labelWidth: base.labelWidth - unitText: catalog.i18nc("@label", "mm") - // TODO: add forceUpdateOnChangeFunction: - } + Label // Title Label + { + text: catalog.i18nc("@title:label", "Printhead Settings") + font: UM.Theme.getFont("medium_bold") + renderType: Text.NativeRendering + } - ComboBoxWithOptions // "Build plate shape" - { - id: buildPlateShapeComboBox - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_shape" - settingStoreIndex: 1 // TODO - labelText: catalog.i18nc("@label", "Build plate shape") - labelWidth: base.labelWidth - // TODO: add forceUpdateOnChangeFunction: - } + PrintHeadMinMaxTextField // "X min" + { + id: machineXMinField - SimpleCheckBox // "Origin at center" - { - id: originAtCenterCheckBox - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_center_is_zero" - settingStoreIndex: 1 // TODO - labelText: catalog.i18nc("@label", "Origin at center") - labelFont: base.labelFont - // TODO: add forceUpdateOnChangeFunction: - } + settingStoreIndex: propertyStoreIndex - SimpleCheckBox // "Heated bed" - { - id: heatedBedCheckBox - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_heated_bed" - settingStoreIndex: 1 // TODO - labelText: catalog.i18nc("@label", "Heated bed") - labelFont: base.labelFont - // TODO: add forceUpdateOnChangeFunction: - } + labelText: catalog.i18nc("@label", "X min") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") - ComboBoxWithOptions // "G-code flavor" - { - id: gcodeFlavorComboBox - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_gcode_flavor" - settingStoreIndex: 1 // TODO - labelText: catalog.i18nc("@label", "G-code flavor") - labelFont: base.labelFont - labelWidth: base.labelWidth - // TODO: add forceUpdateOnChangeFunction: - // TODO: add afterOnActivate: manager.updateHasMaterialsMetadata + axisName: "x" + axisMinOrMax: "min" + + // TODO: add forceUpdateOnChangeFunction: + } + + PrintHeadMinMaxTextField // "Y min" + { + id: machineYMinField + + settingStoreIndex: propertyStoreIndex + + labelText: catalog.i18nc("@label", "Y min") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + + axisName: "y" + axisMinOrMax: "min" + + // TODO: add forceUpdateOnChangeFunction: + } + + PrintHeadMinMaxTextField // "X max" + { + id: machineXMaxField + + settingStoreIndex: propertyStoreIndex + + labelText: catalog.i18nc("@label", "X max") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + + axisName: "x" + axisMinOrMax: "max" + + // TODO: add forceUpdateOnChangeFunction: + } + + PrintHeadMinMaxTextField // "Y max" + { + id: machineYMaxField + + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_head_with_fans_polygon" + settingStoreIndex: propertyStoreIndex + + labelText: catalog.i18nc("@label", "Y max") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + + axisName: "y" + axisMinOrMax: "max" + + // TODO: add forceUpdateOnChangeFunction: + } + + NumericTextFieldWithUnit // "Gantry Height" + { + id: machineGantryHeightField + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "gantry_height" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Gantry Height") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + // TODO: add forceUpdateOnChangeFunction: + } + + ComboBoxWithOptions // "Number of Extruders" + { + id: numberOfExtrudersComboBox + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_extruder_count" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Number of Extruders") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + // TODO: add forceUpdateOnChangeFunction: + // TODO: add afterOnActivate: manager.updateHasMaterialsMetadata + + optionModel: ListModel + { + id: extruderCountModel + Component.onCompleted: + { + extruderCountModel.clear() + for (var i = 1; i <= Cura.MachineManager.activeMachine.maxExtruderCount; i++) + { + extruderCountModel.append({text: String(i), value: i}) + } + } + } + } } } - // ======================================= - // Right-side column for "Printhead Settings" - // ======================================= - Column + Item // Start and End G-code { - spacing: 10 + id: lowerBlock + anchors.top: upperBlock.bottom + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: UM.Theme.getSize("default_margin").width - Label // Title Label + GcodeTextArea // "Start G-code" { - text: catalog.i18nc("@title:label", "Printhead Settings") - font: UM.Theme.getFont("medium_bold") - } - - PrintHeadMinMaxTextField // "X min" - { - id: machineXMinField - - settingStoreIndex: 1 // TODO - - labelText: catalog.i18nc("@label", "X min") - labelFont: base.labelFont - labelWidth: base.labelWidth - unitText: catalog.i18nc("@label", "mm") - - axisName: "x" - axisMinOrMax: "min" - - // TODO: add forceUpdateOnChangeFunction: - } - - PrintHeadMinMaxTextField // "Y min" - { - id: machineYMinField - - settingStoreIndex: 1 // TODO - - labelText: catalog.i18nc("@label", "Y min") - labelFont: base.labelFont - labelWidth: base.labelWidth - unitText: catalog.i18nc("@label", "mm") - - axisName: "y" - axisMinOrMax: "min" - - // TODO: add forceUpdateOnChangeFunction: - } - - PrintHeadMinMaxTextField // "X max" - { - id: machineXMaxField - - settingStoreIndex: 1 // TODO - - labelText: catalog.i18nc("@label", "X max") - labelFont: base.labelFont - labelWidth: base.labelWidth - unitText: catalog.i18nc("@label", "mm") - - axisName: "x" - axisMinOrMax: "max" - - // TODO: add forceUpdateOnChangeFunction: - } - - PrintHeadMinMaxTextField // "Y max" - { - id: machineYMaxField + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.bottomMargin: UM.Theme.getSize("default_margin").height + anchors.left: parent.left + width: base.columnWidth - UM.Theme.getSize("default_margin").width + labelText: catalog.i18nc("@title:label", "Start G-code") containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_head_with_fans_polygon" - settingStoreIndex: 1 // TODO + settingKey: "machine_start_gcode" + settingStoreIndex: propertyStoreIndex + } - labelText: catalog.i18nc("@label", "Y max") - labelFont: base.labelFont - labelWidth: base.labelWidth - unitText: catalog.i18nc("@label", "mm") + GcodeTextArea // "End G-code" + { + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.bottomMargin: UM.Theme.getSize("default_margin").height + anchors.right: parent.right + width: base.columnWidth - UM.Theme.getSize("default_margin").width - axisName: "y" - axisMinOrMax: "max" - - // TODO: add forceUpdateOnChangeFunction: + labelText: catalog.i18nc("@title:label", "End G-code") + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_end_gcode" + settingStoreIndex: propertyStoreIndex } } } From f75f8f980989fc82d4e5923c439ea3d6f8b4df1b Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 18 Mar 2019 15:05:19 +0100 Subject: [PATCH 09/33] WIP: Move MachineSettings Printer Tab to a separate file --- .../MachineSettingsPrinterTab.qml | 327 ++++++++++++++++++ 1 file changed, 327 insertions(+) create mode 100644 resources/qml/WelcomePages/MachineSettingsPrinterTab.qml diff --git a/resources/qml/WelcomePages/MachineSettingsPrinterTab.qml b/resources/qml/WelcomePages/MachineSettingsPrinterTab.qml new file mode 100644 index 0000000000..d6f6d1f9ae --- /dev/null +++ b/resources/qml/WelcomePages/MachineSettingsPrinterTab.qml @@ -0,0 +1,327 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 + +import UM 1.3 as UM +import Cura 1.1 as Cura + +import "../MachineSettings" + + +// +// This the content in the "Printer" tab in the Machine Settings dialog. +// +Item +{ + id: base + UM.I18nCatalog { id: catalog; name: "cura" } + + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + + property int labelWidth: 130 + property int controlWidth: UM.Theme.getSize("setting_control").width * 3 / 4 + property var labelFont: UM.Theme.getFont("medium") + + property int columnWidth: (parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2 + property int columnSpacing: 10 + property int propertyStoreIndex: 5 // definition_changes + + Item + { + id: upperBlock + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: UM.Theme.getSize("default_margin").width + + height: childrenRect.height + + // ======================================= + // Left-side column for "Printer Settings" + // ======================================= + Column + { + anchors.top: parent.top + anchors.left: parent.left + width: base.columnWidth + + spacing: base.columnSpacing + + Label // Title Label + { + text: catalog.i18nc("@title:label", "Printer Settings") + font: UM.Theme.getFont("medium_bold") + renderType: Text.NativeRendering + } + + NumericTextFieldWithUnit // "X (Width)" + { + id: machineXWidthField + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_width" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "X (Width)") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + // TODO: add forceUpdateOnChangeFunction: + } + + NumericTextFieldWithUnit // "Y (Depth)" + { + id: machineYDepthField + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_depth" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Y (Depth)") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + // TODO: add forceUpdateOnChangeFunction: + } + + NumericTextFieldWithUnit // "Z (Height)" + { + id: machineZHeightField + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_height" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Z (Height)") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + // TODO: add forceUpdateOnChangeFunction: + } + + ComboBoxWithOptions // "Build plate shape" + { + id: buildPlateShapeComboBox + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_shape" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Build plate shape") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + // TODO: add forceUpdateOnChangeFunction: + } + + SimpleCheckBox // "Origin at center" + { + id: originAtCenterCheckBox + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_center_is_zero" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Origin at center") + labelFont: base.labelFont + labelWidth: base.labelWidth + // TODO: add forceUpdateOnChangeFunction: + } + + SimpleCheckBox // "Heated bed" + { + id: heatedBedCheckBox + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_heated_bed" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Heated bed") + labelFont: base.labelFont + labelWidth: base.labelWidth + // TODO: add forceUpdateOnChangeFunction: + } + + ComboBoxWithOptions // "G-code flavor" + { + id: gcodeFlavorComboBox + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_gcode_flavor" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "G-code flavor") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + // TODO: add forceUpdateOnChangeFunction: + // TODO: add afterOnActivate: manager.updateHasMaterialsMetadata + } + } + + // ======================================= + // Right-side column for "Printhead Settings" + // ======================================= + Column + { + anchors.top: parent.top + anchors.right: parent.right + width: base.columnWidth + + spacing: base.columnSpacing + + Label // Title Label + { + text: catalog.i18nc("@title:label", "Printhead Settings") + font: UM.Theme.getFont("medium_bold") + renderType: Text.NativeRendering + } + + PrintHeadMinMaxTextField // "X min" + { + id: machineXMinField + + settingStoreIndex: propertyStoreIndex + + labelText: catalog.i18nc("@label", "X min") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + + axisName: "x" + axisMinOrMax: "min" + + // TODO: add forceUpdateOnChangeFunction: + } + + PrintHeadMinMaxTextField // "Y min" + { + id: machineYMinField + + settingStoreIndex: propertyStoreIndex + + labelText: catalog.i18nc("@label", "Y min") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + + axisName: "y" + axisMinOrMax: "min" + + // TODO: add forceUpdateOnChangeFunction: + } + + PrintHeadMinMaxTextField // "X max" + { + id: machineXMaxField + + settingStoreIndex: propertyStoreIndex + + labelText: catalog.i18nc("@label", "X max") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + + axisName: "x" + axisMinOrMax: "max" + + // TODO: add forceUpdateOnChangeFunction: + } + + PrintHeadMinMaxTextField // "Y max" + { + id: machineYMaxField + + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_head_with_fans_polygon" + settingStoreIndex: propertyStoreIndex + + labelText: catalog.i18nc("@label", "Y max") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + + axisName: "y" + axisMinOrMax: "max" + + // TODO: add forceUpdateOnChangeFunction: + } + + NumericTextFieldWithUnit // "Gantry Height" + { + id: machineGantryHeightField + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "gantry_height" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Gantry Height") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + // TODO: add forceUpdateOnChangeFunction: + } + + ComboBoxWithOptions // "Number of Extruders" + { + id: numberOfExtrudersComboBox + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_extruder_count" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Number of Extruders") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + // TODO: add forceUpdateOnChangeFunction: + // TODO: add afterOnActivate: manager.updateHasMaterialsMetadata + + optionModel: ListModel + { + id: extruderCountModel + Component.onCompleted: + { + extruderCountModel.clear() + for (var i = 1; i <= Cura.MachineManager.activeMachine.maxExtruderCount; i++) + { + extruderCountModel.append({text: String(i), value: i}) + } + } + } + } + } + } + + Item // Start and End G-code + { + id: lowerBlock + anchors.top: upperBlock.bottom + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: UM.Theme.getSize("default_margin").width + + GcodeTextArea // "Start G-code" + { + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.bottomMargin: UM.Theme.getSize("default_margin").height + anchors.left: parent.left + width: base.columnWidth - UM.Theme.getSize("default_margin").width + + labelText: catalog.i18nc("@title:label", "Start G-code") + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_start_gcode" + settingStoreIndex: propertyStoreIndex + } + + GcodeTextArea // "End G-code" + { + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.bottomMargin: UM.Theme.getSize("default_margin").height + anchors.right: parent.right + width: base.columnWidth - UM.Theme.getSize("default_margin").width + + labelText: catalog.i18nc("@title:label", "End G-code") + containerStackId: Cura.MachineManager.activeMachineId + settingKey: "machine_end_gcode" + settingStoreIndex: propertyStoreIndex + } + } +} From 42a304c049de907ba447977976e470b3cb4b64b7 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 18 Mar 2019 15:07:14 +0100 Subject: [PATCH 10/33] WIP: Create MachineSettings Extruder Tab --- .../MachineSettingsExtruderTab.qml | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 resources/qml/WelcomePages/MachineSettingsExtruderTab.qml diff --git a/resources/qml/WelcomePages/MachineSettingsExtruderTab.qml b/resources/qml/WelcomePages/MachineSettingsExtruderTab.qml new file mode 100644 index 0000000000..cd3f1b1d9d --- /dev/null +++ b/resources/qml/WelcomePages/MachineSettingsExtruderTab.qml @@ -0,0 +1,174 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 + +import UM 1.3 as UM +import Cura 1.1 as Cura + +import "../MachineSettings" + + +// +// This component contains the content for the "Welcome" page of the welcome on-boarding process. +// + +Item +{ + id: base + UM.I18nCatalog { id: catalog; name: "cura" } + + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + + property string extruderStackId: "" + + property int labelWidth: 180 + property int controlWidth: UM.Theme.getSize("setting_control").width * 3 / 4 + property var labelFont: UM.Theme.getFont("medium") + + property int columnWidth: (parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2 + property int columnSpacing: 10 + property int propertyStoreIndex: 5 // definition_changes + + Item + { + id: upperBlock + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: UM.Theme.getSize("default_margin").width + + height: childrenRect.height + + // ======================================= + // Left-side column "Nozzle Settings" + // ======================================= + Column + { + anchors.top: parent.top + anchors.left: parent.left + width: parent.width * 2 / 3 + + spacing: base.columnSpacing + + Label // Title Label + { + text: catalog.i18nc("@title:label", "Nozzle Settings") + font: UM.Theme.getFont("medium_bold") + renderType: Text.NativeRendering + } + + NumericTextFieldWithUnit // "Nozzle size" + { + id: extruderNozzleSizeField + visible: !Cura.MachineManager.hasVariants + containerStackId: base.extruderStackId + settingKey: "machine_nozzle_size" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Nozzle size") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + // TODO: add forceUpdateOnChangeFunction: + } + + NumericTextFieldWithUnit // "Compatible material diameter" + { + id: extruderCompatibleMaterialDiameterField + containerStackId: base.extruderStackId + settingKey: "material_diameter" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Compatible material diameter") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + // TODO: add forceUpdateOnChangeFunction: + } + + NumericTextFieldWithUnit // "Nozzle offset X" + { + id: extruderNozzleOffsetXField + containerStackId: base.extruderStackId + settingKey: "machine_nozzle_offset_x" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Nozzle offset X") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + // TODO: add forceUpdateOnChangeFunction: + } + + NumericTextFieldWithUnit // "Nozzle offset Y" + { + id: extruderNozzleOffsetYField + containerStackId: base.extruderStackId + settingKey: "machine_nozzle_offset_y" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Nozzle offset Y") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: catalog.i18nc("@label", "mm") + // TODO: add forceUpdateOnChangeFunction: + } + + NumericTextFieldWithUnit // "Cooling Fan Number" + { + id: extruderNozzleCoolingFanNumberField + containerStackId: base.extruderStackId + settingKey: "machine_extruder_cooling_fan_number" + settingStoreIndex: propertyStoreIndex + labelText: catalog.i18nc("@label", "Cooling Fan Number") + labelFont: base.labelFont + labelWidth: base.labelWidth + controlWidth: base.controlWidth + unitText: "" + // TODO: add forceUpdateOnChangeFunction: + } + } + } + + Item // Extruder Start and End G-code + { + id: lowerBlock + anchors.top: upperBlock.bottom + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: UM.Theme.getSize("default_margin").width + + GcodeTextArea // "Extruder Start G-code" + { + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.bottomMargin: UM.Theme.getSize("default_margin").height + anchors.left: parent.left + width: base.columnWidth - UM.Theme.getSize("default_margin").width + + labelText: catalog.i18nc("@title:label", "Extruder Start G-code") + containerStackId: base.extruderStackId + settingKey: "machine_extruder_start_code" + settingStoreIndex: propertyStoreIndex + } + + GcodeTextArea // "Extruder End G-code" + { + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.bottomMargin: UM.Theme.getSize("default_margin").height + anchors.right: parent.right + width: base.columnWidth - UM.Theme.getSize("default_margin").width + + labelText: catalog.i18nc("@title:label", "Extruder End G-code") + containerStackId: base.extruderStackId + settingKey: "machine_extruder_end_code" + settingStoreIndex: propertyStoreIndex + } + } +} From 8242a3801c949ad84555956eb95eee77e237b7ea Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 18 Mar 2019 15:56:13 +0100 Subject: [PATCH 11/33] WIP: Put all MachineSettings stuff together --- .../MachineSettingsExtruderTab.qml | 2 +- .../MachineSettingsPrinterTab.qml | 2 +- resources/qml/WelcomePages/TestContent.qml | 323 +++--------------- resources/qml/Widgets/CuraTabButton.qml | 29 ++ 4 files changed, 74 insertions(+), 282 deletions(-) create mode 100644 resources/qml/Widgets/CuraTabButton.qml diff --git a/resources/qml/WelcomePages/MachineSettingsExtruderTab.qml b/resources/qml/WelcomePages/MachineSettingsExtruderTab.qml index cd3f1b1d9d..440c4b2bab 100644 --- a/resources/qml/WelcomePages/MachineSettingsExtruderTab.qml +++ b/resources/qml/WelcomePages/MachineSettingsExtruderTab.qml @@ -30,7 +30,7 @@ Item property var labelFont: UM.Theme.getFont("medium") property int columnWidth: (parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2 - property int columnSpacing: 10 + property int columnSpacing: 3 property int propertyStoreIndex: 5 // definition_changes Item diff --git a/resources/qml/WelcomePages/MachineSettingsPrinterTab.qml b/resources/qml/WelcomePages/MachineSettingsPrinterTab.qml index d6f6d1f9ae..b22f4a411b 100644 --- a/resources/qml/WelcomePages/MachineSettingsPrinterTab.qml +++ b/resources/qml/WelcomePages/MachineSettingsPrinterTab.qml @@ -27,7 +27,7 @@ Item property var labelFont: UM.Theme.getFont("medium") property int columnWidth: (parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2 - property int columnSpacing: 10 + property int columnSpacing: 3 property int propertyStoreIndex: 5 // definition_changes Item diff --git a/resources/qml/WelcomePages/TestContent.qml b/resources/qml/WelcomePages/TestContent.qml index e0a2212998..f9488665c0 100644 --- a/resources/qml/WelcomePages/TestContent.qml +++ b/resources/qml/WelcomePages/TestContent.qml @@ -3,11 +3,13 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 import UM 1.3 as UM import Cura 1.1 as Cura import "../MachineSettings" +import "../Widgets" // @@ -19,310 +21,71 @@ Item id: base UM.I18nCatalog { id: catalog; name: "cura" } - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top + anchors.fill: parent + anchors.margins: UM.Theme.getSize("default_margin").width - property int labelWidth: 130 - property int controlWidth: UM.Theme.getSize("setting_control").width * 3 / 4 - property var labelFont: UM.Theme.getFont("medium") + property var extrudersModel: Cura.ExtrudersModel {} - property int columnWidth: (parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2 - property int columnSpacing: 10 - property int propertyStoreIndex: 5 // definition_changes - - Item + onVisibleChanged: { - id: upperBlock - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - anchors.margins: UM.Theme.getSize("default_margin").width - - height: childrenRect.height - - // ======================================= - // Left-side column for "Printer Settings" - // ======================================= - Column + if (visible) { - anchors.top: parent.top - anchors.left: parent.left - width: base.columnWidth + tabBar.currentIndex = 0 + } + } - spacing: base.columnSpacing + Rectangle + { + anchors.fill: parent + border.color: tabBar.visible ? UM.Theme.getColor("lining") : "transparent" + border.width: UM.Theme.getSize("default_lining").width + radius: UM.Theme.getSize("default_radius").width - Label // Title Label + UM.TabRow + { + id: tabBar + width: parent.width + + CuraTabButton { - text: catalog.i18nc("@title:label", "Printer Settings") - font: UM.Theme.getFont("medium_bold") - renderType: Text.NativeRendering + text: catalog.i18nc("@title:tab", "Printer") } - NumericTextFieldWithUnit // "X (Width)" + Repeater { - id: machineXWidthField - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_width" - settingStoreIndex: propertyStoreIndex - labelText: catalog.i18nc("@label", "X (Width)") - labelFont: base.labelFont - labelWidth: base.labelWidth - controlWidth: base.controlWidth - unitText: catalog.i18nc("@label", "mm") - // TODO: add forceUpdateOnChangeFunction: - } - - NumericTextFieldWithUnit // "Y (Depth)" - { - id: machineYDepthField - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_depth" - settingStoreIndex: propertyStoreIndex - labelText: catalog.i18nc("@label", "Y (Depth)") - labelFont: base.labelFont - labelWidth: base.labelWidth - controlWidth: base.controlWidth - unitText: catalog.i18nc("@label", "mm") - // TODO: add forceUpdateOnChangeFunction: - } - - NumericTextFieldWithUnit // "Z (Height)" - { - id: machineZHeightField - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_height" - settingStoreIndex: propertyStoreIndex - labelText: catalog.i18nc("@label", "Z (Height)") - labelFont: base.labelFont - labelWidth: base.labelWidth - controlWidth: base.controlWidth - unitText: catalog.i18nc("@label", "mm") - // TODO: add forceUpdateOnChangeFunction: - } - - ComboBoxWithOptions // "Build plate shape" - { - id: buildPlateShapeComboBox - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_shape" - settingStoreIndex: propertyStoreIndex - labelText: catalog.i18nc("@label", "Build plate shape") - labelFont: base.labelFont - labelWidth: base.labelWidth - controlWidth: base.controlWidth - // TODO: add forceUpdateOnChangeFunction: - } - - SimpleCheckBox // "Origin at center" - { - id: originAtCenterCheckBox - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_center_is_zero" - settingStoreIndex: propertyStoreIndex - labelText: catalog.i18nc("@label", "Origin at center") - labelFont: base.labelFont - labelWidth: base.labelWidth - // TODO: add forceUpdateOnChangeFunction: - } - - SimpleCheckBox // "Heated bed" - { - id: heatedBedCheckBox - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_heated_bed" - settingStoreIndex: propertyStoreIndex - labelText: catalog.i18nc("@label", "Heated bed") - labelFont: base.labelFont - labelWidth: base.labelWidth - // TODO: add forceUpdateOnChangeFunction: - } - - ComboBoxWithOptions // "G-code flavor" - { - id: gcodeFlavorComboBox - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_gcode_flavor" - settingStoreIndex: propertyStoreIndex - labelText: catalog.i18nc("@label", "G-code flavor") - labelFont: base.labelFont - labelWidth: base.labelWidth - controlWidth: base.controlWidth - // TODO: add forceUpdateOnChangeFunction: - // TODO: add afterOnActivate: manager.updateHasMaterialsMetadata + model: extrudersModel + delegate: CuraTabButton + { + text: model.name + } } } - // ======================================= - // Right-side column for "Printhead Settings" - // ======================================= - Column + StackLayout { - anchors.top: parent.top + id: tabStack + anchors.top: tabBar.bottom + anchors.left: parent.left anchors.right: parent.right - width: base.columnWidth + anchors.bottom: parent.bottom - spacing: base.columnSpacing + width: parent.width + currentIndex: tabBar.currentIndex - Label // Title Label + MachineSettingsPrinterTab { - text: catalog.i18nc("@title:label", "Printhead Settings") - font: UM.Theme.getFont("medium_bold") - renderType: Text.NativeRendering + id: printerTab } - PrintHeadMinMaxTextField // "X min" + Repeater { - id: machineXMinField - - settingStoreIndex: propertyStoreIndex - - labelText: catalog.i18nc("@label", "X min") - labelFont: base.labelFont - labelWidth: base.labelWidth - controlWidth: base.controlWidth - unitText: catalog.i18nc("@label", "mm") - - axisName: "x" - axisMinOrMax: "min" - - // TODO: add forceUpdateOnChangeFunction: - } - - PrintHeadMinMaxTextField // "Y min" - { - id: machineYMinField - - settingStoreIndex: propertyStoreIndex - - labelText: catalog.i18nc("@label", "Y min") - labelFont: base.labelFont - labelWidth: base.labelWidth - controlWidth: base.controlWidth - unitText: catalog.i18nc("@label", "mm") - - axisName: "y" - axisMinOrMax: "min" - - // TODO: add forceUpdateOnChangeFunction: - } - - PrintHeadMinMaxTextField // "X max" - { - id: machineXMaxField - - settingStoreIndex: propertyStoreIndex - - labelText: catalog.i18nc("@label", "X max") - labelFont: base.labelFont - labelWidth: base.labelWidth - controlWidth: base.controlWidth - unitText: catalog.i18nc("@label", "mm") - - axisName: "x" - axisMinOrMax: "max" - - // TODO: add forceUpdateOnChangeFunction: - } - - PrintHeadMinMaxTextField // "Y max" - { - id: machineYMaxField - - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_head_with_fans_polygon" - settingStoreIndex: propertyStoreIndex - - labelText: catalog.i18nc("@label", "Y max") - labelFont: base.labelFont - labelWidth: base.labelWidth - controlWidth: base.controlWidth - unitText: catalog.i18nc("@label", "mm") - - axisName: "y" - axisMinOrMax: "max" - - // TODO: add forceUpdateOnChangeFunction: - } - - NumericTextFieldWithUnit // "Gantry Height" - { - id: machineGantryHeightField - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "gantry_height" - settingStoreIndex: propertyStoreIndex - labelText: catalog.i18nc("@label", "Gantry Height") - labelFont: base.labelFont - labelWidth: base.labelWidth - controlWidth: base.controlWidth - unitText: catalog.i18nc("@label", "mm") - // TODO: add forceUpdateOnChangeFunction: - } - - ComboBoxWithOptions // "Number of Extruders" - { - id: numberOfExtrudersComboBox - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_extruder_count" - settingStoreIndex: propertyStoreIndex - labelText: catalog.i18nc("@label", "Number of Extruders") - labelFont: base.labelFont - labelWidth: base.labelWidth - controlWidth: base.controlWidth - // TODO: add forceUpdateOnChangeFunction: - // TODO: add afterOnActivate: manager.updateHasMaterialsMetadata - - optionModel: ListModel + model: extrudersModel + delegate: MachineSettingsExtruderTab { - id: extruderCountModel - Component.onCompleted: - { - extruderCountModel.clear() - for (var i = 1; i <= Cura.MachineManager.activeMachine.maxExtruderCount; i++) - { - extruderCountModel.append({text: String(i), value: i}) - } - } + id: discoverTab + extruderStackId: model.id } } } } - - Item // Start and End G-code - { - id: lowerBlock - anchors.top: upperBlock.bottom - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right - anchors.margins: UM.Theme.getSize("default_margin").width - - GcodeTextArea // "Start G-code" - { - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.bottomMargin: UM.Theme.getSize("default_margin").height - anchors.left: parent.left - width: base.columnWidth - UM.Theme.getSize("default_margin").width - - labelText: catalog.i18nc("@title:label", "Start G-code") - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_start_gcode" - settingStoreIndex: propertyStoreIndex - } - - GcodeTextArea // "End G-code" - { - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.bottomMargin: UM.Theme.getSize("default_margin").height - anchors.right: parent.right - width: base.columnWidth - UM.Theme.getSize("default_margin").width - - labelText: catalog.i18nc("@title:label", "End G-code") - containerStackId: Cura.MachineManager.activeMachineId - settingKey: "machine_end_gcode" - settingStoreIndex: propertyStoreIndex - } - } } diff --git a/resources/qml/Widgets/CuraTabButton.qml b/resources/qml/Widgets/CuraTabButton.qml new file mode 100644 index 0000000000..40411ce0b8 --- /dev/null +++ b/resources/qml/Widgets/CuraTabButton.qml @@ -0,0 +1,29 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 + +import UM 1.3 as UM +import Cura 1.1 as Cura + + +// +// This is the default Cura Tab button which is a plaintext label. +// +UM.TabRowButton +{ + id: tabButton + text: model.name + + contentItem: Label + { + anchors.centerIn: tabButton + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + text: tabButton.text + font: tabButton.checked ? UM.Theme.getFont("medium_bold") : UM.Theme.getFont("medium") + renderType: Text.NativeRendering + } +} From 987ebba33bc861b43e9b8276979adae70d176ba8 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 19 Mar 2019 08:28:45 +0100 Subject: [PATCH 12/33] WIP: Make MachineSetting panel work --- cura/CuraApplication.py | 8 ++- cura/UI/MachineSettingsManager.py | 66 +++++++++++++++++++ .../MachineSettings/ComboBoxWithOptions.qml | 21 ++++-- .../NumericTextFieldWithUnit.qml | 2 +- .../MachineSettingsExtruderTab.qml | 23 +++++-- .../MachineSettingsPrinterTab.qml | 64 ++++++++++-------- resources/qml/WelcomePages/TestContent.qml | 34 +++++++--- resources/qml/Widgets/CuraTabButton.qml | 1 - 8 files changed, 168 insertions(+), 51 deletions(-) create mode 100644 cura/UI/MachineSettingsManager.py diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 1192455312..4729bd6a56 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -60,6 +60,7 @@ from cura.Scene.CuraSceneNode import CuraSceneNode from cura.Scene.CuraSceneController import CuraSceneController from cura.UI.WelcomePagesModel import WelcomePagesModel +from cura.UI.MachineSettingsManager import MachineSettingsManager from UM.Settings.SettingDefinition import SettingDefinition, DefinitionPropertyType from UM.Settings.ContainerRegistry import ContainerRegistry @@ -212,8 +213,9 @@ class CuraApplication(QtApplication): self._cura_scene_controller = None self._machine_error_checker = None - self._discovered_printer_model = DiscoveredPrintersModel(self) + self._machine_settings_manager = MachineSettingsManager(self) + self._discovered_printer_model = DiscoveredPrintersModel(self) self._welcome_pages_model = WelcomePagesModel(self) self._quality_profile_drop_down_menu_model = None @@ -862,6 +864,10 @@ class CuraApplication(QtApplication): def getWelcomePagesModel(self, *args) -> "WelcomePagesModel": return self._welcome_pages_model + @pyqtSlot(result = QObject) + def getMachineSettingsManager(self, *args) -> "MachineSettingsManager": + return self._machine_settings_manager + def getCuraFormulaFunctions(self, *args) -> "CuraFormulaFunctions": if self._cura_formula_functions is None: self._cura_formula_functions = CuraFormulaFunctions(self) diff --git a/cura/UI/MachineSettingsManager.py b/cura/UI/MachineSettingsManager.py new file mode 100644 index 0000000000..3232323bcb --- /dev/null +++ b/cura/UI/MachineSettingsManager.py @@ -0,0 +1,66 @@ + +from typing import Any, Dict, Optional, TYPE_CHECKING + +from PyQt5.QtCore import Qt, QObject, pyqtSlot + +from UM.i18n import i18nCatalog + + +class MachineSettingsManager(QObject): + + def __init__(self, parent: Optional["QObject"] = None) -> None: + super().__init__(parent) + self._i18n_catalog = i18nCatalog("cura") + + from cura.CuraApplication import CuraApplication + self._application = CuraApplication.getInstance() + + # Force rebuilding the build volume by reloading the global container stack. This is a bit of a hack, but it seems + # quite enough. + @pyqtSlot() + def forceUpdate(self) -> None: + self._application.getMachineManager().globalContainerChanged.emit() + + # Function for the Machine Settings panel (QML) to update the compatible material diameter after a user has changed + # an extruder's compatible material diameter. This ensures that after the modification, changes can be notified + # and updated right away. + @pyqtSlot(int) + def updateMaterialForDiameter(self, extruder_position: int): + # Updates the material container to a material that matches the material diameter set for the printer + self._application.getMachineManager().updateMaterialWithVariant(str(extruder_position)) + + # FIXME(Lipu): Better document what this function does, especially the fuzzy gcode flavor and has_materials logic + # regarding UM2 and UM2+ + # Function for the Machine Settings panel (QML) to update after the usre changes "Number of Extruders". + @pyqtSlot() + def updateHasMaterialsMetadata(self): + machine_manager = self._application.getMachineManager() + material_manager = self._application.getMaterialManager() + + global_stack = material_manager.activeMachine + + definition = global_stack.definition + if definition.getProperty("machine_gcode_flavor", "value") != "UltiGCode" or definition.getMetaDataEntry( + "has_materials", False): + # In other words: only continue for the UM2 (extended), but not for the UM2+ + return + + extruder_positions = list(global_stack.extruders.keys()) + has_materials = global_stack.getProperty("machine_gcode_flavor", "value") != "UltiGCode" + + material_node = None + if has_materials: + global_stack.setMetaDataEntry("has_materials", True) + else: + # The metadata entry is stored in an ini, and ini files are parsed as strings only. + # Because any non-empty string evaluates to a boolean True, we have to remove the entry to make it False. + if "has_materials" in global_stack.getMetaData(): + global_stack.removeMetaDataEntry("has_materials") + + # set materials + for position in extruder_positions: + if has_materials: + material_node = material_manager.getDefaultMaterial(global_stack, position, None) + machine_manager.setMaterial(position, material_node) + + self.forceUpdate() diff --git a/resources/qml/MachineSettings/ComboBoxWithOptions.qml b/resources/qml/MachineSettings/ComboBoxWithOptions.qml index 1d7f9307b6..6abc2bde22 100644 --- a/resources/qml/MachineSettings/ComboBoxWithOptions.qml +++ b/resources/qml/MachineSettings/ComboBoxWithOptions.qml @@ -39,8 +39,8 @@ UM.TooltipArea property string tooltipText: propertyProvider.properties.description // callback functions - property var afterOnActivateFunction: dummy_func property var forceUpdateOnChangeFunction: dummy_func + property var afterOnEditingFinishedFunction: dummy_func // a dummy function for default property values function dummy_func() {} @@ -64,8 +64,10 @@ UM.TooltipArea ListModel { id: defaultOptionsModel - Component.onCompleted: + + function updateModel() { + clear() // Options come in as a string-representation of an OrderedDict var options = propertyProvider.properties.options.match(/^OrderedDict\(\[\((.*)\)\]\)$/) if (options) @@ -74,10 +76,19 @@ UM.TooltipArea for (var i = 0; i < options.length; i++) { var option = options[i].substring(1, options[i].length - 1).split("', '") - defaultOptionsModel.append({text: option[1], value: option[0]}) + append({text: option[1], value: option[0]}) } } } + + Component.onCompleted: updateModel() + } + + // Remake the model when the model is bound to a different container stack + Connections + { + target: propertyProvider + onContainerStackChanged: defaultOptionsModel.updateModel() } CuraComboBox @@ -107,11 +118,11 @@ UM.TooltipArea onActivated: { - if(propertyProvider.properties.value != model.get(index).value) + if (propertyProvider.properties.value != model.get(index).value) { propertyProvider.setPropertyValue("value", model.get(index).value) forceUpdateOnChangeFunction() - afterOnActivateFunction() + afterOnEditingFinishedFunction() } } } diff --git a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml index a39fbba0c5..c6872617bc 100644 --- a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml +++ b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml @@ -181,7 +181,7 @@ UM.TooltipArea propertyProvider.setPropertyValue("value", text) } forceUpdateOnChangeFunction() - afterOnEditingFinished() + afterOnEditingFinishedFunction() } } diff --git a/resources/qml/WelcomePages/MachineSettingsExtruderTab.qml b/resources/qml/WelcomePages/MachineSettingsExtruderTab.qml index 440c4b2bab..3ed82a6dde 100644 --- a/resources/qml/WelcomePages/MachineSettingsExtruderTab.qml +++ b/resources/qml/WelcomePages/MachineSettingsExtruderTab.qml @@ -23,8 +23,6 @@ Item anchors.right: parent.right anchors.top: parent.top - property string extruderStackId: "" - property int labelWidth: 180 property int controlWidth: UM.Theme.getSize("setting_control").width * 3 / 4 property var labelFont: UM.Theme.getFont("medium") @@ -33,6 +31,15 @@ Item property int columnSpacing: 3 property int propertyStoreIndex: 5 // definition_changes + property string extruderStackId: "" + property int extruderPosition: 0 + property var forceUpdateFunction: CuraApplication.getMachineSettingsManager().forceUpdate + + function updateMaterialDiameter() + { + CuraApplication.getMachineSettingsManager().updateMaterialForDiameter(extruderPosition) + } + Item { id: upperBlock @@ -73,7 +80,7 @@ Item labelWidth: base.labelWidth controlWidth: base.controlWidth unitText: catalog.i18nc("@label", "mm") - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction } NumericTextFieldWithUnit // "Compatible material diameter" @@ -87,7 +94,9 @@ Item labelWidth: base.labelWidth controlWidth: base.controlWidth unitText: catalog.i18nc("@label", "mm") - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction + // Other modules won't automatically respond after the user changes the value, so we need to force it. + afterOnEditingFinishedFunction: updateMaterialDiameter } NumericTextFieldWithUnit // "Nozzle offset X" @@ -101,7 +110,7 @@ Item labelWidth: base.labelWidth controlWidth: base.controlWidth unitText: catalog.i18nc("@label", "mm") - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction } NumericTextFieldWithUnit // "Nozzle offset Y" @@ -115,7 +124,7 @@ Item labelWidth: base.labelWidth controlWidth: base.controlWidth unitText: catalog.i18nc("@label", "mm") - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction } NumericTextFieldWithUnit // "Cooling Fan Number" @@ -129,7 +138,7 @@ Item labelWidth: base.labelWidth controlWidth: base.controlWidth unitText: "" - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction } } } diff --git a/resources/qml/WelcomePages/MachineSettingsPrinterTab.qml b/resources/qml/WelcomePages/MachineSettingsPrinterTab.qml index b22f4a411b..6971ab74db 100644 --- a/resources/qml/WelcomePages/MachineSettingsPrinterTab.qml +++ b/resources/qml/WelcomePages/MachineSettingsPrinterTab.qml @@ -30,6 +30,10 @@ Item property int columnSpacing: 3 property int propertyStoreIndex: 5 // definition_changes + property string machineStackId: Cura.MachineManager.activeMachineId + + property var forceUpdateFunction: CuraApplication.getMachineSettingsManager().forceUpdate + Item { id: upperBlock @@ -61,7 +65,7 @@ Item NumericTextFieldWithUnit // "X (Width)" { id: machineXWidthField - containerStackId: Cura.MachineManager.activeMachineId + containerStackId: machineStackId settingKey: "machine_width" settingStoreIndex: propertyStoreIndex labelText: catalog.i18nc("@label", "X (Width)") @@ -69,13 +73,13 @@ Item labelWidth: base.labelWidth controlWidth: base.controlWidth unitText: catalog.i18nc("@label", "mm") - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction } NumericTextFieldWithUnit // "Y (Depth)" { id: machineYDepthField - containerStackId: Cura.MachineManager.activeMachineId + containerStackId: machineStackId settingKey: "machine_depth" settingStoreIndex: propertyStoreIndex labelText: catalog.i18nc("@label", "Y (Depth)") @@ -83,13 +87,13 @@ Item labelWidth: base.labelWidth controlWidth: base.controlWidth unitText: catalog.i18nc("@label", "mm") - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction } NumericTextFieldWithUnit // "Z (Height)" { id: machineZHeightField - containerStackId: Cura.MachineManager.activeMachineId + containerStackId: machineStackId settingKey: "machine_height" settingStoreIndex: propertyStoreIndex labelText: catalog.i18nc("@label", "Z (Height)") @@ -97,58 +101,61 @@ Item labelWidth: base.labelWidth controlWidth: base.controlWidth unitText: catalog.i18nc("@label", "mm") - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction } ComboBoxWithOptions // "Build plate shape" { id: buildPlateShapeComboBox - containerStackId: Cura.MachineManager.activeMachineId + containerStackId: machineStackId settingKey: "machine_shape" settingStoreIndex: propertyStoreIndex labelText: catalog.i18nc("@label", "Build plate shape") labelFont: base.labelFont labelWidth: base.labelWidth controlWidth: base.controlWidth - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction } SimpleCheckBox // "Origin at center" { id: originAtCenterCheckBox - containerStackId: Cura.MachineManager.activeMachineId + containerStackId: machineStackId settingKey: "machine_center_is_zero" settingStoreIndex: propertyStoreIndex labelText: catalog.i18nc("@label", "Origin at center") labelFont: base.labelFont labelWidth: base.labelWidth - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction } SimpleCheckBox // "Heated bed" { id: heatedBedCheckBox - containerStackId: Cura.MachineManager.activeMachineId + containerStackId: machineStackId settingKey: "machine_heated_bed" settingStoreIndex: propertyStoreIndex labelText: catalog.i18nc("@label", "Heated bed") labelFont: base.labelFont labelWidth: base.labelWidth - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction } ComboBoxWithOptions // "G-code flavor" { id: gcodeFlavorComboBox - containerStackId: Cura.MachineManager.activeMachineId + containerStackId: machineStackId settingKey: "machine_gcode_flavor" settingStoreIndex: propertyStoreIndex labelText: catalog.i18nc("@label", "G-code flavor") labelFont: base.labelFont labelWidth: base.labelWidth controlWidth: base.controlWidth - // TODO: add forceUpdateOnChangeFunction: - // TODO: add afterOnActivate: manager.updateHasMaterialsMetadata + forceUpdateOnChangeFunction: forceUpdateFunction + // FIXME(Lipu): better document this. + // This has something to do with UM2 and UM2+ regarding "has_material" and the gcode flavor settings. + // I don't remember exactly what. + afterOnEditingFinishedFunction: CuraApplication.getMachineSettingsManager().updateHasMaterialsMetadata } } @@ -185,7 +192,7 @@ Item axisName: "x" axisMinOrMax: "min" - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction } PrintHeadMinMaxTextField // "Y min" @@ -203,7 +210,7 @@ Item axisName: "y" axisMinOrMax: "min" - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction } PrintHeadMinMaxTextField // "X max" @@ -221,14 +228,14 @@ Item axisName: "x" axisMinOrMax: "max" - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction } PrintHeadMinMaxTextField // "Y max" { id: machineYMaxField - containerStackId: Cura.MachineManager.activeMachineId + containerStackId: machineStackId settingKey: "machine_head_with_fans_polygon" settingStoreIndex: propertyStoreIndex @@ -241,13 +248,13 @@ Item axisName: "y" axisMinOrMax: "max" - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction } NumericTextFieldWithUnit // "Gantry Height" { id: machineGantryHeightField - containerStackId: Cura.MachineManager.activeMachineId + containerStackId: machineStackId settingKey: "gantry_height" settingStoreIndex: propertyStoreIndex labelText: catalog.i18nc("@label", "Gantry Height") @@ -255,21 +262,24 @@ Item labelWidth: base.labelWidth controlWidth: base.controlWidth unitText: catalog.i18nc("@label", "mm") - // TODO: add forceUpdateOnChangeFunction: + forceUpdateOnChangeFunction: forceUpdateFunction } ComboBoxWithOptions // "Number of Extruders" { id: numberOfExtrudersComboBox - containerStackId: Cura.MachineManager.activeMachineId + containerStackId: machineStackId settingKey: "machine_extruder_count" settingStoreIndex: propertyStoreIndex labelText: catalog.i18nc("@label", "Number of Extruders") labelFont: base.labelFont labelWidth: base.labelWidth controlWidth: base.controlWidth - // TODO: add forceUpdateOnChangeFunction: - // TODO: add afterOnActivate: manager.updateHasMaterialsMetadata + forceUpdateOnChangeFunction: forceUpdateFunction + // FIXME(Lipu): better document this. + // This has something to do with UM2 and UM2+ regarding "has_material" and the gcode flavor settings. + // I don't remember exactly what. + afterOnEditingFinishedFunction: CuraApplication.getMachineSettingsManager().updateHasMaterialsMetadata optionModel: ListModel { @@ -305,7 +315,7 @@ Item width: base.columnWidth - UM.Theme.getSize("default_margin").width labelText: catalog.i18nc("@title:label", "Start G-code") - containerStackId: Cura.MachineManager.activeMachineId + containerStackId: machineStackId settingKey: "machine_start_gcode" settingStoreIndex: propertyStoreIndex } @@ -319,7 +329,7 @@ Item width: base.columnWidth - UM.Theme.getSize("default_margin").width labelText: catalog.i18nc("@title:label", "End G-code") - containerStackId: Cura.MachineManager.activeMachineId + containerStackId: machineStackId settingKey: "machine_end_gcode" settingStoreIndex: propertyStoreIndex } diff --git a/resources/qml/WelcomePages/TestContent.qml b/resources/qml/WelcomePages/TestContent.qml index f9488665c0..6071f965b2 100644 --- a/resources/qml/WelcomePages/TestContent.qml +++ b/resources/qml/WelcomePages/TestContent.qml @@ -26,11 +26,31 @@ Item property var extrudersModel: Cura.ExtrudersModel {} - onVisibleChanged: + // If we create a CuraTabButton for "Printer" and use Repeater for extruders, for some reason, once the component + // finishes it will automatically change "currentIndex = 1", and it is VERY difficult to change "currentIndex = 0" + // after that. Using a model and a Repeater to create both "Printer" and extruder CuraTabButtons seem to solve this + // problem. + Connections { - if (visible) + target: extrudersModel + onItemsChanged: tabNameModel.update() + } + + ListModel + { + id: tabNameModel + + Component.onCompleted: update() + + function update() { - tabBar.currentIndex = 0 + clear() + append({ name: catalog.i18nc("@title:tab", "Printer") }) + for (var i = 0; i < extrudersModel.count; i++) + { + const m = extrudersModel.getItem(i) + append({ name: m.name }) + } } } @@ -46,14 +66,9 @@ Item id: tabBar width: parent.width - CuraTabButton - { - text: catalog.i18nc("@title:tab", "Printer") - } - Repeater { - model: extrudersModel + model: tabNameModel delegate: CuraTabButton { text: model.name @@ -83,6 +98,7 @@ Item delegate: MachineSettingsExtruderTab { id: discoverTab + extruderPosition: model.index extruderStackId: model.id } } diff --git a/resources/qml/Widgets/CuraTabButton.qml b/resources/qml/Widgets/CuraTabButton.qml index 40411ce0b8..86d1180abf 100644 --- a/resources/qml/Widgets/CuraTabButton.qml +++ b/resources/qml/Widgets/CuraTabButton.qml @@ -3,7 +3,6 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import QtQuick.Layouts 1.3 import UM 1.3 as UM import Cura 1.1 as Cura From 58062cb4de628d2416448471d9611974e15a43df Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 19 Mar 2019 11:06:42 +0100 Subject: [PATCH 13/33] WIP: Remove unused MachineManagementModel --- cura/CuraApplication.py | 2 - .../Machines/Models/MachineManagementModel.py | 82 ------------------- 2 files changed, 84 deletions(-) delete mode 100644 cura/Machines/Models/MachineManagementModel.py diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 4729bd6a56..6d22320882 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -78,7 +78,6 @@ from cura.Machines.Models.GenericMaterialsModel import GenericMaterialsModel from cura.Machines.Models.MaterialBrandsModel import MaterialBrandsModel from cura.Machines.Models.QualityManagementModel import QualityManagementModel from cura.Machines.Models.QualitySettingsModel import QualitySettingsModel -from cura.Machines.Models.MachineManagementModel import MachineManagementModel from cura.Machines.Models.SettingVisibilityPresetsModel import SettingVisibilityPresetsModel @@ -1015,7 +1014,6 @@ class CuraApplication(QtApplication): qmlRegisterType(GenericMaterialsModel, "Cura", 1, 0, "GenericMaterialsModel") qmlRegisterType(MaterialBrandsModel, "Cura", 1, 0, "MaterialBrandsModel") qmlRegisterType(QualityManagementModel, "Cura", 1, 0, "QualityManagementModel") - qmlRegisterType(MachineManagementModel, "Cura", 1, 0, "MachineManagementModel") qmlRegisterType(DiscoveredPrintersModel, "Cura", 1, 0, "DiscoveredPrintersModel") diff --git a/cura/Machines/Models/MachineManagementModel.py b/cura/Machines/Models/MachineManagementModel.py deleted file mode 100644 index 3297b8a467..0000000000 --- a/cura/Machines/Models/MachineManagementModel.py +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright (c) 2018 Ultimaker B.V. -# Cura is released under the terms of the LGPLv3 or higher. - -from UM.Qt.ListModel import ListModel - -from PyQt5.QtCore import Qt - -from UM.Settings.ContainerRegistry import ContainerRegistry -from UM.Settings.ContainerStack import ContainerStack - -from UM.i18n import i18nCatalog -catalog = i18nCatalog("cura") - - -# -# This the QML model for the quality management page. -# -class MachineManagementModel(ListModel): - NameRole = Qt.UserRole + 1 - IdRole = Qt.UserRole + 2 - MetaDataRole = Qt.UserRole + 3 - GroupRole = Qt.UserRole + 4 - - def __init__(self, parent = None): - super().__init__(parent) - self.addRoleName(self.NameRole, "name") - self.addRoleName(self.IdRole, "id") - self.addRoleName(self.MetaDataRole, "metadata") - self.addRoleName(self.GroupRole, "group") - self._local_container_stacks = [] - self._network_container_stacks = [] - - # Listen to changes - ContainerRegistry.getInstance().containerAdded.connect(self._onContainerChanged) - ContainerRegistry.getInstance().containerMetaDataChanged.connect(self._onContainerChanged) - ContainerRegistry.getInstance().containerRemoved.connect(self._onContainerChanged) - self._filter_dict = {} - self._update() - - ## Handler for container added/removed events from registry - def _onContainerChanged(self, container): - # We only need to update when the added / removed container is a stack. - if isinstance(container, ContainerStack) and container.getMetaDataEntry("type") == "machine": - self._update() - - ## Private convenience function to reset & repopulate the model. - def _update(self): - items = [] - - # Get first the network enabled printers - network_filter_printers = {"type": "machine", - "um_network_key": "*", - "hidden": "False"} - self._network_container_stacks = ContainerRegistry.getInstance().findContainerStacks(**network_filter_printers) - self._network_container_stacks.sort(key = lambda i: i.getMetaDataEntry("group_name", "")) - - for container in self._network_container_stacks: - metadata = container.getMetaData().copy() - if container.getBottom(): - metadata["definition_name"] = container.getBottom().getName() - - items.append({"name": metadata.get("group_name", ""), - "id": container.getId(), - "metadata": metadata, - "group": catalog.i18nc("@info:title", "Network enabled printers")}) - - # Get now the local printers - local_filter_printers = {"type": "machine", "um_network_key": None} - self._local_container_stacks = ContainerRegistry.getInstance().findContainerStacks(**local_filter_printers) - self._local_container_stacks.sort(key = lambda i: i.getName()) - - for container in self._local_container_stacks: - metadata = container.getMetaData().copy() - if container.getBottom(): - metadata["definition_name"] = container.getBottom().getName() - - items.append({"name": container.getName(), - "id": container.getId(), - "metadata": metadata, - "group": catalog.i18nc("@info:title", "Local printers")}) - - self.setItems(items) From d4c0104bc2d2f5cc98fd17c524868d3715b00185 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 19 Mar 2019 12:07:26 +0100 Subject: [PATCH 14/33] WIP: Add FirstStartMachineActionsModel --- cura/CuraApplication.py | 9 ++++ cura/MachineActionManager.py | 2 +- .../Models/FirstStartMachineActionsModel.py | 52 +++++++++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 cura/Machines/Models/FirstStartMachineActionsModel.py diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 6d22320882..01b0e457ae 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -78,6 +78,7 @@ from cura.Machines.Models.GenericMaterialsModel import GenericMaterialsModel from cura.Machines.Models.MaterialBrandsModel import MaterialBrandsModel from cura.Machines.Models.QualityManagementModel import QualityManagementModel from cura.Machines.Models.QualitySettingsModel import QualitySettingsModel +from cura.Machines.Models.FirstStartMachineActionsModel import FirstStartMachineActionsModel from cura.Machines.Models.SettingVisibilityPresetsModel import SettingVisibilityPresetsModel @@ -215,6 +216,7 @@ class CuraApplication(QtApplication): self._machine_settings_manager = MachineSettingsManager(self) self._discovered_printer_model = DiscoveredPrintersModel(self) + self._first_start_machine_actions_model = FirstStartMachineActionsModel(self) self._welcome_pages_model = WelcomePagesModel(self) self._quality_profile_drop_down_menu_model = None @@ -751,6 +753,8 @@ class CuraApplication(QtApplication): # Initialize setting visibility presets model. self._setting_visibility_presets_model = SettingVisibilityPresetsModel(self.getPreferences(), parent = self) + self._first_start_machine_actions_model.initialize() + # Initialize Cura API self._cura_API.initialize() @@ -855,6 +859,10 @@ class CuraApplication(QtApplication): def getDiscoveredPrintersModel(self, *args) -> "DiscoveredPrintersModel": return self._discovered_printer_model + @pyqtSlot(result = QObject) + def getFirstStartMachineActionsModel(self, *args) -> "FirstStartMachineActionsModel": + return self._first_start_machine_actions_model + @pyqtSlot(result = QObject) def getSettingVisibilityPresetsModel(self, *args) -> SettingVisibilityPresetsModel: return self._setting_visibility_presets_model @@ -1026,6 +1034,7 @@ class CuraApplication(QtApplication): qmlRegisterType(MaterialSettingsVisibilityHandler, "Cura", 1, 0, "MaterialSettingsVisibilityHandler") qmlRegisterType(SettingVisibilityPresetsModel, "Cura", 1, 0, "SettingVisibilityPresetsModel") qmlRegisterType(QualitySettingsModel, "Cura", 1, 0, "QualitySettingsModel") + qmlRegisterType(FirstStartMachineActionsModel, "Cura", 1, 0, "FirstStartMachineActionsModel") qmlRegisterType(MachineNameValidator, "Cura", 1, 0, "MachineNameValidator") qmlRegisterType(UserChangesModel, "Cura", 1, 0, "UserChangesModel") qmlRegisterSingletonType(ContainerManager, "Cura", 1, 0, "ContainerManager", ContainerManager.getInstance) diff --git a/cura/MachineActionManager.py b/cura/MachineActionManager.py index db0f7bfbff..8cfde654fb 100644 --- a/cura/MachineActionManager.py +++ b/cura/MachineActionManager.py @@ -136,7 +136,7 @@ class MachineActionManager(QObject): # action multiple times). # \param definition_id The ID of the definition that you want to get the "on added" actions for. # \returns List of actions. - @pyqtSlot(str, result="QVariantList") + @pyqtSlot(str, result = "QVariantList") def getFirstStartActions(self, definition_id: str) -> List["MachineAction"]: if definition_id in self._first_start_actions: return self._first_start_actions[definition_id] diff --git a/cura/Machines/Models/FirstStartMachineActionsModel.py b/cura/Machines/Models/FirstStartMachineActionsModel.py new file mode 100644 index 0000000000..8c2673c3a3 --- /dev/null +++ b/cura/Machines/Models/FirstStartMachineActionsModel.py @@ -0,0 +1,52 @@ +# Copyright (c) 2019 Ultimaker B.V. +# Cura is released under the terms of the LGPLv3 or higher. + +from typing import Optional + +from PyQt5.QtCore import QObject, Qt + +from UM.Qt.ListModel import ListModel + + +# +# This model holds all first-start machine actions for the currently active machine. It has 2 roles: +# - title : the title/name of the action +# - content : the QObject of the QML content of the action +# +class FirstStartMachineActionsModel(ListModel): + + TitleRole = Qt.UserRole + 1 + ContentRole = Qt.UserRole + 2 + + def __init__(self, parent: Optional[QObject] = None) -> None: + super().__init__(parent) + + self.addRoleName(self.TitleRole, "title") + self.addRoleName(self.ContentRole, "content") + + from cura.CuraApplication import CuraApplication + self._application = CuraApplication.getInstance() + + def initialize(self) -> None: + self._application.getMachineManager().globalContainerChanged.connect(self._update) + self._update() + + def _update(self) -> None: + global_stack = self._application.getMachineManager().activeMachine + if global_stack is None: + self.setItems([]) + return + + definition_id = global_stack.definition.getId() + first_start_actions = self._application.getMachineActionManager().getFirstStartActions(definition_id) + + item_list = [] + for item in first_start_actions: + item_list.append({"title": item.label, + "content": item.displayItem, + }) + + self.setItems(item_list) + + +__all__ = ["FirstStartMachineActionsModel"] From 8d68db9ff0169a1ce8ef3d1276932f1ebf933f99 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 19 Mar 2019 12:08:42 +0100 Subject: [PATCH 15/33] WIP: Add first-start machine actions --- cura/CuraApplication.py | 2 - .../Models/FirstStartMachineActionsModel.py | 106 +- cura/UI/MachineSettingsManager.py | 10 +- cura/UI/WelcomePagesModel.py | 12 +- .../MachineSettingsAction.qml | 973 ++---------------- .../MachineSettingsExtruderTab.qml | 17 +- .../MachineSettingsPrinterTab.qml | 38 +- .../MachineSettings/ComboBoxWithOptions.qml | 15 +- .../MachineSettingsContent.qml | 55 - .../qml/MachineSettings/PolygonTextField.qml | 120 --- .../qml/MachineSettings/PrintSetupContent.qml | 272 ----- .../AddPrinterBySelectionContent.qml | 10 +- .../FirstStartMachineActionsContent.qml | 91 ++ resources/qml/WelcomePages/StepPanel.qml | 2 +- resources/qml/WelcomePages/TestContent.qml | 107 -- resources/qml/qmldir | 17 + 16 files changed, 288 insertions(+), 1559 deletions(-) rename {resources/qml/WelcomePages => plugins/MachineSettingsAction}/MachineSettingsExtruderTab.qml (93%) rename {resources/qml/WelcomePages => plugins/MachineSettingsAction}/MachineSettingsPrinterTab.qml (89%) delete mode 100644 resources/qml/MachineSettings/MachineSettingsContent.qml delete mode 100644 resources/qml/MachineSettings/PolygonTextField.qml delete mode 100644 resources/qml/MachineSettings/PrintSetupContent.qml create mode 100644 resources/qml/WelcomePages/FirstStartMachineActionsContent.qml delete mode 100644 resources/qml/WelcomePages/TestContent.qml diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 01b0e457ae..6a7295ba33 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -753,8 +753,6 @@ class CuraApplication(QtApplication): # Initialize setting visibility presets model. self._setting_visibility_presets_model = SettingVisibilityPresetsModel(self.getPreferences(), parent = self) - self._first_start_machine_actions_model.initialize() - # Initialize Cura API self._cura_API.initialize() diff --git a/cura/Machines/Models/FirstStartMachineActionsModel.py b/cura/Machines/Models/FirstStartMachineActionsModel.py index 8c2673c3a3..b7e806278c 100644 --- a/cura/Machines/Models/FirstStartMachineActionsModel.py +++ b/cura/Machines/Models/FirstStartMachineActionsModel.py @@ -1,52 +1,54 @@ -# Copyright (c) 2019 Ultimaker B.V. -# Cura is released under the terms of the LGPLv3 or higher. - -from typing import Optional - -from PyQt5.QtCore import QObject, Qt - -from UM.Qt.ListModel import ListModel - - -# -# This model holds all first-start machine actions for the currently active machine. It has 2 roles: -# - title : the title/name of the action -# - content : the QObject of the QML content of the action -# -class FirstStartMachineActionsModel(ListModel): - - TitleRole = Qt.UserRole + 1 - ContentRole = Qt.UserRole + 2 - - def __init__(self, parent: Optional[QObject] = None) -> None: - super().__init__(parent) - - self.addRoleName(self.TitleRole, "title") - self.addRoleName(self.ContentRole, "content") - - from cura.CuraApplication import CuraApplication - self._application = CuraApplication.getInstance() - - def initialize(self) -> None: - self._application.getMachineManager().globalContainerChanged.connect(self._update) - self._update() - - def _update(self) -> None: - global_stack = self._application.getMachineManager().activeMachine - if global_stack is None: - self.setItems([]) - return - - definition_id = global_stack.definition.getId() - first_start_actions = self._application.getMachineActionManager().getFirstStartActions(definition_id) - - item_list = [] - for item in first_start_actions: - item_list.append({"title": item.label, - "content": item.displayItem, - }) - - self.setItems(item_list) - - -__all__ = ["FirstStartMachineActionsModel"] +# Copyright (c) 2019 Ultimaker B.V. +# Cura is released under the terms of the LGPLv3 or higher. + +from typing import Optional + +from PyQt5.QtCore import QObject, Qt + +from UM.Qt.ListModel import ListModel + + +# +# This model holds all first-start machine actions for the currently active machine. It has 2 roles: +# - title : the title/name of the action +# - content : the QObject of the QML content of the action +# +class FirstStartMachineActionsModel(ListModel): + + TitleRole = Qt.UserRole + 1 + ContentRole = Qt.UserRole + 2 + + def __init__(self, parent: Optional[QObject] = None) -> None: + super().__init__(parent) + + self.addRoleName(self.TitleRole, "title") + self.addRoleName(self.ContentRole, "content") + + from cura.CuraApplication import CuraApplication + self._application = CuraApplication.getInstance() + + self._application.initializationFinished.connect(self._initialize) + + def _initialize(self) -> None: + self._application.getMachineManager().globalContainerChanged.connect(self._update) + self._update() + + def _update(self) -> None: + global_stack = self._application.getMachineManager().activeMachine + if global_stack is None: + self.setItems([]) + return + + definition_id = global_stack.definition.getId() + first_start_actions = self._application.getMachineActionManager().getFirstStartActions(definition_id) + + item_list = [] + for item in first_start_actions: + item_list.append({"title": item.label, + "content": item.displayItem, + }) + + self.setItems(item_list) + + +__all__ = ["FirstStartMachineActionsModel"] diff --git a/cura/UI/MachineSettingsManager.py b/cura/UI/MachineSettingsManager.py index 3232323bcb..8fdbae09e1 100644 --- a/cura/UI/MachineSettingsManager.py +++ b/cura/UI/MachineSettingsManager.py @@ -25,10 +25,16 @@ class MachineSettingsManager(QObject): # an extruder's compatible material diameter. This ensures that after the modification, changes can be notified # and updated right away. @pyqtSlot(int) - def updateMaterialForDiameter(self, extruder_position: int): + def updateMaterialForDiameter(self, extruder_position: int) -> None: # Updates the material container to a material that matches the material diameter set for the printer self._application.getMachineManager().updateMaterialWithVariant(str(extruder_position)) + @pyqtSlot(int) + def setMachineExtruderCount(self, extruder_count: int) -> None: + # Note: this method was in this class before, but since it's quite generic and other plugins also need it + # it was moved to the machine manager instead. Now this method just calls the machine manager. + self._application.getMachineManager().setActiveMachineExtruderCount(extruder_count) + # FIXME(Lipu): Better document what this function does, especially the fuzzy gcode flavor and has_materials logic # regarding UM2 and UM2+ # Function for the Machine Settings panel (QML) to update after the usre changes "Number of Extruders". @@ -37,7 +43,7 @@ class MachineSettingsManager(QObject): machine_manager = self._application.getMachineManager() material_manager = self._application.getMaterialManager() - global_stack = material_manager.activeMachine + global_stack = machine_manager.activeMachine definition = global_stack.definition if definition.getProperty("machine_gcode_flavor", "value") != "UltiGCode" or definition.getMetaDataEntry( diff --git a/cura/UI/WelcomePagesModel.py b/cura/UI/WelcomePagesModel.py index 87158b35c3..222de27d17 100644 --- a/cura/UI/WelcomePagesModel.py +++ b/cura/UI/WelcomePagesModel.py @@ -30,13 +30,6 @@ class WelcomePagesModel(ListModel): def initialize(self) -> None: from cura.CuraApplication import CuraApplication - self._pages.append({"id": "test", - "page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, - os.path.join("WelcomePages", - "TestContent.qml"))), - }) - - # Add default welcome pages self._pages.append({"id": "welcome", "page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, @@ -68,6 +61,11 @@ class WelcomePagesModel(ListModel): os.path.join("WelcomePages", "AddPrinterByIpContent.qml"))), }) + self._pages.append({"id": "machine_actions", + "page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, + os.path.join("WelcomePages", + "FirstStartMachineActionsContent.qml"))), + }) self._pages.append({"id": "cloud", "page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, os.path.join("WelcomePages", diff --git a/plugins/MachineSettingsAction/MachineSettingsAction.qml b/plugins/MachineSettingsAction/MachineSettingsAction.qml index ef8fda224a..28eb37e939 100644 --- a/plugins/MachineSettingsAction/MachineSettingsAction.qml +++ b/plugins/MachineSettingsAction/MachineSettingsAction.qml @@ -1,939 +1,102 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2019 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Layouts 1.1 -import QtQuick.Window 2.1 +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 -import UM 1.2 as UM -import Cura 1.0 as Cura +import UM 1.3 as UM +import Cura 1.1 as Cura +// +// This component contains the content for the "Welcome" page of the welcome on-boarding process. +// Cura.MachineAction { - id: base - property var extrudersModel: Cura.ExtrudersModel{} // Do not retrieve the Model from a backend. Otherwise the tabs - // in tabView will not removed/updated. Probably QML bug - property int extruderTabsCount: 0 + UM.I18nCatalog { id: catalog; name: "cura" } - property var activeMachineId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.id : "" + anchors.fill: parent + anchors.margins: UM.Theme.getSize("default_margin").width + property var extrudersModel: Cura.ExtrudersModel {} + + // If we create a CuraTabButton for "Printer" and use Repeater for extruders, for some reason, once the component + // finishes it will automatically change "currentIndex = 1", and it is VERY difficult to change "currentIndex = 0" + // after that. Using a model and a Repeater to create both "Printer" and extruder CuraTabButtons seem to solve this + // problem. Connections { - target: base.extrudersModel - onModelChanged: - { - var extruderCount = base.extrudersModel.count; - base.extruderTabsCount = extruderCount; - } + target: extrudersModel + onItemsChanged: tabNameModel.update() } - Connections + ListModel { - target: dialog ? dialog : null - ignoreUnknownSignals: true - // Any which way this action dialog is dismissed, make sure it is properly finished - onNextClicked: finishAction() - onBackClicked: finishAction() - onAccepted: finishAction() - onRejected: finishAction() - onClosing: finishAction() - } + id: tabNameModel - function finishAction() - { - forceActiveFocus(); - manager.onFinishAction(); - } + Component.onCompleted: update() - anchors.fill: parent; - Item - { - id: machineSettingsAction - anchors.fill: parent; - - UM.I18nCatalog { id: catalog; name: "cura"; } - - Label + function update() { - id: pageTitle - width: parent.width - text: catalog.i18nc("@title", "Machine Settings") - wrapMode: Text.WordWrap - font.pointSize: 18; - } - - TabView - { - id: settingsTabs - height: parent.height - y - width: parent.width - anchors.left: parent.left - anchors.top: pageTitle.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height - - property real columnWidth: Math.round((width - 3 * UM.Theme.getSize("default_margin").width) / 2) - property real labelColumnWidth: Math.round(columnWidth / 2) - - Tab + clear() + append({ name: catalog.i18nc("@title:tab", "Printer") }) + for (var i = 0; i < extrudersModel.count; i++) { - title: catalog.i18nc("@title:tab", "Printer"); - anchors.margins: UM.Theme.getSize("default_margin").width + const m = extrudersModel.getItem(i) + append({ name: m.name }) + } + } + } - Column + Rectangle + { + anchors.fill: parent + border.color: tabBar.visible ? UM.Theme.getColor("lining") : "transparent" + border.width: UM.Theme.getSize("default_lining").width + radius: UM.Theme.getSize("default_radius").width + + UM.TabRow + { + id: tabBar + width: parent.width + + Repeater + { + model: tabNameModel + delegate: Cura.CuraTabButton { - spacing: UM.Theme.getSize("default_margin").height - - Row - { - width: parent.width - spacing: UM.Theme.getSize("default_margin").height - - Column - { - width: settingsTabs.columnWidth - spacing: UM.Theme.getSize("default_lining").height - - Label - { - text: catalog.i18nc("@label", "Printer Settings") - font.bold: true - } - - Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } - - Loader - { - id: buildAreaWidthField - sourceComponent: numericTextFieldWithUnit - property string settingKey: "machine_width" - property string label: catalog.i18nc("@label", "X (Width)") - property string unit: catalog.i18nc("@label", "mm") - property bool forceUpdateOnChange: true - } - - Loader - { - id: buildAreaDepthField - sourceComponent: numericTextFieldWithUnit - property string settingKey: "machine_depth" - property string label: catalog.i18nc("@label", "Y (Depth)") - property string unit: catalog.i18nc("@label", "mm") - property bool forceUpdateOnChange: true - } - - Loader - { - id: buildAreaHeightField - sourceComponent: numericTextFieldWithUnit - property string settingKey: "machine_height" - property string label: catalog.i18nc("@label", "Z (Height)") - property string unit: catalog.i18nc("@label", "mm") - property bool forceUpdateOnChange: true - } - - Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } - - Loader - { - id: shapeComboBox - sourceComponent: comboBoxWithOptions - property string settingKey: "machine_shape" - property string label: catalog.i18nc("@label", "Build plate shape") - property bool forceUpdateOnChange: true - } - - Loader - { - id: centerIsZeroCheckBox - sourceComponent: simpleCheckBox - property string settingKey: "machine_center_is_zero" - property string label: catalog.i18nc("@option:check", "Origin at center") - property bool forceUpdateOnChange: true - } - Loader - { - id: heatedBedCheckBox - sourceComponent: simpleCheckBox - property var settingKey: "machine_heated_bed" - property string label: catalog.i18nc("@option:check", "Heated bed") - property bool forceUpdateOnChange: true - } - - Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } - - Loader - { - id: gcodeFlavorComboBox - sourceComponent: comboBoxWithOptions - property string settingKey: "machine_gcode_flavor" - property string label: catalog.i18nc("@label", "G-code flavor") - property bool forceUpdateOnChange: true - property var afterOnActivate: manager.updateHasMaterialsMetadata - } - } - - Column - { - width: settingsTabs.columnWidth - spacing: UM.Theme.getSize("default_lining").height - - Label - { - text: catalog.i18nc("@label", "Printhead Settings") - font.bold: true - } - - Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } - - Loader - { - id: printheadXMinField - sourceComponent: headPolygonTextField - property string label: catalog.i18nc("@label", "X min") - property string tooltip: catalog.i18nc("@tooltip", "Distance from the left of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".") - property string axis: "x" - property string side: "min" - } - - Loader - { - id: printheadYMinField - sourceComponent: headPolygonTextField - property string label: catalog.i18nc("@label", "Y min") - property string tooltip: catalog.i18nc("@tooltip", "Distance from the front of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".") - property string axis: "y" - property string side: "min" - } - - Loader - { - id: printheadXMaxField - sourceComponent: headPolygonTextField - property string label: catalog.i18nc("@label", "X max") - property string tooltip: catalog.i18nc("@tooltip", "Distance from the right of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".") - property string axis: "x" - property string side: "max" - } - - Loader - { - id: printheadYMaxField - sourceComponent: headPolygonTextField - property string label: catalog.i18nc("@label", "Y max") - property string tooltip: catalog.i18nc("@tooltip", "Distance from the rear of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".") - property string axis: "y" - property string side: "max" - } - - Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } - - Loader - { - id: gantryHeightField - sourceComponent: numericTextFieldWithUnit - property string settingKey: "gantry_height" - property string label: catalog.i18nc("@label", "Gantry height") - property string unit: catalog.i18nc("@label", "mm") - property string tooltip: catalog.i18nc("@tooltip", "The height difference between the tip of the nozzle and the gantry system (X and Y axes). Used to prevent collisions between previous prints and the gantry when printing \"One at a Time\".") - property bool forceUpdateOnChange: true - } - - Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } - - UM.TooltipArea - { - height: childrenRect.height - width: childrenRect.width - text: machineExtruderCountProvider.properties.description - visible: extruderCountModel.count >= 2 - - Row - { - spacing: UM.Theme.getSize("default_margin").width - - Label - { - text: catalog.i18nc("@label", "Number of Extruders") - elide: Text.ElideRight - width: Math.max(0, settingsTabs.labelColumnWidth) - anchors.verticalCenter: extruderCountComboBox.verticalCenter - } - ComboBox - { - id: extruderCountComboBox - model: ListModel - { - id: extruderCountModel - Component.onCompleted: - { - for(var i = 0; i < manager.definedExtruderCount; i++) - { - extruderCountModel.append({text: String(i + 1), value: i}); - } - } - } - - Connections - { - target: manager - onDefinedExtruderCountChanged: - { - extruderCountModel.clear(); - for(var i = 0; i < manager.definedExtruderCount; ++i) - { - extruderCountModel.append({text: String(i + 1), value: i}); - } - } - } - - currentIndex: machineExtruderCountProvider.properties.value - 1 - onActivated: - { - manager.setMachineExtruderCount(index + 1); - } - } - } - } - } - } - - Row - { - spacing: UM.Theme.getSize("default_margin").width - anchors.left: parent.left - anchors.right: parent.right - height: parent.height - y - Column - { - height: parent.height - width: settingsTabs.columnWidth - Label - { - text: catalog.i18nc("@label", "Start G-code") - font.bold: true - } - Loader - { - id: machineStartGcodeField - sourceComponent: gcodeTextArea - property int areaWidth: parent.width - property int areaHeight: parent.height - y - property string settingKey: "machine_start_gcode" - property string tooltip: catalog.i18nc("@tooltip", "G-code commands to be executed at the very start.") - } - } - - Column { - height: parent.height - width: settingsTabs.columnWidth - Label - { - text: catalog.i18nc("@label", "End G-code") - font.bold: true - } - Loader - { - id: machineEndGcodeField - sourceComponent: gcodeTextArea - property int areaWidth: parent.width - property int areaHeight: parent.height - y - property string settingKey: "machine_end_gcode" - property string tooltip: catalog.i18nc("@tooltip", "G-code commands to be executed at the very end.") - } - } - } + text: model.name } } + } - onCurrentIndexChanged: + StackLayout + { + id: tabStack + anchors.top: tabBar.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + + width: parent.width + currentIndex: tabBar.currentIndex + + MachineSettingsPrinterTab { - if(currentIndex > 0) - { - contentItem.forceActiveFocus(); - } + id: printerTab } Repeater { - id: extruderTabsRepeater - model: base.extruderTabsCount - - Tab + model: extrudersModel + delegate: MachineSettingsExtruderTab { - title: base.extrudersModel.getItem(index).name - anchors.margins: UM.Theme.getSize("default_margin").width - - Column - { - spacing: UM.Theme.getSize("default_lining").width - - Label - { - text: catalog.i18nc("@label", "Nozzle Settings") - font.bold: true - } - - Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } - - Loader - { - id: extruderNozzleSizeField - visible: !Cura.MachineManager.hasVariants - sourceComponent: numericTextFieldWithUnit - property string settingKey: "machine_nozzle_size" - property string label: catalog.i18nc("@label", "Nozzle size") - property string unit: catalog.i18nc("@label", "mm") - function afterOnEditingFinished() - { - // Somehow the machine_nozzle_size dependent settings are not updated otherwise - Cura.MachineManager.forceUpdateAllSettings() - } - property bool isExtruderSetting: true - } - - Loader - { - id: materialDiameterField - visible: Cura.MachineManager.hasMaterials - sourceComponent: numericTextFieldWithUnit - property string settingKey: "material_diameter" - property string label: catalog.i18nc("@label", "Compatible material diameter") - property string unit: catalog.i18nc("@label", "mm") - property string tooltip: catalog.i18nc("@tooltip", "The nominal diameter of filament supported by the printer. The exact diameter will be overridden by the material and/or the profile.") - function afterOnEditingFinished() - { - if (settingsTabs.currentIndex > 0) - { - manager.updateMaterialForDiameter(settingsTabs.currentIndex - 1) - } - } - function setValueFunction(value) - { - if (settingsTabs.currentIndex > 0) - { - const extruderIndex = index.toString() - Cura.MachineManager.activeMachine.extruders[extruderIndex].compatibleMaterialDiameter = value - } - } - property bool isExtruderSetting: true - } - - Loader - { - id: extruderOffsetXField - sourceComponent: numericTextFieldWithUnit - property string settingKey: "machine_nozzle_offset_x" - property string label: catalog.i18nc("@label", "Nozzle offset X") - property string unit: catalog.i18nc("@label", "mm") - property bool isExtruderSetting: true - property bool forceUpdateOnChange: true - property bool allowNegative: true - } - - Loader - { - id: extruderOffsetYField - sourceComponent: numericTextFieldWithUnit - property string settingKey: "machine_nozzle_offset_y" - property string label: catalog.i18nc("@label", "Nozzle offset Y") - property string unit: catalog.i18nc("@label", "mm") - property bool isExtruderSetting: true - property bool forceUpdateOnChange: true - property bool allowNegative: true - } - - Loader - { - id: extruderCoolingFanNumberField - sourceComponent: numericTextFieldWithUnit - property string settingKey: "machine_extruder_cooling_fan_number" - property string label: catalog.i18nc("@label", "Cooling Fan Number") - property string unit: catalog.i18nc("@label", "") - property bool isExtruderSetting: true - property bool forceUpdateOnChange: true - property bool allowNegative: false - } - - Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } - - Row - { - spacing: UM.Theme.getSize("default_margin").width - anchors.left: parent.left - anchors.right: parent.right - height: parent.height - y - Column - { - height: parent.height - width: settingsTabs.columnWidth - Label - { - text: catalog.i18nc("@label", "Extruder Start G-code") - font.bold: true - } - Loader - { - id: extruderStartGcodeField - sourceComponent: gcodeTextArea - property int areaWidth: parent.width - property int areaHeight: parent.height - y - property string settingKey: "machine_extruder_start_code" - property bool isExtruderSetting: true - } - } - Column { - height: parent.height - width: settingsTabs.columnWidth - Label - { - text: catalog.i18nc("@label", "Extruder End G-code") - font.bold: true - } - Loader - { - id: extruderEndGcodeField - sourceComponent: gcodeTextArea - property int areaWidth: parent.width - property int areaHeight: parent.height - y - property string settingKey: "machine_extruder_end_code" - property bool isExtruderSetting: true - } - } - } - } + id: discoverTab + extruderPosition: model.index + extruderStackId: model.id } } } } - - Component - { - id: simpleCheckBox - UM.TooltipArea - { - height: checkBox.height - width: checkBox.width - text: _tooltip - - property bool _isExtruderSetting: (typeof(isExtruderSetting) === 'undefined') ? false: isExtruderSetting - property bool _forceUpdateOnChange: (typeof(forceUpdateOnChange) === 'undefined') ? false: forceUpdateOnChange - property string _tooltip: (typeof(tooltip) === 'undefined') ? propertyProvider.properties.description : tooltip - - UM.SettingPropertyProvider - { - id: propertyProvider - - containerStackId: { - if(_isExtruderSetting) - { - if(settingsTabs.currentIndex > 0) - { - return Cura.ExtruderManager.extruderIds[String(settingsTabs.currentIndex - 1)]; - } - return ""; - } - return base.activeMachineId - } - key: settingKey - watchedProperties: [ "value", "description" ] - storeIndex: manager.containerIndex - } - - CheckBox - { - id: checkBox - text: label - checked: String(propertyProvider.properties.value).toLowerCase() != 'false' - onClicked: - { - propertyProvider.setPropertyValue("value", checked); - if(_forceUpdateOnChange) - { - manager.forceUpdate(); - } - } - } - } - } - - Component - { - id: numericTextFieldWithUnit - UM.TooltipArea - { - height: childrenRect.height - width: childrenRect.width - text: _tooltip - - property bool _isExtruderSetting: (typeof(isExtruderSetting) === 'undefined') ? false: isExtruderSetting - property bool _allowNegative: (typeof(allowNegative) === 'undefined') ? false : allowNegative - property var _afterOnEditingFinished: (typeof(afterOnEditingFinished) === 'undefined') ? undefined : afterOnEditingFinished - property bool _forceUpdateOnChange: (typeof(forceUpdateOnChange) === 'undefined') ? false : forceUpdateOnChange - property string _label: (typeof(label) === 'undefined') ? "" : label - property string _tooltip: (typeof(tooltip) === 'undefined') ? propertyProvider.properties.description : tooltip - property var _setValueFunction: (typeof(setValueFunction) === 'undefined') ? undefined : setValueFunction - - UM.SettingPropertyProvider - { - id: propertyProvider - - containerStackId: { - if(_isExtruderSetting) - { - if(settingsTabs.currentIndex > 0) - { - return Cura.ExtruderManager.extruderIds[String(settingsTabs.currentIndex - 1)]; - } - return ""; - } - return base.activeMachineId - } - key: settingKey - watchedProperties: [ "value", "description" ] - storeIndex: manager.containerIndex - } - - Row - { - spacing: UM.Theme.getSize("default_margin").width - - Label - { - text: _label - visible: _label != "" - elide: Text.ElideRight - width: Math.max(0, settingsTabs.labelColumnWidth) - anchors.verticalCenter: textFieldWithUnit.verticalCenter - } - - Item - { - width: textField.width - height: textField.height - - id: textFieldWithUnit - TextField - { - id: textField - text: { - const value = propertyProvider.properties.value; - return value ? value : ""; - } - validator: RegExpValidator { regExp: _allowNegative ? /-?[0-9\.,]{0,6}/ : /[0-9\.,]{0,6}/ } - onEditingFinished: - { - if (propertyProvider && text != propertyProvider.properties.value) - { - // For some properties like the extruder-compatible material diameter, they need to - // trigger many updates, such as the available materials, the current material may - // need to be switched, etc. Although setting the diameter can be done directly via - // the provider, all the updates that need to be triggered then need to depend on - // the metadata update, a signal that can be fired way too often. The update functions - // can have if-checks to filter out the irrelevant updates, but still it incurs unnecessary - // overhead. - // The ExtruderStack class has a dedicated function for this call "setCompatibleMaterialDiameter()", - // and it triggers the diameter update signals only when it is needed. Here it is optionally - // choose to use setCompatibleMaterialDiameter() or other more specific functions that - // are available. - if (_setValueFunction !== undefined) - { - _setValueFunction(text) - } - else - { - propertyProvider.setPropertyValue("value", text) - } - if(_forceUpdateOnChange) - { - manager.forceUpdate() - } - if(_afterOnEditingFinished) - { - _afterOnEditingFinished() - } - } - } - } - - Label - { - text: unit - anchors.right: textField.right - anchors.rightMargin: y - textField.y - anchors.verticalCenter: textField.verticalCenter - } - } - } - } - } - - Component - { - id: comboBoxWithOptions - UM.TooltipArea - { - height: childrenRect.height - width: childrenRect.width - text: _tooltip - - property bool _isExtruderSetting: (typeof(isExtruderSetting) === 'undefined') ? false : isExtruderSetting - property bool _forceUpdateOnChange: (typeof(forceUpdateOnChange) === 'undefined') ? false : forceUpdateOnChange - property var _afterOnActivate: (typeof(afterOnActivate) === 'undefined') ? undefined : afterOnActivate - property string _label: (typeof(label) === 'undefined') ? "" : label - property string _tooltip: (typeof(tooltip) === 'undefined') ? propertyProvider.properties.description : tooltip - - UM.SettingPropertyProvider - { - id: propertyProvider - - containerStackId: { - if(_isExtruderSetting) - { - if(settingsTabs.currentIndex > 0) - { - return Cura.ExtruderManager.extruderIds[String(settingsTabs.currentIndex - 1)]; - } - return ""; - } - return base.activeMachineId - } - key: settingKey - watchedProperties: [ "value", "options", "description" ] - storeIndex: manager.containerIndex - } - - Row - { - spacing: UM.Theme.getSize("default_margin").width - - Label - { - text: _label - visible: _label != "" - elide: Text.ElideRight - width: Math.max(0, settingsTabs.labelColumnWidth) - anchors.verticalCenter: comboBox.verticalCenter - } - ComboBox - { - id: comboBox - model: ListModel - { - id: optionsModel - Component.onCompleted: - { - // Options come in as a string-representation of an OrderedDict - var options = propertyProvider.properties.options.match(/^OrderedDict\(\[\((.*)\)\]\)$/); - if(options) - { - options = options[1].split("), (") - for(var i = 0; i < options.length; i++) - { - var option = options[i].substring(1, options[i].length - 1).split("', '") - optionsModel.append({text: option[1], value: option[0]}); - } - } - } - } - currentIndex: - { - var currentValue = propertyProvider.properties.value; - var index = 0; - for(var i = 0; i < optionsModel.count; i++) - { - if(optionsModel.get(i).value == currentValue) { - index = i; - break; - } - } - return index - } - onActivated: - { - if(propertyProvider.properties.value != optionsModel.get(index).value) - { - propertyProvider.setPropertyValue("value", optionsModel.get(index).value); - if(_forceUpdateOnChange) - { - manager.forceUpdate(); - } - if(_afterOnActivate) - { - _afterOnActivate(); - } - } - } - } - } - } - } - - Component - { - id: gcodeTextArea - - UM.TooltipArea - { - height: gcodeArea.height - width: gcodeArea.width - text: _tooltip - - property bool _isExtruderSetting: (typeof(isExtruderSetting) === 'undefined') ? false : isExtruderSetting - property string _tooltip: (typeof(tooltip) === 'undefined') ? propertyProvider.properties.description : tooltip - - UM.SettingPropertyProvider - { - id: propertyProvider - - containerStackId: { - if(_isExtruderSetting) - { - if(settingsTabs.currentIndex > 0) - { - return Cura.ExtruderManager.extruderIds[String(settingsTabs.currentIndex - 1)]; - } - return ""; - } - return base.activeMachineId - } - key: settingKey - watchedProperties: [ "value", "description" ] - storeIndex: manager.containerIndex - } - - TextArea - { - id: gcodeArea - width: areaWidth - height: areaHeight - font: UM.Theme.getFont("fixed") - text: (propertyProvider.properties.value) ? propertyProvider.properties.value : "" - onActiveFocusChanged: - { - if(!activeFocus) - { - propertyProvider.setPropertyValue("value", gcodeArea.text) - } - } - Component.onCompleted: - { - wrapMode = TextEdit.NoWrap; - } - } - } - } - - Component - { - id: headPolygonTextField - UM.TooltipArea - { - height: textField.height - width: textField.width - text: tooltip - - property string _label: (typeof(label) === 'undefined') ? "" : label - - Row - { - spacing: UM.Theme.getSize("default_margin").width - - Label - { - text: _label - visible: _label != "" - elide: Text.ElideRight - width: Math.max(0, settingsTabs.labelColumnWidth) - anchors.verticalCenter: textFieldWithUnit.verticalCenter - } - - Item - { - id: textFieldWithUnit - width: textField.width - height: textField.height - - TextField - { - id: textField - text: - { - var polygon = JSON.parse(machineHeadPolygonProvider.properties.value); - var item = (axis == "x") ? 0 : 1 - var result = polygon[0][item]; - for(var i = 1; i < polygon.length; i++) { - if (side == "min") { - result = Math.min(result, polygon[i][item]); - } else { - result = Math.max(result, polygon[i][item]); - } - } - result = Math.abs(result); - printHeadPolygon[axis][side] = result; - return result; - } - validator: RegExpValidator { regExp: /[0-9\.,]{0,6}/ } - onEditingFinished: - { - printHeadPolygon[axis][side] = parseFloat(textField.text.replace(',','.')); - var polygon = []; - polygon.push([-printHeadPolygon["x"]["min"], printHeadPolygon["y"]["max"]]); - polygon.push([-printHeadPolygon["x"]["min"],-printHeadPolygon["y"]["min"]]); - polygon.push([ printHeadPolygon["x"]["max"], printHeadPolygon["y"]["max"]]); - polygon.push([ printHeadPolygon["x"]["max"],-printHeadPolygon["y"]["min"]]); - var polygon_string = JSON.stringify(polygon); - if(polygon_string != machineHeadPolygonProvider.properties.value) - { - machineHeadPolygonProvider.setPropertyValue("value", polygon_string); - manager.forceUpdate(); - } - } - } - - Label - { - text: catalog.i18nc("@label", "mm") - anchors.right: textField.right - anchors.rightMargin: y - textField.y - anchors.verticalCenter: textField.verticalCenter - } - } - } - } - } - - property var printHeadPolygon: - { - "x": { - "min": 0, - "max": 0, - }, - "y": { - "min": 0, - "max": 0, - }, - } - - - UM.SettingPropertyProvider - { - id: machineExtruderCountProvider - - containerStackId: base.activeMachineId - key: "machine_extruder_count" - watchedProperties: [ "value", "description" ] - storeIndex: manager.containerIndex - } - - UM.SettingPropertyProvider - { - id: machineHeadPolygonProvider - - containerStackId: base.activeMachineId - key: "machine_head_with_fans_polygon" - watchedProperties: [ "value" ] - storeIndex: manager.containerIndex - } } diff --git a/resources/qml/WelcomePages/MachineSettingsExtruderTab.qml b/plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml similarity index 93% rename from resources/qml/WelcomePages/MachineSettingsExtruderTab.qml rename to plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml index 3ed82a6dde..270bd7e828 100644 --- a/resources/qml/WelcomePages/MachineSettingsExtruderTab.qml +++ b/plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml @@ -7,13 +7,10 @@ import QtQuick.Controls 2.3 import UM 1.3 as UM import Cura 1.1 as Cura -import "../MachineSettings" - // // This component contains the content for the "Welcome" page of the welcome on-boarding process. // - Item { id: base @@ -68,7 +65,7 @@ Item renderType: Text.NativeRendering } - NumericTextFieldWithUnit // "Nozzle size" + Cura.NumericTextFieldWithUnit // "Nozzle size" { id: extruderNozzleSizeField visible: !Cura.MachineManager.hasVariants @@ -83,7 +80,7 @@ Item forceUpdateOnChangeFunction: forceUpdateFunction } - NumericTextFieldWithUnit // "Compatible material diameter" + Cura.NumericTextFieldWithUnit // "Compatible material diameter" { id: extruderCompatibleMaterialDiameterField containerStackId: base.extruderStackId @@ -99,7 +96,7 @@ Item afterOnEditingFinishedFunction: updateMaterialDiameter } - NumericTextFieldWithUnit // "Nozzle offset X" + Cura.NumericTextFieldWithUnit // "Nozzle offset X" { id: extruderNozzleOffsetXField containerStackId: base.extruderStackId @@ -113,7 +110,7 @@ Item forceUpdateOnChangeFunction: forceUpdateFunction } - NumericTextFieldWithUnit // "Nozzle offset Y" + Cura.NumericTextFieldWithUnit // "Nozzle offset Y" { id: extruderNozzleOffsetYField containerStackId: base.extruderStackId @@ -127,7 +124,7 @@ Item forceUpdateOnChangeFunction: forceUpdateFunction } - NumericTextFieldWithUnit // "Cooling Fan Number" + Cura.NumericTextFieldWithUnit // "Cooling Fan Number" { id: extruderNozzleCoolingFanNumberField containerStackId: base.extruderStackId @@ -152,7 +149,7 @@ Item anchors.right: parent.right anchors.margins: UM.Theme.getSize("default_margin").width - GcodeTextArea // "Extruder Start G-code" + Cura.GcodeTextArea // "Extruder Start G-code" { anchors.top: parent.top anchors.bottom: parent.bottom @@ -166,7 +163,7 @@ Item settingStoreIndex: propertyStoreIndex } - GcodeTextArea // "Extruder End G-code" + Cura.GcodeTextArea // "Extruder End G-code" { anchors.top: parent.top anchors.bottom: parent.bottom diff --git a/resources/qml/WelcomePages/MachineSettingsPrinterTab.qml b/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml similarity index 89% rename from resources/qml/WelcomePages/MachineSettingsPrinterTab.qml rename to plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml index 6971ab74db..c952e4cfb3 100644 --- a/resources/qml/WelcomePages/MachineSettingsPrinterTab.qml +++ b/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml @@ -7,8 +7,6 @@ import QtQuick.Controls 2.3 import UM 1.3 as UM import Cura 1.1 as Cura -import "../MachineSettings" - // // This the content in the "Printer" tab in the Machine Settings dialog. @@ -62,7 +60,7 @@ Item renderType: Text.NativeRendering } - NumericTextFieldWithUnit // "X (Width)" + Cura.NumericTextFieldWithUnit // "X (Width)" { id: machineXWidthField containerStackId: machineStackId @@ -76,7 +74,7 @@ Item forceUpdateOnChangeFunction: forceUpdateFunction } - NumericTextFieldWithUnit // "Y (Depth)" + Cura.NumericTextFieldWithUnit // "Y (Depth)" { id: machineYDepthField containerStackId: machineStackId @@ -90,7 +88,7 @@ Item forceUpdateOnChangeFunction: forceUpdateFunction } - NumericTextFieldWithUnit // "Z (Height)" + Cura.NumericTextFieldWithUnit // "Z (Height)" { id: machineZHeightField containerStackId: machineStackId @@ -104,7 +102,7 @@ Item forceUpdateOnChangeFunction: forceUpdateFunction } - ComboBoxWithOptions // "Build plate shape" + Cura.ComboBoxWithOptions // "Build plate shape" { id: buildPlateShapeComboBox containerStackId: machineStackId @@ -117,7 +115,7 @@ Item forceUpdateOnChangeFunction: forceUpdateFunction } - SimpleCheckBox // "Origin at center" + Cura.SimpleCheckBox // "Origin at center" { id: originAtCenterCheckBox containerStackId: machineStackId @@ -129,7 +127,7 @@ Item forceUpdateOnChangeFunction: forceUpdateFunction } - SimpleCheckBox // "Heated bed" + Cura.SimpleCheckBox // "Heated bed" { id: heatedBedCheckBox containerStackId: machineStackId @@ -141,7 +139,7 @@ Item forceUpdateOnChangeFunction: forceUpdateFunction } - ComboBoxWithOptions // "G-code flavor" + Cura.ComboBoxWithOptions // "G-code flavor" { id: gcodeFlavorComboBox containerStackId: machineStackId @@ -177,7 +175,7 @@ Item renderType: Text.NativeRendering } - PrintHeadMinMaxTextField // "X min" + Cura.PrintHeadMinMaxTextField // "X min" { id: machineXMinField @@ -195,7 +193,7 @@ Item forceUpdateOnChangeFunction: forceUpdateFunction } - PrintHeadMinMaxTextField // "Y min" + Cura.PrintHeadMinMaxTextField // "Y min" { id: machineYMinField @@ -213,7 +211,7 @@ Item forceUpdateOnChangeFunction: forceUpdateFunction } - PrintHeadMinMaxTextField // "X max" + Cura.PrintHeadMinMaxTextField // "X max" { id: machineXMaxField @@ -231,7 +229,7 @@ Item forceUpdateOnChangeFunction: forceUpdateFunction } - PrintHeadMinMaxTextField // "Y max" + Cura.PrintHeadMinMaxTextField // "Y max" { id: machineYMaxField @@ -251,7 +249,7 @@ Item forceUpdateOnChangeFunction: forceUpdateFunction } - NumericTextFieldWithUnit // "Gantry Height" + Cura.NumericTextFieldWithUnit // "Gantry Height" { id: machineGantryHeightField containerStackId: machineStackId @@ -265,7 +263,7 @@ Item forceUpdateOnChangeFunction: forceUpdateFunction } - ComboBoxWithOptions // "Number of Extruders" + Cura.ComboBoxWithOptions // "Number of Extruders" { id: numberOfExtrudersComboBox containerStackId: machineStackId @@ -280,6 +278,7 @@ Item // This has something to do with UM2 and UM2+ regarding "has_material" and the gcode flavor settings. // I don't remember exactly what. afterOnEditingFinishedFunction: CuraApplication.getMachineSettingsManager().updateHasMaterialsMetadata + setValueFunction: CuraApplication.getMachineSettingsManager().setMachineExtruderCount optionModel: ListModel { @@ -289,7 +288,10 @@ Item extruderCountModel.clear() for (var i = 1; i <= Cura.MachineManager.activeMachine.maxExtruderCount; i++) { - extruderCountModel.append({text: String(i), value: i}) + // Use String as value. JavaScript only has Number. PropertyProvider.setPropertyValue() + // takes a QVariant as value, and Number gets translated into a float. This will cause problem + // for integer settings such as "Number of Extruders". + extruderCountModel.append({ text: String(i), value: String(i) }) } } } @@ -306,7 +308,7 @@ Item anchors.right: parent.right anchors.margins: UM.Theme.getSize("default_margin").width - GcodeTextArea // "Start G-code" + Cura.GcodeTextArea // "Start G-code" { anchors.top: parent.top anchors.bottom: parent.bottom @@ -320,7 +322,7 @@ Item settingStoreIndex: propertyStoreIndex } - GcodeTextArea // "End G-code" + Cura.GcodeTextArea // "End G-code" { anchors.top: parent.top anchors.bottom: parent.bottom diff --git a/resources/qml/MachineSettings/ComboBoxWithOptions.qml b/resources/qml/MachineSettings/ComboBoxWithOptions.qml index 6abc2bde22..012e36817b 100644 --- a/resources/qml/MachineSettings/ComboBoxWithOptions.qml +++ b/resources/qml/MachineSettings/ComboBoxWithOptions.qml @@ -41,6 +41,7 @@ UM.TooltipArea // callback functions property var forceUpdateOnChangeFunction: dummy_func property var afterOnEditingFinishedFunction: dummy_func + property var setValueFunction: null // a dummy function for default property values function dummy_func() {} @@ -76,7 +77,7 @@ UM.TooltipArea for (var i = 0; i < options.length; i++) { var option = options[i].substring(1, options[i].length - 1).split("', '") - append({text: option[1], value: option[0]}) + append({ text: option[1], value: option[0] }) } } } @@ -118,9 +119,17 @@ UM.TooltipArea onActivated: { - if (propertyProvider.properties.value != model.get(index).value) + var newValue = model.get(index).value + if (propertyProvider.properties.value != newValue) { - propertyProvider.setPropertyValue("value", model.get(index).value) + if (setValueFunction !== null) + { + setValueFunction(newValue) + } + else + { + propertyProvider.setPropertyValue("value", newValue) + } forceUpdateOnChangeFunction() afterOnEditingFinishedFunction() } diff --git a/resources/qml/MachineSettings/MachineSettingsContent.qml b/resources/qml/MachineSettings/MachineSettingsContent.qml deleted file mode 100644 index daa41d4c5d..0000000000 --- a/resources/qml/MachineSettings/MachineSettingsContent.qml +++ /dev/null @@ -1,55 +0,0 @@ -import QtQuick 2.10 -import QtQuick.Controls 2.3 -import QtQuick.Layouts 1.3 - - -Item -{ - id: base - anchors.fill: parent - - TabBar - { - id: bar - width: parent.width - TabButton - { - text: "Printer" - } - - Repeater - { - id: extrudersTabsRepeater - model: ["Extruder 1", "Extruder 2", "Extruder 3"] - - TabButton - { - text: modelData - } - } - } - - StackLayout - { - width: parent.width - currentIndex: bar.currentIndex - Item - { - id: printerTab - } - Repeater - { - model: ["Extruder 1", "Extruder 2", "Extruder 3"] - Item - { - anchors.centerIn: parent - - Label // TODO: this is a dummy - { - anchors.centerIn: parent - text: modelData - } - } - } - } -} diff --git a/resources/qml/MachineSettings/PolygonTextField.qml b/resources/qml/MachineSettings/PolygonTextField.qml deleted file mode 100644 index 59664b9f23..0000000000 --- a/resources/qml/MachineSettings/PolygonTextField.qml +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) 2019 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.10 -import QtQuick.Controls 2.3 -import QtQuick.Layouts 1.3 - -import UM 1.3 as UM -import Cura 1.1 as Cura - - -// -// TextField for editing polygon data in the Machine Settings dialog. -// -UM.TooltipArea -{ - UM.I18nCatalog { id: catalog; name: "cura"; } - - height: textField.height - width: textField.width - text: tooltip - - property alias containerStackId: propertyProvider.containerStackId - property alias settingKey: propertyProvider.key - property alias settingStoreIndex: propertyProvider.storeIndex - - property alias labelText: fieldLabel.text - property alias labelWidth: fieldLabel.width - property string unitText: catalog.i18nc("@label", "mm") - - // callback functions - property var forceUpdateOnChangeFunction: dummy_func - - // a dummy function for default property values - function dummy_func() {} - - property var printHeadPolygon: - { - "x": { - "min": 0, - "max": 0, - }, - "y": { - "min": 0, - "max": 0, - }, - } - - UM.SettingPropertyProvider - { - id: propertyProvider - watchedProperties: [ "value" ] - } - - Row - { - spacing: UM.Theme.getSize("default_margin").width - - Label - { - id: fieldLabel - anchors.verticalCenter: textFieldWithUnit.verticalCenter - visible: text != "" - elide: Text.ElideRight - //width: Math.max(0, settingsTabs.labelColumnWidth) - } - - Item - { - id: textFieldWithUnit - width: textField.width - height: textField.height - - TextField - { - id: textField - text: - { - var polygon = JSON.parse(propertyProvider.properties.value) - var item = (axis == "x") ? 0 : 1 - var result = polygon[0][item] - for (var i = 1; i < polygon.length; i++) { - result = (side == "min") - ? Math.min(result, polygon[i][item]) - : Math.max(result, polygon[i][item]) - } - result = Math.abs(result) - printHeadPolygon[axis][side] = result - return result - } - validator: RegExpValidator { regExp: /[0-9\.,]{0,6}/ } - onEditingFinished: - { - printHeadPolygon[axis][side] = parseFloat(textField.text.replace(',','.')) - var polygon = [ - [-printHeadPolygon["x"]["min"], printHeadPolygon["y"]["max"]], - [-printHeadPolygon["x"]["min"], -printHeadPolygon["y"]["min"]], - [ printHeadPolygon["x"]["max"], printHeadPolygon["y"]["max"]], - [ printHeadPolygon["x"]["max"], -printHeadPolygon["y"]["min"]] - ] - var polygon_string = JSON.stringify(polygon) - if (polygon_string != propertyProvider.properties.value) - { - propertyProvider.setPropertyValue("value", polygon_string) - forceUpdateOnChangeFunction() - } - } - } - - Label - { - id: unitLabel - text: unitText - anchors.right: textField.right - anchors.rightMargin: y - textField.y - anchors.verticalCenter: textField.verticalCenter - } - } - } -} diff --git a/resources/qml/MachineSettings/PrintSetupContent.qml b/resources/qml/MachineSettings/PrintSetupContent.qml deleted file mode 100644 index d2469ff71d..0000000000 --- a/resources/qml/MachineSettings/PrintSetupContent.qml +++ /dev/null @@ -1,272 +0,0 @@ -import QtQuick 2.10 -import QtQuick.Controls 2.3 -import QtQuick.Layouts 1.3 - - -Column -{ - spacing: UM.Theme.getSize("default_margin").height - - Row - { - width: parent.width - spacing: UM.Theme.getSize("default_margin").height - - Column - { - width: settingsTabs.columnWidth - spacing: UM.Theme.getSize("default_lining").height - - Label - { - text: catalog.i18nc("@label", "Printer Settings") - font.bold: true - renderType: Text.NativeRendering - } - - Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } - - Loader - { - id: buildAreaWidthField - sourceComponent: numericTextFieldWithUnit - property string settingKey: "machine_width" - property string label: catalog.i18nc("@label", "X (Width)") - property string unit: catalog.i18nc("@label", "mm") - property bool forceUpdateOnChange: true - } - - Loader - { - id: buildAreaDepthField - sourceComponent: numericTextFieldWithUnit - property string settingKey: "machine_depth" - property string label: catalog.i18nc("@label", "Y (Depth)") - property string unit: catalog.i18nc("@label", "mm") - property bool forceUpdateOnChange: true - } - - Loader - { - id: buildAreaHeightField - sourceComponent: numericTextFieldWithUnit - property string settingKey: "machine_height" - property string label: catalog.i18nc("@label", "Z (Height)") - property string unit: catalog.i18nc("@label", "mm") - property bool forceUpdateOnChange: true - } - - Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } - - Loader - { - id: shapeComboBox - sourceComponent: comboBoxWithOptions - property string settingKey: "machine_shape" - property string label: catalog.i18nc("@label", "Build plate shape") - property bool forceUpdateOnChange: true - } - - Loader - { - id: centerIsZeroCheckBox - sourceComponent: simpleCheckBox - property string settingKey: "machine_center_is_zero" - property string label: catalog.i18nc("@option:check", "Origin at center") - property bool forceUpdateOnChange: true - } - Loader - { - id: heatedBedCheckBox - sourceComponent: simpleCheckBox - property var settingKey: "machine_heated_bed" - property string label: catalog.i18nc("@option:check", "Heated bed") - property bool forceUpdateOnChange: true - } - - Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } - - Loader - { - id: gcodeFlavorComboBox - sourceComponent: comboBoxWithOptions - property string settingKey: "machine_gcode_flavor" - property string label: catalog.i18nc("@label", "G-code flavor") - property bool forceUpdateOnChange: true - property var afterOnActivate: manager.updateHasMaterialsMetadata - } - } - - Column - { - width: settingsTabs.columnWidth - spacing: UM.Theme.getSize("default_lining").height - - Label - { - text: catalog.i18nc("@label", "Printhead Settings") - font.bold: true - renderType: Text.NativeRendering - } - - Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } - - Loader - { - id: printheadXMinField - sourceComponent: headPolygonTextField - property string label: catalog.i18nc("@label", "X min") - property string tooltip: catalog.i18nc("@tooltip", "Distance from the left of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".") - property string axis: "x" - property string side: "min" - } - - Loader - { - id: printheadYMinField - sourceComponent: headPolygonTextField - property string label: catalog.i18nc("@label", "Y min") - property string tooltip: catalog.i18nc("@tooltip", "Distance from the front of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".") - property string axis: "y" - property string side: "min" - } - - Loader - { - id: printheadXMaxField - sourceComponent: headPolygonTextField - property string label: catalog.i18nc("@label", "X max") - property string tooltip: catalog.i18nc("@tooltip", "Distance from the right of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".") - property string axis: "x" - property string side: "max" - } - - Loader - { - id: printheadYMaxField - sourceComponent: headPolygonTextField - property string label: catalog.i18nc("@label", "Y max") - property string tooltip: catalog.i18nc("@tooltip", "Distance from the rear of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".") - property string axis: "y" - property string side: "max" - } - - Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } - - Loader - { - id: gantryHeightField - sourceComponent: numericTextFieldWithUnit - property string settingKey: "gantry_height" - property string label: catalog.i18nc("@label", "Gantry height") - property string unit: catalog.i18nc("@label", "mm") - property string tooltip: catalog.i18nc("@tooltip", "The height difference between the tip of the nozzle and the gantry system (X and Y axes). Used to prevent collisions between previous prints and the gantry when printing \"One at a Time\".") - property bool forceUpdateOnChange: true - } - - Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height } - - UM.TooltipArea - { - height: childrenRect.height - width: childrenRect.width - text: machineExtruderCountProvider.properties.description - visible: extruderCountModel.count >= 2 - - Row - { - spacing: UM.Theme.getSize("default_margin").width - - Label - { - anchors.verticalCenter: extruderCountComboBox.verticalCenter - width: Math.max(0, settingsTabs.labelColumnWidth) - text: catalog.i18nc("@label", "Number of Extruders") - elide: Text.ElideRight - renderType: Text.NativeRendering - } - ComboBox - { - id: extruderCountComboBox - model: ListModel - { - id: extruderCountModel - Component.onCompleted: - { - for(var i = 0; i < manager.definedExtruderCount; i++) - { - extruderCountModel.append({text: String(i + 1), value: i}) - } - } - } - - Connections - { - target: manager - onDefinedExtruderCountChanged: - { - extruderCountModel.clear(); - for(var i = 0; i < manager.definedExtruderCount; ++i) - { - extruderCountModel.append({text: String(i + 1), value: i}); - } - } - } - - currentIndex: machineExtruderCountProvider.properties.value - 1 - onActivated: - { - manager.setMachineExtruderCount(index + 1); - } - } - } - } - } - } - - Row - { - spacing: UM.Theme.getSize("default_margin").width - anchors.left: parent.left - anchors.right: parent.right - height: parent.height - y - Column - { - height: parent.height - width: settingsTabs.columnWidth - Label - { - text: catalog.i18nc("@label", "Start G-code") - font.bold: true - } - Loader - { - id: machineStartGcodeField - sourceComponent: gcodeTextArea - property int areaWidth: parent.width - property int areaHeight: parent.height - y - property string settingKey: "machine_start_gcode" - property string tooltip: catalog.i18nc("@tooltip", "G-code commands to be executed at the very start.") - } - } - - Column { - height: parent.height - width: settingsTabs.columnWidth - Label - { - text: catalog.i18nc("@label", "End G-code") - font.bold: true - } - Loader - { - id: machineEndGcodeField - sourceComponent: gcodeTextArea - property int areaWidth: parent.width - property int areaHeight: parent.height - y - property string settingKey: "machine_end_gcode" - property string tooltip: catalog.i18nc("@tooltip", "G-code commands to be executed at the very end.") - } - } - } -} diff --git a/resources/qml/WelcomePages/AddPrinterBySelectionContent.qml b/resources/qml/WelcomePages/AddPrinterBySelectionContent.qml index 3282b219c9..faa2d259be 100644 --- a/resources/qml/WelcomePages/AddPrinterBySelectionContent.qml +++ b/resources/qml/WelcomePages/AddPrinterBySelectionContent.qml @@ -137,18 +137,18 @@ Item // Create a network printer const networkPrinterItem = addNetworkPrinterDropDown.contentItem.currentItem CuraApplication.getDiscoveredPrintersModel().createMachineFromDiscoveredPrinter(networkPrinterItem) + + // If we have created a machine, go to the last page, which is the "cloud" page. + base.gotoPage("cloud") } else { // Create a local printer const localPrinterItem = addLocalPrinterDropDown.contentItem.currentItem Cura.MachineManager.addMachine(localPrinterItem.id) + + base.gotoPage("machine_actions") } - - // TODO: implement machine actions - - // If we have created a machine, go to the last page, which is the "cloud" page. - base.gotoPage("cloud") } } } diff --git a/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml new file mode 100644 index 0000000000..84f5f5acac --- /dev/null +++ b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml @@ -0,0 +1,91 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 + +import UM 1.3 as UM +import Cura 1.1 as Cura + + +// +// This component contains the content for the "What's new in Ultimaker Cura" page of the welcome on-boarding process. +// +Item +{ + UM.I18nCatalog { id: catalog; name: "cura" } + + property var machineActionsModel: CuraApplication.getFirstStartMachineActionsModel() + + property int currentActionIndex: 0 + property var currentActionItem: currentActionIndex >= machineActionsModel.count + ? null : machineActionsModel.getItem(currentActionIndex) + property bool hasActions: machineActionsModel.count > 0 + + // Reset to the first page if the model gets changed. + Connections + { + target: machineActionsModel + onItemsChanged: currentActionIndex = 0 + } + + onVisibleChanged: + { + if (visible) + { + currentActionIndex = 0 + if (!hasActions) + { + base.showNextPage() + } + } + } + + Label + { + id: titleLabel + anchors.top: parent.top + anchors.topMargin: 40 + anchors.horizontalCenter: parent.horizontalCenter + horizontalAlignment: Text.AlignHCenter + text: currentActionItem.title + color: UM.Theme.getColor("primary_button") + font: UM.Theme.getFont("large_bold") + renderType: Text.NativeRendering + } + + Item + { + anchors.top: titleLabel.bottom + anchors.bottom: nextButton.top + anchors.topMargin: UM.Theme.getSize("default_margin").height + anchors.bottomMargin: UM.Theme.getSize("default_margin").height + anchors.left: parent.left + anchors.right: parent.right + + data: currentActionItem == undefined ? null : currentActionItem.content + } + + Cura.PrimaryButton + { + id: nextButton + anchors.right: parent.right + anchors.bottom: parent.bottom + anchors.margins: 40 + text: catalog.i18nc("@button", "Next") + width: 140 + fixedWidthMode: true + onClicked: + { + // If no more first-start actions to show, go to the next page. + if (currentActionIndex + 1 >= machineActionsModel.count) + { + currentActionIndex = 0 + base.showNextPage() + return + } + + currentActionIndex++ + } + } +} diff --git a/resources/qml/WelcomePages/StepPanel.qml b/resources/qml/WelcomePages/StepPanel.qml index bc99320e02..daca9bcb90 100644 --- a/resources/qml/WelcomePages/StepPanel.qml +++ b/resources/qml/WelcomePages/StepPanel.qml @@ -67,7 +67,7 @@ Item break } } - if (page_index > 0) + if (page_index >= 0) { currentStep = page_index } diff --git a/resources/qml/WelcomePages/TestContent.qml b/resources/qml/WelcomePages/TestContent.qml deleted file mode 100644 index 6071f965b2..0000000000 --- a/resources/qml/WelcomePages/TestContent.qml +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) 2019 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.10 -import QtQuick.Controls 2.3 -import QtQuick.Layouts 1.3 - -import UM 1.3 as UM -import Cura 1.1 as Cura - -import "../MachineSettings" -import "../Widgets" - - -// -// This component contains the content for the "Welcome" page of the welcome on-boarding process. -// - -Item -{ - id: base - UM.I18nCatalog { id: catalog; name: "cura" } - - anchors.fill: parent - anchors.margins: UM.Theme.getSize("default_margin").width - - property var extrudersModel: Cura.ExtrudersModel {} - - // If we create a CuraTabButton for "Printer" and use Repeater for extruders, for some reason, once the component - // finishes it will automatically change "currentIndex = 1", and it is VERY difficult to change "currentIndex = 0" - // after that. Using a model and a Repeater to create both "Printer" and extruder CuraTabButtons seem to solve this - // problem. - Connections - { - target: extrudersModel - onItemsChanged: tabNameModel.update() - } - - ListModel - { - id: tabNameModel - - Component.onCompleted: update() - - function update() - { - clear() - append({ name: catalog.i18nc("@title:tab", "Printer") }) - for (var i = 0; i < extrudersModel.count; i++) - { - const m = extrudersModel.getItem(i) - append({ name: m.name }) - } - } - } - - Rectangle - { - anchors.fill: parent - border.color: tabBar.visible ? UM.Theme.getColor("lining") : "transparent" - border.width: UM.Theme.getSize("default_lining").width - radius: UM.Theme.getSize("default_radius").width - - UM.TabRow - { - id: tabBar - width: parent.width - - Repeater - { - model: tabNameModel - delegate: CuraTabButton - { - text: model.name - } - } - } - - StackLayout - { - id: tabStack - anchors.top: tabBar.bottom - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - - width: parent.width - currentIndex: tabBar.currentIndex - - MachineSettingsPrinterTab - { - id: printerTab - } - - Repeater - { - model: extrudersModel - delegate: MachineSettingsExtruderTab - { - id: discoverTab - extruderPosition: model.index - extruderStackId: model.id - } - } - } - } -} diff --git a/resources/qml/qmldir b/resources/qml/qmldir index 62997cc27a..6de563e2a0 100644 --- a/resources/qml/qmldir +++ b/resources/qml/qmldir @@ -17,3 +17,20 @@ SettingView 1.0 SettingView.qml ProfileMenu 1.0 ProfileMenu.qml CheckBoxWithTooltip 1.0 CheckBoxWithTooltip.qml ToolTip 1.0 ToolTip.qml + + +# Cura/Widgets + +CuraCheckBox 1.0 CuraCheckBox.qml +CuraComboBox 1.0 CuraComboBox.qml +CuraProgressBar 1.0 CuraProgressBar.qml +CuraTabButton 1.0 CuraTabButton.qml + + +# Cura/MachineSettings + +ComboBoxWithOptions 1.0 ComboBoxWithOptions.qml +GcodeTextArea 1.0 GcodeTextArea.qml +NumericTextFieldWithUnit 1.0 NumericTextFieldWithUnit.qml +PrintHeadMinMaxTextField 1.0 PrintHeadMinMaxTextField.qml +SimpleCheckBox 1.0 SimpleCheckBox.qml From 3911c3d73d3d6eb6c46e574340fe32b7c4bafa1a Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 19 Mar 2019 14:47:21 +0100 Subject: [PATCH 16/33] WIP: Cleanup and unify MachineAction styles --- .../MachineSettingsAction.qml | 6 +-- .../BedLevelMachineAction.qml | 52 +++++++++++-------- .../UM2UpgradeSelection.py | 8 +-- .../UM2UpgradeSelectionMachineAction.qml | 38 ++++++-------- .../UMOUpgradeSelectionMachineAction.qml | 39 ++++++-------- .../qml/ActionPanel/SliceProcessWidget.qml | 4 +- .../MachineSettings/ComboBoxWithOptions.qml | 2 +- .../qml/MachineSettings/SimpleCheckBox.qml | 4 +- resources/qml/Settings/SettingComboBox.qml | 5 +- .../FirstStartMachineActionsContent.qml | 3 +- resources/qml/WelcomePages/StepPanel.qml | 4 +- .../{CuraCheckBox.qml => CheckBox.qml} | 2 +- .../{CuraComboBox.qml => ComboBox.qml} | 0 .../{CuraProgressBar.qml => ProgressBar.qml} | 0 .../{CuraTabButton.qml => TabButton.qml} | 0 resources/qml/qmldir | 8 +-- 16 files changed, 82 insertions(+), 93 deletions(-) rename resources/qml/Widgets/{CuraCheckBox.qml => CheckBox.qml} (97%) rename resources/qml/Widgets/{CuraComboBox.qml => ComboBox.qml} (100%) rename resources/qml/Widgets/{CuraProgressBar.qml => ProgressBar.qml} (100%) rename resources/qml/Widgets/{CuraTabButton.qml => TabButton.qml} (100%) diff --git a/plugins/MachineSettingsAction/MachineSettingsAction.qml b/plugins/MachineSettingsAction/MachineSettingsAction.qml index 28eb37e939..1521c38eaa 100644 --- a/plugins/MachineSettingsAction/MachineSettingsAction.qml +++ b/plugins/MachineSettingsAction/MachineSettingsAction.qml @@ -21,9 +21,9 @@ Cura.MachineAction property var extrudersModel: Cura.ExtrudersModel {} - // If we create a CuraTabButton for "Printer" and use Repeater for extruders, for some reason, once the component + // If we create a TabButton for "Printer" and use Repeater for extruders, for some reason, once the component // finishes it will automatically change "currentIndex = 1", and it is VERY difficult to change "currentIndex = 0" - // after that. Using a model and a Repeater to create both "Printer" and extruder CuraTabButtons seem to solve this + // after that. Using a model and a Repeater to create both "Printer" and extruder TabButtons seem to solve this // problem. Connections { @@ -64,7 +64,7 @@ Cura.MachineAction Repeater { model: tabNameModel - delegate: Cura.CuraTabButton + delegate: Cura.TabButton { text: model.name } diff --git a/plugins/UltimakerMachineActions/BedLevelMachineAction.qml b/plugins/UltimakerMachineActions/BedLevelMachineAction.qml index 262d5df376..dac545990f 100644 --- a/plugins/UltimakerMachineActions/BedLevelMachineAction.qml +++ b/plugins/UltimakerMachineActions/BedLevelMachineAction.qml @@ -1,24 +1,27 @@ -// Copyright (c) 2016 Ultimaker B.V. +// Copyright (c) 2019 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Layouts 1.1 -import QtQuick.Window 2.1 +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 -import UM 1.2 as UM -import Cura 1.0 as Cura +import UM 1.3 as UM +import Cura 1.1 as Cura Cura.MachineAction { - anchors.fill: parent; + UM.I18nCatalog { id: catalog; name: "cura"; } + + anchors.fill: parent + Item { id: bedLevelMachineAction - anchors.fill: parent; - - UM.I18nCatalog { id: catalog; name: "cura"; } + anchors.top: parent.top + anchors.topMargin: UM.Theme.getSize("default_margin").height * 3 + anchors.horizontalCenter: parent.horizontalCenter + width: parent.width * 3 / 4 Label { @@ -26,17 +29,21 @@ Cura.MachineAction width: parent.width text: catalog.i18nc("@title", "Build Plate Leveling") wrapMode: Text.WordWrap - font.pointSize: 18; + font.pointSize: 18 + renderType: Text.NativeRendering } + Label { id: pageDescription anchors.top: pageTitle.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height + anchors.topMargin: UM.Theme.getSize("default_margin").height * 3 width: parent.width wrapMode: Text.WordWrap text: catalog.i18nc("@label", "To make sure your prints will come out great, you can now adjust your buildplate. When you click 'Move to Next Position' the nozzle will move to the different positions that can be adjusted.") + renderType: Text.NativeRendering } + Label { id: bedlevelingText @@ -45,37 +52,38 @@ Cura.MachineAction width: parent.width wrapMode: Text.WordWrap text: catalog.i18nc("@label", "For every position; insert a piece of paper under the nozzle and adjust the print build plate height. The print build plate height is right when the paper is slightly gripped by the tip of the nozzle.") + renderType: Text.NativeRendering } Row { id: bedlevelingWrapper anchors.top: bedlevelingText.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height + anchors.topMargin: UM.Theme.getSize("default_margin").height * 3 anchors.horizontalCenter: parent.horizontalCenter width: childrenRect.width spacing: UM.Theme.getSize("default_margin").width - Button + Cura.ActionButton { id: startBedLevelingButton - text: catalog.i18nc("@action:button","Start Build Plate Leveling") + text: catalog.i18nc("@action:button", "Start Build Plate Leveling") onClicked: { - startBedLevelingButton.visible = false; - bedlevelingButton.visible = true; - manager.startBedLeveling(); + startBedLevelingButton.visible = false + bedlevelingButton.visible = true + manager.startBedLeveling() } } - Button + Cura.ActionButton { id: bedlevelingButton - text: catalog.i18nc("@action:button","Move to Next Position") + text: catalog.i18nc("@action:button", "Move to Next Position") visible: false onClicked: { - manager.moveToNextLevelPosition(); + manager.moveToNextLevelPosition() } } } diff --git a/plugins/UltimakerMachineActions/UM2UpgradeSelection.py b/plugins/UltimakerMachineActions/UM2UpgradeSelection.py index 6ff3f0b629..999cb1d35a 100644 --- a/plugins/UltimakerMachineActions/UM2UpgradeSelection.py +++ b/plugins/UltimakerMachineActions/UM2UpgradeSelection.py @@ -1,13 +1,15 @@ # Copyright (c) 2018 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. -from UM.Settings.ContainerRegistry import ContainerRegistry -from cura.MachineAction import MachineAction -from PyQt5.QtCore import pyqtSlot, pyqtSignal, pyqtProperty +from PyQt5.QtCore import pyqtSignal, pyqtProperty +from UM.Settings.ContainerRegistry import ContainerRegistry from UM.i18n import i18nCatalog from UM.Application import Application from UM.Util import parseBool + +from cura.MachineAction import MachineAction + catalog = i18nCatalog("cura") diff --git a/plugins/UltimakerMachineActions/UM2UpgradeSelectionMachineAction.qml b/plugins/UltimakerMachineActions/UM2UpgradeSelectionMachineAction.qml index 793f3f00a8..69023d3432 100644 --- a/plugins/UltimakerMachineActions/UM2UpgradeSelectionMachineAction.qml +++ b/plugins/UltimakerMachineActions/UM2UpgradeSelectionMachineAction.qml @@ -1,32 +1,24 @@ -// Copyright (c) 2016 Ultimaker B.V. +// Copyright (c) 2019 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Layouts 1.1 -import QtQuick.Window 2.1 +import QtQuick 2.10 +import QtQuick.Controls 2.3 -import UM 1.2 as UM -import Cura 1.0 as Cura +import UM 1.3 as UM +import Cura 1.1 as Cura Cura.MachineAction { - anchors.fill: parent; + UM.I18nCatalog { id: catalog; name: "cura"; } + anchors.fill: parent Item { id: upgradeSelectionMachineAction anchors.fill: parent - - Label - { - id: pageTitle - width: parent.width - text: catalog.i18nc("@title", "Select Printer Upgrades") - wrapMode: Text.WordWrap - font.pointSize: 18; - } + anchors.topMargin: UM.Theme.getSize("default_margin").width * 5 + anchors.leftMargin: UM.Theme.getSize("default_margin").width * 4 Label { @@ -35,15 +27,19 @@ Cura.MachineAction anchors.topMargin: UM.Theme.getSize("default_margin").height width: parent.width wrapMode: Text.WordWrap - text: catalog.i18nc("@label","Please select any upgrades made to this Ultimaker 2."); + text: catalog.i18nc("@label","Please select any upgrades made to this Ultimaker 2.") + font: UM.Theme.getFont("medium") + renderType: Text.NativeRendering } - CheckBox + Cura.CheckBox { id: olssonBlockCheckBox anchors.top: pageDescription.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height + height: UM.Theme.getSize("setting_control").height + text: catalog.i18nc("@label", "Olsson Block") checked: manager.hasVariants onClicked: manager.hasVariants = checked @@ -54,7 +50,5 @@ Cura.MachineAction onHasVariantsChanged: olssonBlockCheckBox.checked = manager.hasVariants } } - - UM.I18nCatalog { id: catalog; name: "cura"; } } -} \ No newline at end of file +} diff --git a/plugins/UltimakerMachineActions/UMOUpgradeSelectionMachineAction.qml b/plugins/UltimakerMachineActions/UMOUpgradeSelectionMachineAction.qml index 2b973ca1bb..b0abad0fcf 100644 --- a/plugins/UltimakerMachineActions/UMOUpgradeSelectionMachineAction.qml +++ b/plugins/UltimakerMachineActions/UMOUpgradeSelectionMachineAction.qml @@ -1,43 +1,38 @@ -// Copyright (c) 2016 Ultimaker B.V. +// Copyright (c) 2019 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Layouts 1.1 -import QtQuick.Window 2.1 +import QtQuick 2.10 +import QtQuick.Controls 2.3 -import UM 1.2 as UM -import Cura 1.0 as Cura +import UM 1.3 as UM +import Cura 1.1 as Cura Cura.MachineAction { - anchors.fill: parent; + UM.I18nCatalog { id: catalog; name: "cura"; } + anchors.fill: parent + Item { id: upgradeSelectionMachineAction anchors.fill: parent - - Label - { - id: pageTitle - width: parent.width - text: catalog.i18nc("@title", "Select Printer Upgrades") - wrapMode: Text.WordWrap - font.pointSize: 18; - } + anchors.topMargin: UM.Theme.getSize("default_margin").width * 5 + anchors.leftMargin: UM.Theme.getSize("default_margin").width * 4 Label { id: pageDescription - anchors.top: pageTitle.bottom + anchors.top: parent.top anchors.topMargin: UM.Theme.getSize("default_margin").height width: parent.width wrapMode: Text.WordWrap - text: catalog.i18nc("@label","Please select any upgrades made to this Ultimaker Original"); + text: catalog.i18nc("@label","Please select any upgrades made to this Ultimaker Original") + font: UM.Theme.getFont("medium") + renderType: Text.NativeRendering } - CheckBox + Cura.CheckBox { anchors.top: pageDescription.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height @@ -46,7 +41,5 @@ Cura.MachineAction checked: manager.hasHeatedBed onClicked: manager.setHeatedBed(checked) } - - UM.I18nCatalog { id: catalog; name: "cura"; } } -} \ No newline at end of file +} diff --git a/resources/qml/ActionPanel/SliceProcessWidget.qml b/resources/qml/ActionPanel/SliceProcessWidget.qml index f9ff706183..7030cd889a 100644 --- a/resources/qml/ActionPanel/SliceProcessWidget.qml +++ b/resources/qml/ActionPanel/SliceProcessWidget.qml @@ -9,8 +9,6 @@ import QtQuick.Controls 1.4 as Controls1 import UM 1.1 as UM import Cura 1.0 as Cura -import "../Widgets" - // This element contains all the elements the user needs to create a printjob from the // model(s) that is(are) on the buildplate. Mainly the button to start/stop the slicing @@ -66,7 +64,7 @@ Column } // Progress bar, only visible when the backend is in the process of slice the printjob - CuraProgressBar + Cura.ProgressBar { id: progressBar width: parent.width diff --git a/resources/qml/MachineSettings/ComboBoxWithOptions.qml b/resources/qml/MachineSettings/ComboBoxWithOptions.qml index 012e36817b..bf56d1d58e 100644 --- a/resources/qml/MachineSettings/ComboBoxWithOptions.qml +++ b/resources/qml/MachineSettings/ComboBoxWithOptions.qml @@ -92,7 +92,7 @@ UM.TooltipArea onContainerStackChanged: defaultOptionsModel.updateModel() } - CuraComboBox + Cura.ComboBox { id: comboBox anchors.left: fieldLabel.right diff --git a/resources/qml/MachineSettings/SimpleCheckBox.qml b/resources/qml/MachineSettings/SimpleCheckBox.qml index 8aa65eff95..d2edc28487 100644 --- a/resources/qml/MachineSettings/SimpleCheckBox.qml +++ b/resources/qml/MachineSettings/SimpleCheckBox.qml @@ -8,8 +8,6 @@ import QtQuick.Layouts 1.3 import UM 1.3 as UM import Cura 1.1 as Cura -import "../Widgets" - // // CheckBox widget for the on/off or true/false settings in the Machine Settings Dialog. @@ -58,7 +56,7 @@ UM.TooltipArea renderType: Text.NativeRendering } - CuraCheckBox + Cura.CheckBox { id: checkBox anchors.left: fieldLabel.right diff --git a/resources/qml/Settings/SettingComboBox.qml b/resources/qml/Settings/SettingComboBox.qml index d9ea47ac4d..37df0bd9b9 100644 --- a/resources/qml/Settings/SettingComboBox.qml +++ b/resources/qml/Settings/SettingComboBox.qml @@ -5,8 +5,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import UM 1.3 as UM - -import "../Widgets" as Widgets +import Cura 1.1 as Cura SettingItem @@ -14,7 +13,7 @@ SettingItem id: base property var focusItem: control - contents: Widgets.CuraComboBox + contents: Cura.ComboBox { id: control diff --git a/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml index 84f5f5acac..0cd684e409 100644 --- a/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml +++ b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml @@ -58,8 +58,7 @@ Item { anchors.top: titleLabel.bottom anchors.bottom: nextButton.top - anchors.topMargin: UM.Theme.getSize("default_margin").height - anchors.bottomMargin: UM.Theme.getSize("default_margin").height + anchors.margins: UM.Theme.getSize("default_margin").width anchors.left: parent.left anchors.right: parent.right diff --git a/resources/qml/WelcomePages/StepPanel.qml b/resources/qml/WelcomePages/StepPanel.qml index daca9bcb90..4cf6307a92 100644 --- a/resources/qml/WelcomePages/StepPanel.qml +++ b/resources/qml/WelcomePages/StepPanel.qml @@ -8,8 +8,6 @@ import QtGraphicalEffects 1.0 // For the dropshadow import UM 1.3 as UM import Cura 1.1 as Cura -import "../Widgets" - Item { @@ -117,7 +115,7 @@ Item z: panelBackground.z - 1 } - CuraProgressBar + Cura.ProgressBar { id: progressBar diff --git a/resources/qml/Widgets/CuraCheckBox.qml b/resources/qml/Widgets/CheckBox.qml similarity index 97% rename from resources/qml/Widgets/CuraCheckBox.qml rename to resources/qml/Widgets/CheckBox.qml index 865d9af5a2..c7536da6d3 100644 --- a/resources/qml/Widgets/CuraCheckBox.qml +++ b/resources/qml/Widgets/CheckBox.qml @@ -57,7 +57,7 @@ CheckBox width: Math.round(parent.width / 2.5) height: Math.round(parent.height / 2.5) sourceSize.height: width - color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text"); + color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") source: UM.Theme.getIcon("check") opacity: control.checked ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 100; } } diff --git a/resources/qml/Widgets/CuraComboBox.qml b/resources/qml/Widgets/ComboBox.qml similarity index 100% rename from resources/qml/Widgets/CuraComboBox.qml rename to resources/qml/Widgets/ComboBox.qml diff --git a/resources/qml/Widgets/CuraProgressBar.qml b/resources/qml/Widgets/ProgressBar.qml similarity index 100% rename from resources/qml/Widgets/CuraProgressBar.qml rename to resources/qml/Widgets/ProgressBar.qml diff --git a/resources/qml/Widgets/CuraTabButton.qml b/resources/qml/Widgets/TabButton.qml similarity index 100% rename from resources/qml/Widgets/CuraTabButton.qml rename to resources/qml/Widgets/TabButton.qml diff --git a/resources/qml/qmldir b/resources/qml/qmldir index 6de563e2a0..7ca2b36b4b 100644 --- a/resources/qml/qmldir +++ b/resources/qml/qmldir @@ -21,10 +21,10 @@ ToolTip 1.0 ToolTip.qml # Cura/Widgets -CuraCheckBox 1.0 CuraCheckBox.qml -CuraComboBox 1.0 CuraComboBox.qml -CuraProgressBar 1.0 CuraProgressBar.qml -CuraTabButton 1.0 CuraTabButton.qml +CheckBox 1.0 CheckBox.qml +ComboBox 1.0 ComboBox.qml +ProgressBar 1.0 ProgressBar.qml +TabButton 1.0 TabButton.qml # Cura/MachineSettings From 09e317372e83eb8d3cda68f1d466d8a15d95c2a4 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 19 Mar 2019 15:47:46 +0100 Subject: [PATCH 17/33] WIP: Remove UMOCheckup MachineAction Not used any more. --- .../UMOCheckupMachineAction.py | 193 ------------ .../UMOCheckupMachineAction.qml | 288 ------------------ .../definitions/ultimaker_original.def.json | 4 +- .../ultimaker_original_dual.def.json | 4 +- .../ultimaker_original_plus.def.json | 4 +- 5 files changed, 6 insertions(+), 487 deletions(-) delete mode 100644 plugins/UltimakerMachineActions/UMOCheckupMachineAction.py delete mode 100644 plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml diff --git a/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py b/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py deleted file mode 100644 index f9ad4789e5..0000000000 --- a/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py +++ /dev/null @@ -1,193 +0,0 @@ -from cura.MachineAction import MachineAction -from cura.PrinterOutputDevice import PrinterOutputDevice -from UM.Application import Application -from PyQt5.QtCore import pyqtSlot, pyqtSignal, pyqtProperty - -from UM.Logger import Logger -from UM.i18n import i18nCatalog -catalog = i18nCatalog("cura") - - -## Action to check up if the self-built UMO was done correctly. -class UMOCheckupMachineAction(MachineAction): - def __init__(self): - super().__init__("UMOCheckup", catalog.i18nc("@action", "Checkup")) - self._qml_url = "UMOCheckupMachineAction.qml" - self._hotend_target_temp = 180 - self._bed_target_temp = 60 - self._output_device = None - self._bed_test_completed = False - self._hotend_test_completed = False - - # Endstop tests - self._x_min_endstop_test_completed = False - self._y_min_endstop_test_completed = False - self._z_min_endstop_test_completed = False - - self._check_started = False - - Application.getInstance().getOutputDeviceManager().outputDevicesChanged.connect(self._onOutputDevicesChanged) - - onBedTestCompleted = pyqtSignal() - onHotendTestCompleted = pyqtSignal() - - onXMinEndstopTestCompleted = pyqtSignal() - onYMinEndstopTestCompleted = pyqtSignal() - onZMinEndstopTestCompleted = pyqtSignal() - - bedTemperatureChanged = pyqtSignal() - hotendTemperatureChanged = pyqtSignal() - - def _onOutputDevicesChanged(self): - # Check if this action was started, but no output device was found the first time. - # If so, re-try now that an output device has been added/removed. - if self._output_device is None and self._check_started: - self.startCheck() - - def _getPrinterOutputDevices(self): - return [printer_output_device for printer_output_device in - Application.getInstance().getOutputDeviceManager().getOutputDevices() if - isinstance(printer_output_device, PrinterOutputDevice)] - - def _reset(self): - if self._output_device: - self._output_device.bedTemperatureChanged.disconnect(self.bedTemperatureChanged) - self._output_device.hotendTemperaturesChanged.disconnect(self.hotendTemperatureChanged) - self._output_device.bedTemperatureChanged.disconnect(self._onBedTemperatureChanged) - self._output_device.hotendTemperaturesChanged.disconnect(self._onHotendTemperatureChanged) - self._output_device.endstopStateChanged.disconnect(self._onEndstopStateChanged) - try: - self._output_device.stopPollEndstop() - except AttributeError as e: # Connection is probably not a USB connection. Something went pretty wrong if this happens. - Logger.log("e", "An exception occurred while stopping end stop polling: %s" % str(e)) - - self._output_device = None - - self._check_started = False - self.checkStartedChanged.emit() - - # Ensure everything is reset (and right signals are emitted again) - self._bed_test_completed = False - self.onBedTestCompleted.emit() - self._hotend_test_completed = False - self.onHotendTestCompleted.emit() - - self._x_min_endstop_test_completed = False - self.onXMinEndstopTestCompleted.emit() - self._y_min_endstop_test_completed = False - self.onYMinEndstopTestCompleted.emit() - self._z_min_endstop_test_completed = False - self.onZMinEndstopTestCompleted.emit() - - self.heatedBedChanged.emit() - - @pyqtProperty(bool, notify = onBedTestCompleted) - def bedTestCompleted(self): - return self._bed_test_completed - - @pyqtProperty(bool, notify = onHotendTestCompleted) - def hotendTestCompleted(self): - return self._hotend_test_completed - - @pyqtProperty(bool, notify = onXMinEndstopTestCompleted) - def xMinEndstopTestCompleted(self): - return self._x_min_endstop_test_completed - - @pyqtProperty(bool, notify=onYMinEndstopTestCompleted) - def yMinEndstopTestCompleted(self): - return self._y_min_endstop_test_completed - - @pyqtProperty(bool, notify=onZMinEndstopTestCompleted) - def zMinEndstopTestCompleted(self): - return self._z_min_endstop_test_completed - - @pyqtProperty(float, notify = bedTemperatureChanged) - def bedTemperature(self): - if not self._output_device: - return 0 - return self._output_device.bedTemperature - - @pyqtProperty(float, notify=hotendTemperatureChanged) - def hotendTemperature(self): - if not self._output_device: - return 0 - return self._output_device.hotendTemperatures[0] - - def _onHotendTemperatureChanged(self): - if not self._output_device: - return - if not self._hotend_test_completed: - if self._output_device.hotendTemperatures[0] + 10 > self._hotend_target_temp and self._output_device.hotendTemperatures[0] - 10 < self._hotend_target_temp: - self._hotend_test_completed = True - self.onHotendTestCompleted.emit() - - def _onBedTemperatureChanged(self): - if not self._output_device: - return - if not self._bed_test_completed: - if self._output_device.bedTemperature + 5 > self._bed_target_temp and self._output_device.bedTemperature - 5 < self._bed_target_temp: - self._bed_test_completed = True - self.onBedTestCompleted.emit() - - def _onEndstopStateChanged(self, switch_type, state): - if state: - if switch_type == "x_min": - self._x_min_endstop_test_completed = True - self.onXMinEndstopTestCompleted.emit() - elif switch_type == "y_min": - self._y_min_endstop_test_completed = True - self.onYMinEndstopTestCompleted.emit() - elif switch_type == "z_min": - self._z_min_endstop_test_completed = True - self.onZMinEndstopTestCompleted.emit() - - checkStartedChanged = pyqtSignal() - - @pyqtProperty(bool, notify = checkStartedChanged) - def checkStarted(self): - return self._check_started - - @pyqtSlot() - def startCheck(self): - self._check_started = True - self.checkStartedChanged.emit() - output_devices = self._getPrinterOutputDevices() - if output_devices: - self._output_device = output_devices[0] - try: - self._output_device.sendCommand("M18") # Turn off all motors so the user can move the axes - self._output_device.startPollEndstop() - self._output_device.bedTemperatureChanged.connect(self.bedTemperatureChanged) - self._output_device.hotendTemperaturesChanged.connect(self.hotendTemperatureChanged) - self._output_device.bedTemperatureChanged.connect(self._onBedTemperatureChanged) - self._output_device.hotendTemperaturesChanged.connect(self._onHotendTemperatureChanged) - self._output_device.endstopStateChanged.connect(self._onEndstopStateChanged) - except AttributeError as e: # Connection is probably not a USB connection. Something went pretty wrong if this happens. - Logger.log("e", "An exception occurred while starting end stop polling: %s" % str(e)) - - @pyqtSlot() - def cooldownHotend(self): - if self._output_device is not None: - self._output_device.setTargetHotendTemperature(0, 0) - - @pyqtSlot() - def cooldownBed(self): - if self._output_device is not None: - self._output_device.setTargetBedTemperature(0) - - @pyqtSlot() - def heatupHotend(self): - if self._output_device is not None: - self._output_device.setTargetHotendTemperature(0, self._hotend_target_temp) - - @pyqtSlot() - def heatupBed(self): - if self._output_device is not None: - self._output_device.setTargetBedTemperature(self._bed_target_temp) - - heatedBedChanged = pyqtSignal() - - @pyqtProperty(bool, notify = heatedBedChanged) - def hasHeatedBed(self): - global_container_stack = Application.getInstance().getGlobalContainerStack() - return global_container_stack.getProperty("machine_heated_bed", "value") \ No newline at end of file diff --git a/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml b/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml deleted file mode 100644 index 2a01cfaa40..0000000000 --- a/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml +++ /dev/null @@ -1,288 +0,0 @@ -import UM 1.2 as UM -import Cura 1.0 as Cura - -import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Layouts 1.1 -import QtQuick.Window 2.1 - -Cura.MachineAction -{ - anchors.fill: parent; - Item - { - id: checkupMachineAction - anchors.fill: parent; - property int leftRow: (checkupMachineAction.width * 0.40) | 0 - property int rightRow: (checkupMachineAction.width * 0.60) | 0 - property bool heatupHotendStarted: false - property bool heatupBedStarted: false - property bool printerConnected: Cura.MachineManager.printerConnected - - UM.I18nCatalog { id: catalog; name: "cura"} - Label - { - id: pageTitle - width: parent.width - text: catalog.i18nc("@title", "Check Printer") - wrapMode: Text.WordWrap - font.pointSize: 18; - } - - Label - { - id: pageDescription - anchors.top: pageTitle.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height - width: parent.width - wrapMode: Text.WordWrap - text: catalog.i18nc("@label", "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional"); - } - - Row - { - id: startStopButtons - anchors.top: pageDescription.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height - anchors.horizontalCenter: parent.horizontalCenter - width: childrenRect.width - spacing: UM.Theme.getSize("default_margin").width - Button - { - id: startCheckButton - text: catalog.i18nc("@action:button","Start Printer Check"); - onClicked: - { - checkupMachineAction.heatupHotendStarted = false; - checkupMachineAction.heatupBedStarted = false; - manager.startCheck(); - startCheckButton.visible = false; - } - } - } - - Item - { - id: checkupContent - anchors.top: startStopButtons.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height - visible: manager.checkStarted - width: parent.width - height: 250 - ////////////////////////////////////////////////////////// - Label - { - id: connectionLabel - width: checkupMachineAction.leftRow - anchors.left: parent.left - anchors.top: parent.top - wrapMode: Text.WordWrap - text: catalog.i18nc("@label","Connection: ") - } - Label - { - id: connectionStatus - width: checkupMachineAction.rightRow - anchors.left: connectionLabel.right - anchors.top: parent.top - wrapMode: Text.WordWrap - text: checkupMachineAction.printerConnected ? catalog.i18nc("@info:status","Connected"): catalog.i18nc("@info:status","Not connected") - } - ////////////////////////////////////////////////////////// - Label - { - id: endstopXLabel - width: checkupMachineAction.leftRow - anchors.left: parent.left - anchors.top: connectionLabel.bottom - wrapMode: Text.WordWrap - text: catalog.i18nc("@label","Min endstop X: ") - visible: checkupMachineAction.printerConnected - } - Label - { - id: endstopXStatus - width: checkupMachineAction.rightRow - anchors.left: endstopXLabel.right - anchors.top: connectionLabel.bottom - wrapMode: Text.WordWrap - text: manager.xMinEndstopTestCompleted ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked") - visible: checkupMachineAction.printerConnected - } - ////////////////////////////////////////////////////////////// - Label - { - id: endstopYLabel - width: checkupMachineAction.leftRow - anchors.left: parent.left - anchors.top: endstopXLabel.bottom - wrapMode: Text.WordWrap - text: catalog.i18nc("@label","Min endstop Y: ") - visible: checkupMachineAction.printerConnected - } - Label - { - id: endstopYStatus - width: checkupMachineAction.rightRow - anchors.left: endstopYLabel.right - anchors.top: endstopXLabel.bottom - wrapMode: Text.WordWrap - text: manager.yMinEndstopTestCompleted ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked") - visible: checkupMachineAction.printerConnected - } - ///////////////////////////////////////////////////////////////////// - Label - { - id: endstopZLabel - width: checkupMachineAction.leftRow - anchors.left: parent.left - anchors.top: endstopYLabel.bottom - wrapMode: Text.WordWrap - text: catalog.i18nc("@label","Min endstop Z: ") - visible: checkupMachineAction.printerConnected - } - Label - { - id: endstopZStatus - width: checkupMachineAction.rightRow - anchors.left: endstopZLabel.right - anchors.top: endstopYLabel.bottom - wrapMode: Text.WordWrap - text: manager.zMinEndstopTestCompleted ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked") - visible: checkupMachineAction.printerConnected - } - //////////////////////////////////////////////////////////// - Label - { - id: nozzleTempLabel - width: checkupMachineAction.leftRow - height: nozzleTempButton.height - anchors.left: parent.left - anchors.top: endstopZLabel.bottom - wrapMode: Text.WordWrap - text: catalog.i18nc("@label","Nozzle temperature check: ") - visible: checkupMachineAction.printerConnected - } - Label - { - id: nozzleTempStatus - width: (checkupMachineAction.rightRow * 0.4) | 0 - anchors.top: nozzleTempLabel.top - anchors.left: nozzleTempLabel.right - wrapMode: Text.WordWrap - text: catalog.i18nc("@info:status","Not checked") - visible: checkupMachineAction.printerConnected - } - Item - { - id: nozzleTempButton - width: (checkupMachineAction.rightRow * 0.3) | 0 - height: childrenRect.height - anchors.top: nozzleTempLabel.top - anchors.left: bedTempStatus.right - anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").width/2) - visible: checkupMachineAction.printerConnected - Button - { - text: checkupMachineAction.heatupHotendStarted ? catalog.i18nc("@action:button","Stop Heating") : catalog.i18nc("@action:button","Start Heating") - onClicked: - { - if (checkupMachineAction.heatupHotendStarted) - { - manager.cooldownHotend() - checkupMachineAction.heatupHotendStarted = false - } else - { - manager.heatupHotend() - checkupMachineAction.heatupHotendStarted = true - } - } - } - } - Label - { - id: nozzleTemp - anchors.top: nozzleTempLabel.top - anchors.left: nozzleTempButton.right - anchors.leftMargin: UM.Theme.getSize("default_margin").width - width: (checkupMachineAction.rightRow * 0.2) | 0 - wrapMode: Text.WordWrap - text: manager.hotendTemperature + "°C" - font.bold: true - visible: checkupMachineAction.printerConnected - } - ///////////////////////////////////////////////////////////////////////////// - Label - { - id: bedTempLabel - width: checkupMachineAction.leftRow - height: bedTempButton.height - anchors.left: parent.left - anchors.top: nozzleTempLabel.bottom - wrapMode: Text.WordWrap - text: catalog.i18nc("@label","Build plate temperature check:") - visible: checkupMachineAction.printerConnected && manager.hasHeatedBed - } - - Label - { - id: bedTempStatus - width: (checkupMachineAction.rightRow * 0.4) | 0 - anchors.top: bedTempLabel.top - anchors.left: bedTempLabel.right - wrapMode: Text.WordWrap - text: manager.bedTestCompleted ? catalog.i18nc("@info:status","Not checked"): catalog.i18nc("@info:status","Checked") - visible: checkupMachineAction.printerConnected && manager.hasHeatedBed - } - Item - { - id: bedTempButton - width: (checkupMachineAction.rightRow * 0.3) | 0 - height: childrenRect.height - anchors.top: bedTempLabel.top - anchors.left: bedTempStatus.right - anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").width/2) - visible: checkupMachineAction.printerConnected && manager.hasHeatedBed - Button - { - text: checkupMachineAction.heatupBedStarted ?catalog.i18nc("@action:button","Stop Heating") : catalog.i18nc("@action:button","Start Heating") - onClicked: - { - if (checkupMachineAction.heatupBedStarted) - { - manager.cooldownBed() - checkupMachineAction.heatupBedStarted = false - } else - { - manager.heatupBed() - checkupMachineAction.heatupBedStarted = true - } - } - } - } - Label - { - id: bedTemp - width: (checkupMachineAction.rightRow * 0.2) | 0 - anchors.top: bedTempLabel.top - anchors.left: bedTempButton.right - anchors.leftMargin: UM.Theme.getSize("default_margin").width - wrapMode: Text.WordWrap - text: manager.bedTemperature + "°C" - font.bold: true - visible: checkupMachineAction.printerConnected && manager.hasHeatedBed - } - Label - { - id: resultText - visible: false - anchors.top: bedTemp.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height - anchors.left: parent.left - width: parent.width - wrapMode: Text.WordWrap - text: catalog.i18nc("@label", "Everything is in order! You're done with your CheckUp.") - } - } - } -} \ No newline at end of file diff --git a/resources/definitions/ultimaker_original.def.json b/resources/definitions/ultimaker_original.def.json index 6a978c47cb..81d3261f45 100644 --- a/resources/definitions/ultimaker_original.def.json +++ b/resources/definitions/ultimaker_original.def.json @@ -12,8 +12,8 @@ "has_materials": true, "has_machine_quality": true, "exclude_materials": ["generic_hips", "generic_petg", "generic_bam", "ultimaker_bam", "generic_pva", "ultimaker_pva", "generic_tough_pla", "ultimaker_tough_pla_black", "ultimaker_tough_pla_green", "ultimaker_tough_pla_red", "ultimaker_tough_pla_white"], - "first_start_actions": ["UMOUpgradeSelection", "UMOCheckup", "BedLevel"], - "supported_actions": ["UMOUpgradeSelection", "UMOCheckup", "BedLevel"], + "first_start_actions": ["UMOUpgradeSelection", "BedLevel"], + "supported_actions": ["UMOUpgradeSelection", "BedLevel"], "machine_extruder_trains": { "0": "ultimaker_original_extruder_0" diff --git a/resources/definitions/ultimaker_original_dual.def.json b/resources/definitions/ultimaker_original_dual.def.json index 999650aa28..becd58f6de 100644 --- a/resources/definitions/ultimaker_original_dual.def.json +++ b/resources/definitions/ultimaker_original_dual.def.json @@ -20,8 +20,8 @@ }, "firmware_file": "MarlinUltimaker-{baudrate}-dual.hex", "firmware_hbk_file": "MarlinUltimaker-HBK-{baudrate}-dual.hex", - "first_start_actions": ["UMOUpgradeSelection", "UMOCheckup", "BedLevel"], - "supported_actions": ["UMOUpgradeSelection", "UMOCheckup", "BedLevel"] + "first_start_actions": ["UMOUpgradeSelection", "BedLevel"], + "supported_actions": ["UMOUpgradeSelection", "BedLevel"] }, "overrides": { diff --git a/resources/definitions/ultimaker_original_plus.def.json b/resources/definitions/ultimaker_original_plus.def.json index bdb8a3d788..949e2e8d0d 100644 --- a/resources/definitions/ultimaker_original_plus.def.json +++ b/resources/definitions/ultimaker_original_plus.def.json @@ -10,8 +10,8 @@ "platform": "ultimaker2_platform.obj", "platform_texture": "UltimakerPlusbackplate.png", "quality_definition": "ultimaker_original", - "first_start_actions": ["UMOCheckup", "BedLevel"], - "supported_actions": ["UMOCheckup", "BedLevel"], + "first_start_actions": ["BedLevel"], + "supported_actions": ["BedLevel"], "machine_extruder_trains": { "0": "ultimaker_original_plus_extruder_0" From 9d54064e7333c3a7d9e10119290bade47f2dad3f Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 19 Mar 2019 15:49:09 +0100 Subject: [PATCH 18/33] WIP: Remove UMOCheckup MachineAction translations Not used any more --- resources/i18n/cura.pot | 100 --------------------------------- resources/i18n/de_DE/cura.po | 98 -------------------------------- resources/i18n/es_ES/cura.po | 98 -------------------------------- resources/i18n/fi_FI/cura.po | 98 -------------------------------- resources/i18n/fr_FR/cura.po | 98 -------------------------------- resources/i18n/it_IT/cura.po | 98 -------------------------------- resources/i18n/ja_JP/cura.po | 98 -------------------------------- resources/i18n/ko_KR/cura.po | 98 -------------------------------- resources/i18n/nl_NL/cura.po | 98 -------------------------------- resources/i18n/pl_PL/cura.po | 98 -------------------------------- resources/i18n/pt_BR/cura.po | 98 -------------------------------- resources/i18n/pt_PT/cura.po | 105 ----------------------------------- resources/i18n/ru_RU/cura.po | 98 -------------------------------- resources/i18n/tr_TR/cura.po | 98 -------------------------------- resources/i18n/zh_CN/cura.po | 98 -------------------------------- resources/i18n/zh_TW/cura.po | 98 -------------------------------- 16 files changed, 1577 deletions(-) diff --git a/resources/i18n/cura.pot b/resources/i18n/cura.pot index 749fdb65ee..133ca141f9 100644 --- a/resources/i18n/cura.pot +++ b/resources/i18n/cura.pot @@ -966,11 +966,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -3085,101 +3080,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "" -"It's a good idea to do a few sanity checks on your Ultimaker. You can skip " -"this step if you know your machine is functional" -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "" - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" diff --git a/resources/i18n/de_DE/cura.po b/resources/i18n/de_DE/cura.po index 11acb189fd..f2bb7728f5 100644 --- a/resources/i18n/de_DE/cura.po +++ b/resources/i18n/de_DE/cura.po @@ -927,11 +927,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "Upgrades wählen" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "Check-up" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -2974,99 +2969,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "Beheizte Druckplatte (offizielles Kit oder Eigenbau)" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "Drucker prüfen" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional" -msgstr "Sie sollten einige Sanity Checks bei Ihrem Ultimaker durchführen. Sie können diesen Schritt überspringen, wenn Sie wissen, dass Ihr Gerät funktionsfähig ist" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "Überprüfung des Druckers starten" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "Verbindung: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "Verbunden" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "Nicht verbunden" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "Min. Endstopp X: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "Funktionsfähig" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "Nicht überprüft" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "Min. Endstopp Y: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "Min. Endstopp Z: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "Temperaturprüfung der Düse: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "Aufheizen stoppen" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "Aufheizen starten" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "Temperaturprüfung der Druckplatte:" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "Geprüft" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "Alles ist in Ordnung! Der Check-up ist abgeschlossen." - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" diff --git a/resources/i18n/es_ES/cura.po b/resources/i18n/es_ES/cura.po index aa217b0275..5dc9662381 100644 --- a/resources/i18n/es_ES/cura.po +++ b/resources/i18n/es_ES/cura.po @@ -927,11 +927,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "Seleccionar actualizaciones" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "Comprobación" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -2974,99 +2969,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "Placa de impresión caliente (kit oficial o construida por usted mismo)" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "Comprobar impresora" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional" -msgstr "Es una buena idea hacer un par de comprobaciones en su Ultimaker. Puede omitir este paso si usted sabe que su máquina funciona correctamente" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "Iniciar comprobación de impresora" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "Conexión: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "Conectado" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "Sin conexión" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "Parada final mín. en X: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "Funciona" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "Sin comprobar" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "Parada final mín. en Y: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "Parada final mín. en Z: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "Comprobación de la temperatura de la tobera: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "Detener calentamiento" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "Iniciar calentamiento" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "Comprobación de la temperatura de la placa de impresión:" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "Comprobada" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "¡Todo correcto! Ha terminado con la comprobación." - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" diff --git a/resources/i18n/fi_FI/cura.po b/resources/i18n/fi_FI/cura.po index d07b032bad..5233112971 100644 --- a/resources/i18n/fi_FI/cura.po +++ b/resources/i18n/fi_FI/cura.po @@ -921,11 +921,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "Valitse päivitykset" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "Tarkastus" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -2957,99 +2952,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "Lämmitettävä alusta (virallinen sarja tai itse rakennettu)" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "Tarkista tulostin" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional" -msgstr "Ultimakerille on hyvä tehdä muutamia toimintatarkastuksia. Voit jättää tämän vaiheen väliin, jos tiedät laitteesi olevan toimintakunnossa" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "Aloita tulostintarkistus" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "Yhteys: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "Yhdistetty" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "Ei yhteyttä" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "Min. päätyraja X: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "Toimii" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "Ei tarkistettu" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "Min. päätyraja Y: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "Min. päätyraja Z: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "Suuttimen lämpötilatarkistus: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "Lopeta lämmitys" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "Aloita lämmitys" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "Alustan lämpötilan tarkistus:" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "Tarkistettu" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "Kaikki on kunnossa! CheckUp on valmis." - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" diff --git a/resources/i18n/fr_FR/cura.po b/resources/i18n/fr_FR/cura.po index f7f48e9410..2be63006c0 100644 --- a/resources/i18n/fr_FR/cura.po +++ b/resources/i18n/fr_FR/cura.po @@ -927,11 +927,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "Sélectionner les mises à niveau" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "Check-up" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -2974,99 +2969,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "Plateau chauffant (kit officiel ou fabriqué soi-même)" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "Tester l'imprimante" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional" -msgstr "Il est préférable de procéder à quelques tests de fonctionnement sur votre Ultimaker. Vous pouvez passer cette étape si vous savez que votre machine est fonctionnelle" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "Démarrer le test de l'imprimante" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "Connexion : " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "Connecté" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "Non connecté" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "Fin de course X : " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "Fonctionne" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "Non testé" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "Fin de course Y : " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "Fin de course Z : " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "Test de la température de la buse : " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "Arrêter le chauffage" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "Démarrer le chauffage" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "Contrôle de la température du plateau :" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "Contrôlée" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "Tout est en ordre ! Vous avez terminé votre check-up." - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" diff --git a/resources/i18n/it_IT/cura.po b/resources/i18n/it_IT/cura.po index c857499eb3..8a1d650a0d 100644 --- a/resources/i18n/it_IT/cura.po +++ b/resources/i18n/it_IT/cura.po @@ -927,11 +927,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "Seleziona aggiornamenti" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "Controllo" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -2974,99 +2969,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "Piano di stampa riscaldato (kit ufficiale o integrato)" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "Controllo stampante" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional" -msgstr "È consigliabile eseguire alcuni controlli di integrità sulla Ultimaker. È possibile saltare questo passaggio se si è certi che la macchina funziona correttamente" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "Avvia controllo stampante" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "Collegamento: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "Collegato" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "Non collegato" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "Endstop min. asse X: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "Funziona" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "Controllo non selezionato" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "Endstop min. asse Y: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "Endstop min. asse Z: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "Controllo temperatura ugello: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "Arresto riscaldamento" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "Avvio riscaldamento" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "Controllo temperatura piano di stampa:" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "Controllo eseguito" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "È tutto in ordine! Controllo terminato." - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" diff --git a/resources/i18n/ja_JP/cura.po b/resources/i18n/ja_JP/cura.po index e57c3e4cea..28ab848f47 100644 --- a/resources/i18n/ja_JP/cura.po +++ b/resources/i18n/ja_JP/cura.po @@ -928,11 +928,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "アップグレードを選択する" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "チェックアップ" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -2973,99 +2968,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "ヒーティッドビルドプレート(オフィシャルキットまたはセルフビルド)" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "プリンターチェック" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional" -msgstr "お持ちのUltimkaerにてサニティーチェックを数回行うことは推奨します。もしプリンター機能に問題ない場合はこの項目をスキップしてください" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "プリンターチェックを開始する" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "コネクション: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "接続済" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "プリンターにつながっていません" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "エンドストップ X: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "作品" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "チェックされていません" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "エンドストップ Y: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "エンドストップ Z: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "ノズル温度チェック: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "ヒーティングストップ" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "ヒーティング開始" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "ビルドプレートの温度チェック:" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "チェック済" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "すべてに異常はありません。チェックアップを終了しました。" - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" diff --git a/resources/i18n/ko_KR/cura.po b/resources/i18n/ko_KR/cura.po index c3dd1a434f..11989a3285 100644 --- a/resources/i18n/ko_KR/cura.po +++ b/resources/i18n/ko_KR/cura.po @@ -927,11 +927,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "업그레이드 선택" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "검사" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -2971,99 +2966,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "히팅 빌드 플레이트 (공식 키트 또는 자체 조립식)" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "프린터 확인" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional" -msgstr "Ultimaker에서 몇 가지 검사를 하는 것이 좋습니다. 기기가 제대로 작동한다고 생각이 되면 이 단계를 건너 뛸 수 있습니다" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "프린터 체 시작" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "연결 " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "연결됨" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "연결되지 않음" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "최소 엔드 스톱 X " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "작업" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "확인되지 않음" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "최소 엔드 스톱 Y " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "최소 엔드 스톱 Z " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "노즐 온도 확인 " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "가열 중지" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "가열 시작" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "빌드 플레이트 온도 확인 :" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "체크 됨" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "모든 점검이 순조롭게 끝났습니다." - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" diff --git a/resources/i18n/nl_NL/cura.po b/resources/i18n/nl_NL/cura.po index ce499a87d0..77d046cba1 100644 --- a/resources/i18n/nl_NL/cura.po +++ b/resources/i18n/nl_NL/cura.po @@ -927,11 +927,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "Upgrades selecteren" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "Controle" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -2969,99 +2964,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "Verwarmd Platform (officiële kit of eigenbouw)" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "Printer Controleren" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional" -msgstr "Het wordt aangeraden een controle uit te voeren op de Ultimaker. U kunt deze stap overslaan als u zeker weet dat de machine correct functioneert" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "Printercontrole Starten" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "Verbinding: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "Aangesloten" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "Niet aangesloten" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "Min. eindstop X: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "Werkt" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "Niet gecontroleerd" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "Min. eindstop Y: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "Min. eindstop Z: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "Temperatuurcontrole nozzle: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "Verwarmen Stoppen" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "Verwarmen Starten" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "Temperatuurcontrole platform:" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "Gecontroleerd" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "Alles is in orde! De controle is voltooid." - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" diff --git a/resources/i18n/pl_PL/cura.po b/resources/i18n/pl_PL/cura.po index 10f01d54e1..9faffaea11 100644 --- a/resources/i18n/pl_PL/cura.po +++ b/resources/i18n/pl_PL/cura.po @@ -927,11 +927,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "Wybierz aktualizacje" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "Sprawdzanie" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -2974,99 +2969,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "Płyta grzewcza (zestaw oficjalny lub własnej roboty)" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "Sprawdź drukarkę" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional" -msgstr "Dobrym pomysłem jest zrobienie kilku testów na swoim Ultimakera. Możesz pominąć ten krok, jeśli wiesz, że urządzenie jest funkcjonalne" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "Rozpocznij sprawdzanie drukarki" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "Połączenie: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "Połączono" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "Nie połączono" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "Krańcówka min. X: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "Pracuje" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "Niesprawdzone" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "Krańcówka min. Y: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "Krańcówka min. Z: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "Sprawdzanie temperatury dyszy: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "Zatrzymaj ogrzewanie" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "Rozpocznij ogrzewanie" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "Kontrola temperatury płyty konstrukcyjnej:" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "Sprawdzone" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "Wszystko w porządku! Skończono sprawdzenie." - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" diff --git a/resources/i18n/pt_BR/cura.po b/resources/i18n/pt_BR/cura.po index 467c34786d..599fa75fcb 100644 --- a/resources/i18n/pt_BR/cura.po +++ b/resources/i18n/pt_BR/cura.po @@ -927,11 +927,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "Selecionar Atualizações" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "Verificação" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -2974,99 +2969,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "Mesa de Impressão Aquecida (kit Oficial ou auto-construído)" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "Verificar Impressora" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional" -msgstr "É uma boa idéia fazer algumas verificações de sanidade em sua Ultimaker. Você pode pular este passo se você sabe que sua máquina está funcional" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "Iniciar Verificação da Impressora" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "Conexão: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "Conectado" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "Desconectado" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "Fim de curso mín. em X: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "Funciona" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "Não verificado" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "Fim de curso mín. em Y: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "Fim de curso mín. em Z: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "Verificação da temperatura do bico: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "Parar Aquecimento" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "Iniciar Aquecimento" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "Verificação da temperatura da mesa de impressão:" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "Verificado" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "Tudo está em ordem! A verificação terminou." - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" diff --git a/resources/i18n/pt_PT/cura.po b/resources/i18n/pt_PT/cura.po index 1822188c5a..a3237ca158 100644 --- a/resources/i18n/pt_PT/cura.po +++ b/resources/i18n/pt_PT/cura.po @@ -945,11 +945,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "Selecionar atualizações" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "Checkup" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -3008,106 +3003,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "Base de Construção Aquecida (kit oficial ou de construção própria)" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "Verificar Impressora" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional" -msgstr "É recomendado efetuar algumas verificações de teste à sua Ultimaker. Pode ignorar este passo se souber que a sua máquina está funcional" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "Iniciar Verificação da Impressora" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "Ligação: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "Ligado" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "Sem ligação" - -# rever! -# contexto?! -# X mín. de posição final: -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "Mín. endstop X: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "Trabalhos" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "Não verificado" - -# rever! -# contexto?! -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "Mín. endstop Y: " - -# rever! -# contexto?! -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "Mín. endstop Z: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "Verificação da temperatura do nozzle: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "Parar Aquecimento" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "Iniciar Aquecimento" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "Verificação da temperatura da base de construção:" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "Verificado" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "Está tudo em ordem! A verificação está concluída." - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" diff --git a/resources/i18n/ru_RU/cura.po b/resources/i18n/ru_RU/cura.po index 3ee414fb25..de4cecfdb0 100644 --- a/resources/i18n/ru_RU/cura.po +++ b/resources/i18n/ru_RU/cura.po @@ -927,11 +927,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "Выбор обновлений" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "Проверка" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -2977,99 +2972,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "Нагреваемый стол (официальный набор или самодельный)" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "Проверка принтера" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional" -msgstr "Хорошей идеей будет выполнить несколько проверок вашего Ultimaker. Вы можете пропустить этот шаг, если уверены в функциональности своего принтера" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "Начать проверку принтера" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "Соединение: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "Подключен" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "Не подключен" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "Минимальный концевик на оси X: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "Работает" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "Не проверен" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "Минимальный концевик на оси Y: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "Минимальный концевик на оси Z: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "Проверка температуры сопла: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "Завершение нагрева" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "Начало нагрева" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "Проверка температуры стола:" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "Проверена" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "Всё в порядке! Проверка завершена." - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" diff --git a/resources/i18n/tr_TR/cura.po b/resources/i18n/tr_TR/cura.po index ce577a92b0..fd2cd5a396 100644 --- a/resources/i18n/tr_TR/cura.po +++ b/resources/i18n/tr_TR/cura.po @@ -927,11 +927,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "Yükseltmeleri seçin" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "Kontrol" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -2974,99 +2969,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "Isıtılmış Yapı Levhası (orijinal donanım veya şahsen yapılan)" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "Yazıcıyı kontrol et" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional" -msgstr "Ultimaker’ınızda birkaç uygunluk testi yapmak faydalı olabilir. Makinenizin işlevlerini yerine getirdiğini düşünüyorsanız bu adımı atlayabilirsiniz" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "Yazıcı Kontrolünü Başlat" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "Bağlantı: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "Bağlı" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "Bağlı değil" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "Min. Kapama X: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "İşlemler" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "Kontrol edilmedi" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "Min. kapama Y: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "Min. kapama Z: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "Nozül sıcaklık kontrolü: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "Isıtmayı Durdur" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "Isıtmayı Başlat" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "Yapı levhası sıcaklık kontrolü:" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "Kontrol edildi" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "Her şey yolunda! Kontrol işlemini tamamladınız." - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" diff --git a/resources/i18n/zh_CN/cura.po b/resources/i18n/zh_CN/cura.po index aac1415e84..c5ca0fe7b4 100644 --- a/resources/i18n/zh_CN/cura.po +++ b/resources/i18n/zh_CN/cura.po @@ -927,11 +927,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "选择升级" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "检查" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -2971,99 +2966,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "热床(官方版本或自制)" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "检查打印机" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional" -msgstr "对 Ultimaker 进行几项正确性检查是很好的做法。如果您知道您的机器功能正常,则可跳过此步骤" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "开始打印机检查" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "连接: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "已连接" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "未连接" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "X Min 限位开关: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "工作" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "未检查" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "Y Min 限位开关: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "Z Min 限位开关: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "检查喷嘴温度: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "停止加热" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "开始加热" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "打印平台温度检查:" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "已检查" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "一切正常!你已经完成检查。" - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" diff --git a/resources/i18n/zh_TW/cura.po b/resources/i18n/zh_TW/cura.po index 61a311ff88..9050a47047 100644 --- a/resources/i18n/zh_TW/cura.po +++ b/resources/i18n/zh_TW/cura.po @@ -928,11 +928,6 @@ msgctxt "@action" msgid "Select upgrades" msgstr "選擇升級" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py:14 -msgctxt "@action" -msgid "Checkup" -msgstr "檢查" - #: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/BedLevelMachineAction.py:21 msgctxt "@action" msgid "Level build plate" @@ -2972,99 +2967,6 @@ msgctxt "@label" msgid "Heated Build Plate (official kit or self-built)" msgstr "熱床(官方版本或自製版本)" -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:27 -msgctxt "@title" -msgid "Check Printer" -msgstr "檢查印表機" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:39 -msgctxt "@label" -msgid "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional" -msgstr "對 Ultimaker 進行幾項正確性檢查是很好的做法。如果你知道你的機器功能正常,則可跳過此步驟" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:53 -msgctxt "@action:button" -msgid "Start Printer Check" -msgstr "開始印表機檢查" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:80 -msgctxt "@label" -msgid "Connection: " -msgstr "連線: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Connected" -msgstr "已連線" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:89 -msgctxt "@info:status" -msgid "Not connected" -msgstr "未連線" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:99 -msgctxt "@label" -msgid "Min endstop X: " -msgstr "X Min 限位開關: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -msgctxt "@info:status" -msgid "Works" -msgstr "正常" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:109 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:130 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:151 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:173 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Not checked" -msgstr "未檢查" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:120 -msgctxt "@label" -msgid "Min endstop Y: " -msgstr "Y Min 限位開關: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:141 -msgctxt "@label" -msgid "Min endstop Z: " -msgstr "Z Min 限位開關: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:163 -msgctxt "@label" -msgid "Nozzle temperature check: " -msgstr "檢查噴頭溫度: " - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Stop Heating" -msgstr "停止加熱" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:187 -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:248 -msgctxt "@action:button" -msgid "Start Heating" -msgstr "開始加熱" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:223 -msgctxt "@label" -msgid "Build plate temperature check:" -msgstr "熱床溫度檢查:" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:234 -msgctxt "@info:status" -msgid "Checked" -msgstr "已檢查" - -#: /home/ruben/Projects/Cura/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml:284 -msgctxt "@label" -msgid "Everything is in order! You're done with your CheckUp." -msgstr "一切正常!你已經完成檢查。" - #: /home/ruben/Projects/Cura/resources/qml/MonitorButton.qml:119 msgctxt "@label:MonitorStatus" msgid "Not connected to a printer" From a106a9ddb9daf1f3eed4c50921922dc22c05b558 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 20 Mar 2019 08:41:01 +0100 Subject: [PATCH 19/33] WIP: Cleanup MachineSettingsAction --- .../Models/FirstStartMachineActionsModel.py | 4 + .../cura_empty_instance_containers.py | 20 ++- .../MachineSettingsAction.py | 116 +++++++----------- .../MachineSettingsExtruderTab.qml | 6 +- .../MachineSettingsPrinterTab.qml | 10 +- .../FirstStartMachineActionsContent.qml | 3 + 6 files changed, 76 insertions(+), 83 deletions(-) diff --git a/cura/Machines/Models/FirstStartMachineActionsModel.py b/cura/Machines/Models/FirstStartMachineActionsModel.py index b7e806278c..aabf8b8a8a 100644 --- a/cura/Machines/Models/FirstStartMachineActionsModel.py +++ b/cura/Machines/Models/FirstStartMachineActionsModel.py @@ -12,17 +12,20 @@ from UM.Qt.ListModel import ListModel # This model holds all first-start machine actions for the currently active machine. It has 2 roles: # - title : the title/name of the action # - content : the QObject of the QML content of the action +# - action : the MachineAction object itself # class FirstStartMachineActionsModel(ListModel): TitleRole = Qt.UserRole + 1 ContentRole = Qt.UserRole + 2 + ActionRole = Qt.UserRole + 3 def __init__(self, parent: Optional[QObject] = None) -> None: super().__init__(parent) self.addRoleName(self.TitleRole, "title") self.addRoleName(self.ContentRole, "content") + self.addRoleName(self.ActionRole, "action") from cura.CuraApplication import CuraApplication self._application = CuraApplication.getInstance() @@ -46,6 +49,7 @@ class FirstStartMachineActionsModel(ListModel): for item in first_start_actions: item_list.append({"title": item.label, "content": item.displayItem, + "action": item, }) self.setItems(item_list) diff --git a/cura/Settings/cura_empty_instance_containers.py b/cura/Settings/cura_empty_instance_containers.py index d76407ed79..534e6f4199 100644 --- a/cura/Settings/cura_empty_instance_containers.py +++ b/cura/Settings/cura_empty_instance_containers.py @@ -41,6 +41,22 @@ empty_quality_changes_container.setMetaDataEntry("type", "quality_changes") empty_quality_changes_container.setMetaDataEntry("quality_type", "not_supported") +# All empty container IDs set +ALL_EMPTY_CONTAINER_ID_SET = { + EMPTY_CONTAINER_ID, + EMPTY_DEFINITION_CHANGES_CONTAINER_ID, + EMPTY_VARIANT_CONTAINER_ID, + EMPTY_MATERIAL_CONTAINER_ID, + EMPTY_QUALITY_CONTAINER_ID, + EMPTY_QUALITY_CHANGES_CONTAINER_ID, +} + + +# Convenience function to check if a container ID represents an empty container. +def isEmptyContainer(container_id: str) -> bool: + return container_id in ALL_EMPTY_CONTAINER_ID_SET + + __all__ = ["EMPTY_CONTAINER_ID", "empty_container", # For convenience "EMPTY_DEFINITION_CHANGES_CONTAINER_ID", @@ -52,5 +68,7 @@ __all__ = ["EMPTY_CONTAINER_ID", "EMPTY_QUALITY_CHANGES_CONTAINER_ID", "empty_quality_changes_container", "EMPTY_QUALITY_CONTAINER_ID", - "empty_quality_container" + "empty_quality_container", + "ALL_EMPTY_CONTAINER_ID_SET", + "isEmptyContainer", ] diff --git a/plugins/MachineSettingsAction/MachineSettingsAction.py b/plugins/MachineSettingsAction/MachineSettingsAction.py index afd7aac86d..cddc4e5fe8 100755 --- a/plugins/MachineSettingsAction/MachineSettingsAction.py +++ b/plugins/MachineSettingsAction/MachineSettingsAction.py @@ -1,16 +1,21 @@ -# Copyright (c) 2017 Ultimaker B.V. +# Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. -from PyQt5.QtCore import pyqtProperty, pyqtSignal +from typing import Optional, TYPE_CHECKING + +from PyQt5.QtCore import pyqtProperty import UM.i18n from UM.FlameProfiler import pyqtSlot -from UM.Application import Application from UM.Settings.ContainerRegistry import ContainerRegistry from UM.Settings.DefinitionContainer import DefinitionContainer from cura.MachineAction import MachineAction from cura.Settings.CuraStackBuilder import CuraStackBuilder +from cura.Settings.cura_empty_instance_containers import isEmptyContainer + +if TYPE_CHECKING: + from PyQt5.QtCore import QObject catalog = UM.i18n.i18nCatalog("cura") @@ -18,139 +23,102 @@ catalog = UM.i18n.i18nCatalog("cura") ## This action allows for certain settings that are "machine only") to be modified. # It automatically detects machine definitions that it knows how to change and attaches itself to those. class MachineSettingsAction(MachineAction): - def __init__(self, parent = None): + def __init__(self, parent: Optional["QObject"] = None) -> None: super().__init__("MachineSettingsAction", catalog.i18nc("@action", "Machine Settings")) self._qml_url = "MachineSettingsAction.qml" - self._application = Application.getInstance() - - self._global_container_stack = None + from cura.CuraApplication import CuraApplication + self._application = CuraApplication.getInstance() from cura.Settings.CuraContainerStack import _ContainerIndexes - self._container_index = _ContainerIndexes.DefinitionChanges + self._store_container_index = _ContainerIndexes.DefinitionChanges self._container_registry = ContainerRegistry.getInstance() self._container_registry.containerAdded.connect(self._onContainerAdded) - self._container_registry.containerRemoved.connect(self._onContainerRemoved) - self._application.globalContainerStackChanged.connect(self._onGlobalContainerChanged) + # The machine settings dialog blocks auto-slicing when it's shown, and re-enables it when it's finished. self._backend = self._application.getBackend() + self.onFinished.connect(self._onFinished) - self._empty_definition_container_id_list = [] - - def _isEmptyDefinitionChanges(self, container_id: str): - if not self._empty_definition_container_id_list: - self._empty_definition_container_id_list = [self._application.empty_container.getId(), - self._application.empty_definition_changes_container.getId()] - return container_id in self._empty_definition_container_id_list + # Which container index in a stack to store machine setting changes. + @pyqtProperty(int, constant = True) + def storeContainerIndex(self) -> int: + return self._store_container_index def _onContainerAdded(self, container): # Add this action as a supported action to all machine definitions if isinstance(container, DefinitionContainer) and container.getMetaDataEntry("type") == "machine": self._application.getMachineActionManager().addSupportedAction(container.getId(), self.getKey()) - def _onContainerRemoved(self, container): - # Remove definition_changes containers when a stack is removed - if container.getMetaDataEntry("type") in ["machine", "extruder_train"]: - definition_changes_id = container.definitionChanges.getId() - if self._isEmptyDefinitionChanges(definition_changes_id): - return - def _reset(self): - if not self._global_container_stack: + global_stack = self._application.getMachineManager().activeMachine + if not global_stack: return # Make sure there is a definition_changes container to store the machine settings - definition_changes_id = self._global_container_stack.definitionChanges.getId() - if self._isEmptyDefinitionChanges(definition_changes_id): - CuraStackBuilder.createDefinitionChangesContainer(self._global_container_stack, - self._global_container_stack.getName() + "_settings") - - # Notify the UI in which container to store the machine settings data - from cura.Settings.CuraContainerStack import _ContainerIndexes - - container_index = _ContainerIndexes.DefinitionChanges - if container_index != self._container_index: - self._container_index = container_index - self.containerIndexChanged.emit() + definition_changes_id = global_stack.definitionChanges.getId() + if isEmptyContainer(definition_changes_id): + CuraStackBuilder.createDefinitionChangesContainer(global_stack, + global_stack.getName() + "_settings") # Disable auto-slicing while the MachineAction is showing if self._backend: # This sometimes triggers before backend is loaded. self._backend.disableTimer() - @pyqtSlot() - def onFinishAction(self): - # Restore autoslicing when the machineaction is dismissed + def _onFinished(self): + # Restore auto-slicing when the machine action is dismissed if self._backend and self._backend.determineAutoSlicing(): + self._backend.enableTimer() self._backend.tickle() - containerIndexChanged = pyqtSignal() - - @pyqtProperty(int, notify = containerIndexChanged) - def containerIndex(self): - return self._container_index - - def _onGlobalContainerChanged(self): - self._global_container_stack = Application.getInstance().getGlobalContainerStack() - - # This additional emit is needed because we cannot connect a UM.Signal directly to a pyqtSignal - self.globalContainerChanged.emit() - - globalContainerChanged = pyqtSignal() - - @pyqtProperty(int, notify = globalContainerChanged) - def definedExtruderCount(self): - if not self._global_container_stack: - return 0 - - return len(self._global_container_stack.getMetaDataEntry("machine_extruder_trains")) - @pyqtSlot(int) - def setMachineExtruderCount(self, extruder_count): + def setMachineExtruderCount(self, extruder_count: int) -> None: # Note: this method was in this class before, but since it's quite generic and other plugins also need it # it was moved to the machine manager instead. Now this method just calls the machine manager. self._application.getMachineManager().setActiveMachineExtruderCount(extruder_count) @pyqtSlot() - def forceUpdate(self): + def forceUpdate(self) -> None: # Force rebuilding the build volume by reloading the global container stack. # This is a bit of a hack, but it seems quick enough. - self._application.globalContainerStackChanged.emit() + self._application.getMachineManager().globalContainerChanged.emit() @pyqtSlot() - def updateHasMaterialsMetadata(self): + def updateHasMaterialsMetadata(self) -> None: + global_stack = self._application.getMachineManager().activeMachine + # Updates the has_materials metadata flag after switching gcode flavor - if not self._global_container_stack: + if not global_stack: return - definition = self._global_container_stack.getBottom() + definition = global_stack.getDefinition() if definition.getProperty("machine_gcode_flavor", "value") != "UltiGCode" or definition.getMetaDataEntry("has_materials", False): # In other words: only continue for the UM2 (extended), but not for the UM2+ return machine_manager = self._application.getMachineManager() material_manager = self._application.getMaterialManager() - extruder_positions = list(self._global_container_stack.extruders.keys()) - has_materials = self._global_container_stack.getProperty("machine_gcode_flavor", "value") != "UltiGCode" + extruder_positions = list(global_stack.extruders.keys()) + has_materials = global_stack.getProperty("machine_gcode_flavor", "value") != "UltiGCode" material_node = None if has_materials: - self._global_container_stack.setMetaDataEntry("has_materials", True) + global_stack.setMetaDataEntry("has_materials", True) else: # The metadata entry is stored in an ini, and ini files are parsed as strings only. # Because any non-empty string evaluates to a boolean True, we have to remove the entry to make it False. - if "has_materials" in self._global_container_stack.getMetaData(): - self._global_container_stack.removeMetaDataEntry("has_materials") + if "has_materials" in global_stack.getMetaData(): + global_stack.removeMetaDataEntry("has_materials") # set materials for position in extruder_positions: if has_materials: - material_node = material_manager.getDefaultMaterial(self._global_container_stack, position, None) + material_node = material_manager.getDefaultMaterial(global_stack, position, None) machine_manager.setMaterial(position, material_node) self._application.globalContainerStackChanged.emit() @pyqtSlot(int) - def updateMaterialForDiameter(self, extruder_position: int): + def updateMaterialForDiameter(self, extruder_position: int) -> None: # Updates the material container to a material that matches the material diameter set for the printer self._application.getMachineManager().updateMaterialWithVariant(str(extruder_position)) diff --git a/plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml b/plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml index 270bd7e828..f941d13561 100644 --- a/plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml +++ b/plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml @@ -26,15 +26,15 @@ Item property int columnWidth: (parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2 property int columnSpacing: 3 - property int propertyStoreIndex: 5 // definition_changes + property int propertyStoreIndex: manager.storeContainerIndex // definition_changes property string extruderStackId: "" property int extruderPosition: 0 - property var forceUpdateFunction: CuraApplication.getMachineSettingsManager().forceUpdate + property var forceUpdateFunction: manager.forceUpdate function updateMaterialDiameter() { - CuraApplication.getMachineSettingsManager().updateMaterialForDiameter(extruderPosition) + manager.updateMaterialForDiameter(extruderPosition) } Item diff --git a/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml b/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml index c952e4cfb3..d9c6bcf539 100644 --- a/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml +++ b/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml @@ -26,11 +26,11 @@ Item property int columnWidth: (parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2 property int columnSpacing: 3 - property int propertyStoreIndex: 5 // definition_changes + property int propertyStoreIndex: manager.storeContainerIndex // definition_changes property string machineStackId: Cura.MachineManager.activeMachineId - property var forceUpdateFunction: CuraApplication.getMachineSettingsManager().forceUpdate + property var forceUpdateFunction: manager.forceUpdate Item { @@ -153,7 +153,7 @@ Item // FIXME(Lipu): better document this. // This has something to do with UM2 and UM2+ regarding "has_material" and the gcode flavor settings. // I don't remember exactly what. - afterOnEditingFinishedFunction: CuraApplication.getMachineSettingsManager().updateHasMaterialsMetadata + afterOnEditingFinishedFunction: manager.updateHasMaterialsMetadata } } @@ -277,8 +277,8 @@ Item // FIXME(Lipu): better document this. // This has something to do with UM2 and UM2+ regarding "has_material" and the gcode flavor settings. // I don't remember exactly what. - afterOnEditingFinishedFunction: CuraApplication.getMachineSettingsManager().updateHasMaterialsMetadata - setValueFunction: CuraApplication.getMachineSettingsManager().setMachineExtruderCount + afterOnEditingFinishedFunction: manager.updateHasMaterialsMetadata + setValueFunction: manager.setMachineExtruderCount optionModel: ListModel { diff --git a/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml index 0cd684e409..1bc4b7c284 100644 --- a/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml +++ b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml @@ -84,6 +84,9 @@ Item return } + // notify the current MachineAction that it has finished + currentActionItem.action.setFinished() + // move on to the next MachineAction currentActionIndex++ } } From f810f94b8a30da3603b4333e63f1fb5c94343a14 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 20 Mar 2019 08:59:45 +0100 Subject: [PATCH 20/33] WIP: Fix null warning in SettingsMenu.qml --- resources/qml/Menus/SettingsMenu.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/qml/Menus/SettingsMenu.qml b/resources/qml/Menus/SettingsMenu.qml index 00337ea8e1..f1f594f395 100644 --- a/resources/qml/Menus/SettingsMenu.qml +++ b/resources/qml/Menus/SettingsMenu.qml @@ -14,12 +14,14 @@ Menu PrinterMenu { title: catalog.i18nc("@title:menu menubar:settings", "&Printer") } + property var activeMachine: Cura.MachineManager.activeMachine + onAboutToShow: extruderInstantiator.active = true onAboutToHide: extruderInstantiator.active = false Instantiator { id: extruderInstantiator - model: Cura.MachineManager.activeMachine.extruderList + model: activeMachine == null ? null : activeMachine.extruderList active: false asynchronous: true Menu From 91acbca14124fad5f3b22eafab45282b3994ea3f Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 20 Mar 2019 14:04:59 +0100 Subject: [PATCH 21/33] Bind no printer label visible to item count --- resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml index 0d2aaca994..6cbfe46902 100644 --- a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml +++ b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml @@ -45,7 +45,7 @@ Item text: catalog.i18nc("@label", "There is no printer found over your network.") renderType: Text.NativeRendering verticalAlignment: Text.AlignVCenter - visible: !networkPrinterScrollView.visible + visible: networkPrinterListView.count == 0 // Do not show if there are discovered devices. } ScrollView From aa1ad9a93d50b06b7a59379ab7be89b53bf6f038 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 21 Mar 2019 09:31:24 +0100 Subject: [PATCH 22/33] Fix merge conflicts --- plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py index 5a41bfa72b..66be0200c4 100644 --- a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py +++ b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py @@ -27,17 +27,10 @@ from UM.Version import Version from . import ClusterUM3OutputDevice, LegacyUM3OutputDevice from .Cloud.CloudOutputDeviceManager import CloudOutputDeviceManager -<<<<<<< HEAD if TYPE_CHECKING: from cura.Settings.GlobalStack import GlobalStack from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin -======= -from typing import Optional, TYPE_CHECKING -if TYPE_CHECKING: - from cura.Settings.GlobalStack import GlobalStack - ->>>>>>> origin/WIP_onboarding i18n_catalog = i18nCatalog("cura") From c3175e53227ce1d38035515201bed58942a06f3f Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 21 Mar 2019 16:01:50 +0100 Subject: [PATCH 23/33] Theme welcome_pages_button --- resources/qml/WelcomePages/AddPrinterBySelectionContent.qml | 2 +- resources/qml/WelcomePages/CloudContent.qml | 6 +++--- resources/qml/WelcomePages/DataCollectionsContent.qml | 2 +- .../qml/WelcomePages/FirstStartMachineActionsContent.qml | 2 +- resources/qml/WelcomePages/UserAgreementContent.qml | 4 ++-- resources/qml/WelcomePages/WelcomeContent.qml | 2 +- resources/qml/WelcomePages/WhatsNewContent.qml | 2 +- resources/themes/cura-light/theme.json | 2 ++ 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/resources/qml/WelcomePages/AddPrinterBySelectionContent.qml b/resources/qml/WelcomePages/AddPrinterBySelectionContent.qml index faa2d259be..4b9ef1a779 100644 --- a/resources/qml/WelcomePages/AddPrinterBySelectionContent.qml +++ b/resources/qml/WelcomePages/AddPrinterBySelectionContent.qml @@ -127,7 +127,7 @@ Item } text: catalog.i18nc("@button", "Next") - width: 140 + width: UM.Theme.getSize("welcome_pages_button").width fixedWidthMode: true onClicked: { diff --git a/resources/qml/WelcomePages/CloudContent.qml b/resources/qml/WelcomePages/CloudContent.qml index 09e52c17dd..36c2431e7c 100644 --- a/resources/qml/WelcomePages/CloudContent.qml +++ b/resources/qml/WelcomePages/CloudContent.qml @@ -85,7 +85,7 @@ Item anchors.bottom: parent.bottom anchors.margins: 40 text: catalog.i18nc("@button", "Finish") - width: 140 + width: UM.Theme.getSize("welcome_pages_button").width fixedWidthMode: true onClicked: base.showNextPage() } @@ -97,7 +97,7 @@ Item anchors.verticalCenter: finishButton.verticalCenter anchors.margins: 40 text: catalog.i18nc("@button", "Create an account") - width: 140 + width: UM.Theme.getSize("welcome_pages_button").width fixedWidthMode: true onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl + "/app/create") } @@ -108,7 +108,7 @@ Item anchors.left: createAccountButton.right anchors.verticalCenter: finishButton.verticalCenter text: catalog.i18nc("@button", "Sign in") - width: 80 + width: UM.Theme.getSize("welcome_pages_button").width shadowEnabled: false color: "transparent" hoverColor: "transparent" diff --git a/resources/qml/WelcomePages/DataCollectionsContent.qml b/resources/qml/WelcomePages/DataCollectionsContent.qml index 93426d2c2c..c22434b9f1 100644 --- a/resources/qml/WelcomePages/DataCollectionsContent.qml +++ b/resources/qml/WelcomePages/DataCollectionsContent.qml @@ -62,7 +62,7 @@ Item anchors.bottom: parent.bottom anchors.margins: 40 text: catalog.i18nc("@button", "Next") - width: 140 + width: UM.Theme.getSize("welcome_pages_button").width fixedWidthMode: true onClicked: base.showNextPage() } diff --git a/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml index 1bc4b7c284..d02f3cfcb0 100644 --- a/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml +++ b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml @@ -72,7 +72,7 @@ Item anchors.bottom: parent.bottom anchors.margins: 40 text: catalog.i18nc("@button", "Next") - width: 140 + width: UM.Theme.getSize("welcome_pages_button").width fixedWidthMode: true onClicked: { diff --git a/resources/qml/WelcomePages/UserAgreementContent.qml b/resources/qml/WelcomePages/UserAgreementContent.qml index 82b16ba2ee..493f42e6f2 100644 --- a/resources/qml/WelcomePages/UserAgreementContent.qml +++ b/resources/qml/WelcomePages/UserAgreementContent.qml @@ -60,7 +60,7 @@ Item anchors.bottom: parent.bottom anchors.margins: 40 text: catalog.i18nc("@button", "Agree") - width: 140 + width: UM.Theme.getSize("welcome_pages_button").width fixedWidthMode: true onClicked: { @@ -77,7 +77,7 @@ Item anchors.bottom: parent.bottom anchors.margins: 40 text: catalog.i18nc("@button", "Decline and close") - width: 140 + width: UM.Theme.getSize("welcome_pages_button").width fixedWidthMode: true onClicked: { diff --git a/resources/qml/WelcomePages/WelcomeContent.qml b/resources/qml/WelcomePages/WelcomeContent.qml index fe47567da6..272c7bda47 100644 --- a/resources/qml/WelcomePages/WelcomeContent.qml +++ b/resources/qml/WelcomePages/WelcomeContent.qml @@ -59,7 +59,7 @@ Column id: getStartedButton anchors.horizontalCenter: parent.horizontalCenter text: catalog.i18nc("@button", "Get started") - width: 140 + width: UM.Theme.getSize("welcome_pages_button").width fixedWidthMode: true onClicked: base.showNextPage() } diff --git a/resources/qml/WelcomePages/WhatsNewContent.qml b/resources/qml/WelcomePages/WhatsNewContent.qml index b083c99e32..351f2f07b7 100644 --- a/resources/qml/WelcomePages/WhatsNewContent.qml +++ b/resources/qml/WelcomePages/WhatsNewContent.qml @@ -78,7 +78,7 @@ Item anchors.bottom: parent.bottom anchors.margins: 40 text: catalog.i18nc("@button", "Next") - width: 140 + width: UM.Theme.getSize("welcome_pages_button").width fixedWidthMode: true onClicked: base.showNextPage() } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 83edda6486..61797350e5 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -509,6 +509,8 @@ "button_icon": [2.5, 2.5], "button_lining": [0, 0], + "welcome_pages_button": [12.0, 2.5], + "action_button": [15.0, 2.5], "action_button_icon": [1.0, 1.0], "action_button_radius": [0.15, 0.15], From e632b508ebb25b253603de45a4899e4e2cb9d20d Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 22 Mar 2019 10:28:17 +0100 Subject: [PATCH 24/33] Rename to AddNetworkOrLocalPrinterContent --- cura/UI/WelcomePagesModel.py | 4 ++-- ...lectionContent.qml => AddNetworkOrLocalPrinterContent.qml} | 0 resources/qml/WelcomePages/AddPrinterByIpContent.qml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename resources/qml/WelcomePages/{AddPrinterBySelectionContent.qml => AddNetworkOrLocalPrinterContent.qml} (100%) diff --git a/cura/UI/WelcomePagesModel.py b/cura/UI/WelcomePagesModel.py index 1e9a2a124b..bf33ba7baa 100644 --- a/cura/UI/WelcomePagesModel.py +++ b/cura/UI/WelcomePagesModel.py @@ -47,8 +47,8 @@ class WelcomePagesModel(ListModel): self._pages.append({"id": "data_collections", "page_url": self._getBuiltinWelcomePagePath("DataCollectionsContent.qml"), }) - self._pages.append({"id": "add_printer_by_selection", - "page_url": self._getBuiltinWelcomePagePath("AddPrinterBySelectionContent.qml"), + self._pages.append({"id": "add_network_or_local_printer", + "page_url": self._getBuiltinWelcomePagePath("AddNetworkOrLocalPrinterContent.qml"), }) self._pages.append({"id": "add_printer_by_ip", "page_url": self._getBuiltinWelcomePagePath("AddPrinterByIpContent.qml"), diff --git a/resources/qml/WelcomePages/AddPrinterBySelectionContent.qml b/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml similarity index 100% rename from resources/qml/WelcomePages/AddPrinterBySelectionContent.qml rename to resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml diff --git a/resources/qml/WelcomePages/AddPrinterByIpContent.qml b/resources/qml/WelcomePages/AddPrinterByIpContent.qml index e71efb09aa..696db894b5 100644 --- a/resources/qml/WelcomePages/AddPrinterByIpContent.qml +++ b/resources/qml/WelcomePages/AddPrinterByIpContent.qml @@ -204,7 +204,7 @@ Item text: catalog.i18nc("@button", "Cancel") width: UM.Theme.getSize("action_button").width fixedWidthMode: true - onClicked: base.goToPage("add_printer_by_selection") + onClicked: base.goToPage("add_network_or_local_printer") } Cura.PrimaryButton From 03155d24dad123402bfd546c901b4c701554bb4b Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 22 Mar 2019 10:35:41 +0100 Subject: [PATCH 25/33] Remove unneeded property assignment --- resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml b/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml index 69a5a99ac1..b8a5afb43e 100644 --- a/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml +++ b/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml @@ -101,8 +101,6 @@ Item AddLocalPrinterScrollView { id: localPrinterView - - maxItemCountAtOnce: 10 // show at max 10 items at once, otherwise you need to scroll. } } } From 67428aee537a05e1c3d9ee528099245687c13bf3 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 22 Mar 2019 12:55:25 +0100 Subject: [PATCH 26/33] Cleanup unnecessary hard-coded numbers in styling --- resources/qml/WelcomePages/DropDownWidget.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/qml/WelcomePages/DropDownWidget.qml b/resources/qml/WelcomePages/DropDownWidget.qml index cff9cf8ac1..43f92218fc 100644 --- a/resources/qml/WelcomePages/DropDownWidget.qml +++ b/resources/qml/WelcomePages/DropDownWidget.qml @@ -21,14 +21,14 @@ Item id: base - implicitWidth: 200 - height: header.contentShown ? (header.height + contentRectangle.height + 30) : header.height + implicitWidth: 200 * screenScaleFactor + height: header.contentShown ? (header.height + contentRectangle.height) : header.height property var contentComponent: null property alias contentItem: contentLoader.item property alias title: header.title - property bool contentShown: false + property bool contentShown: false // indicates if this dropdown widget is expanded to show its content signal clicked() @@ -59,7 +59,7 @@ Item anchors.top: header.bottom anchors.left: header.left anchors.right: header.right - height: contentLoader.height + 2 + height: contentLoader.height border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") From d52f9600b11504c967078a600dee702c0ae9f9d6 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 26 Mar 2019 09:02:28 +0100 Subject: [PATCH 27/33] Fix binding loop in CloudContent --- resources/qml/WelcomePages/CloudContent.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/WelcomePages/CloudContent.qml b/resources/qml/WelcomePages/CloudContent.qml index 6c0a7ae53e..5ecda41a89 100644 --- a/resources/qml/WelcomePages/CloudContent.qml +++ b/resources/qml/WelcomePages/CloudContent.qml @@ -43,7 +43,7 @@ Item Column { anchors.centerIn: parent - width: childrenRect.width + width: parent.width height: childrenRect.height spacing: 20 * screenScaleFactor From 92d95a1c00f3fbaa7b4e9b26f99296328087d97a Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 26 Mar 2019 10:34:38 +0100 Subject: [PATCH 28/33] Move page index logic into WelcomePagesModel --- cura/UI/WelcomePagesModel.py | 101 +++++++++++++++++- resources/qml/Cura.qml | 1 - .../AddNetworkOrLocalPrinterContent.qml | 2 +- .../WelcomePages/AddPrinterByIpContent.qml | 2 +- .../FirstStartMachineActionsContent.qml | 3 +- resources/qml/WelcomePages/StepPanel.qml | 62 ++--------- resources/qml/WelcomePages/WelcomeDialog.qml | 13 ++- 7 files changed, 122 insertions(+), 62 deletions(-) diff --git a/cura/UI/WelcomePagesModel.py b/cura/UI/WelcomePagesModel.py index bf33ba7baa..5c3fd67f0b 100644 --- a/cura/UI/WelcomePagesModel.py +++ b/cura/UI/WelcomePagesModel.py @@ -1,10 +1,12 @@ # Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. +from collections import deque import os -from typing import TYPE_CHECKING, Optional, List, Dict, Any +from typing import TYPE_CHECKING, Optional, List, Dict, Any, Deque -from PyQt5.QtCore import QUrl, Qt +from PyQt5.QtCore import QUrl, Qt, pyqtSlot, pyqtProperty, pyqtSignal +from UM.Logger import Logger from UM.Qt.ListModel import ListModel from UM.Resources import Resources @@ -27,6 +29,99 @@ class WelcomePagesModel(ListModel): self._pages = [] # type: List[Dict[str, Any]] + self._current_page_index = 0 + # Store all the previous page indices so it can go back. + self._previous_page_indices_stack = deque() # type: Deque[int] + + allFinished = pyqtSignal() # emitted when all steps have been finished + currentPageIndexChanged = pyqtSignal() + + @pyqtProperty(int, notify = currentPageIndexChanged) + def currentPageIndex(self) -> int: + return self._current_page_index + + # Returns a float number in [0, 1] which indicates the current progress. + @pyqtProperty(float, notify = currentPageIndexChanged) + def currentProgress(self) -> float: + return self._current_page_index / len(self._items) + + # Indicates if the current page is the last page. + @pyqtProperty(bool, notify = currentPageIndexChanged) + def isCurrentPageLast(self) -> bool: + return self._current_page_index == len(self._items) - 1 + + def _setCurrentPageIndex(self, page_index: int) -> None: + if page_index != self._current_page_index: + self._previous_page_indices_stack.append(self._current_page_index) + self._current_page_index = page_index + self.currentPageIndexChanged.emit() + + # Goes to the next page. + @pyqtSlot() + def goToNextPage(self) -> None: + page_item = self._items[self._current_page_index] + # Check if there's a "next_page_id" assigned. If so, go to that page. Otherwise, go to the page with the + # current index + 1. + next_page_id = page_item.get("next_page_id") + next_page_index = self._current_page_index + 1 + if next_page_id: + idx = self.getPageIndexById(next_page_id) + if idx is None: + # FIXME: If we cannot find the next page, we cannot do anything here. + Logger.log("e", "Cannot find page with ID [%s]", next_page_id) + return + next_page_index = idx + + # If we have reached the last page, emit allFinished signal and reset. + if next_page_index == len(self._items): + self.allFinished.emit() + self.resetState() + + # Move to the next page + self._setCurrentPageIndex(next_page_index) + + # Goes to the previous page. If there's no previous page, do nothing. + @pyqtSlot() + def goToPreviousPage(self) -> None: + if len(self._previous_page_indices_stack) == 0: + Logger.log("i", "No previous page, do nothing") + return + + previous_page_index = self._previous_page_indices_stack.pop() + self._current_page_index = previous_page_index + self.currentPageIndexChanged.emit() + + # Sets the current page to the given page ID. If the page ID is not found, do nothing. + @pyqtSlot(str) + def goToPage(self, page_id: str) -> None: + page_index = self.getPageIndexById(page_id) + if page_index is None: + # FIXME: If we cannot find the next page, we cannot do anything here. + Logger.log("e", "Cannot find page with ID [%s]", page_index) + return + + # Move to that page + self._setCurrentPageIndex(page_index) + + # Resets the state of the WelcomePagesModel. This functions does the following: + # - Resets current_page_index to 0 + # - Clears the previous page indices stack + @pyqtSlot() + def resetState(self) -> None: + self._current_page_index = 0 + self._previous_page_indices_stack.clear() + + self.currentPageIndexChanged.emit() + + # Gets the page index with the given page ID. If the page ID doesn't exist, returns None. + def getPageIndexById(self, page_id: str) -> Optional[int]: + page_idx = None + for idx, page_item in enumerate(self._items): + if page_item["id"] == page_id: + page_idx = idx + break + return page_idx + # Convenience function to get QUrl path to pages that's located in "resources/qml/WelcomePages". def _getBuiltinWelcomePagePath(self, page_filename: str) -> "QUrl": from cura.CuraApplication import CuraApplication @@ -49,9 +144,11 @@ class WelcomePagesModel(ListModel): }) self._pages.append({"id": "add_network_or_local_printer", "page_url": self._getBuiltinWelcomePagePath("AddNetworkOrLocalPrinterContent.qml"), + "next_page_id": "machine_actions", }) self._pages.append({"id": "add_printer_by_ip", "page_url": self._getBuiltinWelcomePagePath("AddPrinterByIpContent.qml"), + "next_page_id": "machine_actions", }) self._pages.append({"id": "machine_actions", "page_url": self._getBuiltinWelcomePagePath("FirstStartMachineActionsContent.qml"), diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 37a34ebb52..6ee0e090a1 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -77,7 +77,6 @@ UM.MainWindow if (CuraApplication.needToShowUserAgreement) { welcomeDialog.visible = true; - welcomeDialog.currentStep = 0; } else { diff --git a/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml b/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml index 8117957d46..75e5c58724 100644 --- a/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml +++ b/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml @@ -145,7 +145,7 @@ Item const localPrinterItem = addLocalPrinterDropDown.contentItem.currentItem Cura.MachineManager.addMachine(localPrinterItem.id) - base.goToPage("machine_actions") + base.showNextPage() } } } diff --git a/resources/qml/WelcomePages/AddPrinterByIpContent.qml b/resources/qml/WelcomePages/AddPrinterByIpContent.qml index a0b0e3c2cd..4fdffa5a79 100644 --- a/resources/qml/WelcomePages/AddPrinterByIpContent.qml +++ b/resources/qml/WelcomePages/AddPrinterByIpContent.qml @@ -247,7 +247,7 @@ Item text: catalog.i18nc("@button", "Cancel") width: UM.Theme.getSize("action_button").width fixedWidthMode: true - onClicked: base.goToPage("add_network_or_local_printer") + onClicked: base.showPreviousPage() } Cura.PrimaryButton diff --git a/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml index 4dbdd57916..6b4a79a24a 100644 --- a/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml +++ b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml @@ -33,6 +33,7 @@ Item { if (visible) { + // Reset the action to start from the beginning when it is shown. currentActionIndex = 0 if (!hasActions) { @@ -48,7 +49,7 @@ Item anchors.topMargin: UM.Theme.getSize("welcome_pages_default_margin").height anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter - text: currentActionItem.title + text: currentActionItem == null ? "" : currentActionItem.title color: UM.Theme.getColor("primary_button") font: UM.Theme.getFont("large_bold") renderType: Text.NativeRendering diff --git a/resources/qml/WelcomePages/StepPanel.qml b/resources/qml/WelcomePages/StepPanel.qml index e3ae0cd17c..f1a4e5a4c8 100644 --- a/resources/qml/WelcomePages/StepPanel.qml +++ b/resources/qml/WelcomePages/StepPanel.qml @@ -21,70 +21,30 @@ Item property int stepBarHeight: 12 property int contentMargins: 1 - property int currentStep: 0 - property int totalStepCount: (model == null) ? 0 : model.count - property real progressValue: (totalStepCount == 0) ? 0 : (currentStep / totalStepCount) - - property var currentItem: (model == null) ? null : model.getItem(currentStep) + property var currentItem: (model == null) ? null : model.getItem(model.currentPageIndex) property var model: null + property var progressValue: model == null ? 0 : model.currentProgress + property string pageUrl: currentItem == null ? null : currentItem.page_url + signal showNextPage() signal showPreviousPage() - signal passLastPage() // Emitted when there is no more page to show signal goToPage(string page_id) // Go to a specific page by the given page_id. - onShowNextPage: - { - if (currentStep < totalStepCount - 1) - { - currentStep++ - } - else - { - passLastPage() - } - } - - onShowPreviousPage: - { - if (currentStep > 0) - { - currentStep-- - } - } - - onGoToPage: - { - // find the page index - var page_index = -1 - for (var i = 0; i < base.model.count; i++) - { - const item = base.model.getItem(i) - if (item.id == page_id) - { - page_index = i - break - } - } - if (page_index >= 0) - { - currentStep = page_index - } - } + // Call the corresponding functions in the model + onShowNextPage: model.goToNextPage() + onShowPreviousPage: model.goToPreviousPage() + onGoToPage: model.goToPage(page_id) onVisibleChanged: { if (visible) { - base.currentStep = 0 - base.currentItem = base.model.getItem(base.currentStep) + model.resetState() } } - onModelChanged: - { - base.currentStep = 0 - } + onModelChanged: model.resetState() // Panel background Rectangle @@ -137,6 +97,6 @@ Item left: parent.left right: parent.right } - source: base.currentItem.page_url + source: base.pageUrl } } diff --git a/resources/qml/WelcomePages/WelcomeDialog.qml b/resources/qml/WelcomePages/WelcomeDialog.qml index 626b6b6877..17b983ed0e 100644 --- a/resources/qml/WelcomePages/WelcomeDialog.qml +++ b/resources/qml/WelcomePages/WelcomeDialog.qml @@ -9,8 +9,12 @@ import UM 1.3 as UM import Cura 1.1 as Cura +// +// This is a no-frame dialog that shows the welcome process. +// Window { + id: dialog UM.I18nCatalog { id: catalog; name: "cura" } title: catalog.i18nc("@title", "Welcome to Ultimaker Cura") @@ -21,19 +25,18 @@ Window height: 600 // TODO color: "transparent" - property alias currentStep: stepPanel.currentStep + property var model: CuraApplication.getWelcomePagesModel() StepPanel { id: stepPanel - currentStep: 0 - model: CuraApplication.getWelcomePagesModel() + model: dialog.model } // Close this dialog when there's no more page to show Connections { - target: stepPanel - onPassLastPage: close() + target: model + onAllFinished: close() } } From f99affd4f577a7ca59c0bab84ee599912f1a47b7 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 26 Mar 2019 14:46:06 +0100 Subject: [PATCH 29/33] Create Cura.RadioButton --- .../AddLocalPrinterScrollView.qml | 42 +-------------- resources/qml/Widgets/RadioButton.qml | 53 +++++++++++++++++++ resources/qml/qmldir | 1 + 3 files changed, 55 insertions(+), 41 deletions(-) create mode 100644 resources/qml/Widgets/RadioButton.qml diff --git a/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml b/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml index f8db8b297e..d55d8f84ae 100644 --- a/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml +++ b/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml @@ -129,7 +129,7 @@ ScrollView { id: machineButton - RadioButton + Cura.RadioButton { id: radioButton anchors.left: parent.left @@ -140,47 +140,7 @@ ScrollView checked: ListView.view.currentIndex == index text: name - font: UM.Theme.getFont("default") visible: base.currentSection == section - - background: Item - { - anchors.fill: parent - } - - indicator: Rectangle - { - implicitWidth: UM.Theme.getSize("radio_button").width - implicitHeight: UM.Theme.getSize("radio_button").height - anchors.verticalCenter: parent.verticalCenter - radius: (width / 2) | 0 - border.width: UM.Theme.getSize("default_lining").width - border.color: radioButton.hovered ? UM.Theme.getColor("small_button_text") : UM.Theme.getColor("small_button_text_hover") - - Rectangle - { - width: (parent.width / 2) | 0 - height: width - anchors.centerIn: parent - radius: (width / 2) | 0 - color: radioButton.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("primary_button") - visible: radioButton.checked - } - } - - contentItem: Label - { - verticalAlignment: Text.AlignVCenter - leftPadding: radioButton.indicator.width + radioButton.spacing - text: radioButton.text - font: radioButton.font - renderType: Text.NativeRendering - } - - onClicked: - { - ListView.view.currentIndex = index - } } } } diff --git a/resources/qml/Widgets/RadioButton.qml b/resources/qml/Widgets/RadioButton.qml new file mode 100644 index 0000000000..e17a38d833 --- /dev/null +++ b/resources/qml/Widgets/RadioButton.qml @@ -0,0 +1,53 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 + +import UM 1.3 as UM +import Cura 1.0 as Cura + + +// +// Cura-style RadioButton. +// +RadioButton +{ + id: radioButton + + font: UM.Theme.getFont("default") + + background: Item + { + anchors.fill: parent + } + + indicator: Rectangle + { + implicitWidth: UM.Theme.getSize("radio_button").width + implicitHeight: UM.Theme.getSize("radio_button").height + anchors.verticalCenter: parent.verticalCenter + radius: (width / 2) | 0 + border.width: UM.Theme.getSize("default_lining").width + border.color: radioButton.hovered ? UM.Theme.getColor("small_button_text") : UM.Theme.getColor("small_button_text_hover") + + Rectangle + { + width: (parent.width / 2) | 0 + height: width + anchors.centerIn: parent + radius: (width / 2) | 0 + color: radioButton.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("primary_button") + visible: radioButton.checked + } + } + + contentItem: Label + { + verticalAlignment: Text.AlignVCenter + leftPadding: radioButton.indicator.width + radioButton.spacing + text: radioButton.text + font: radioButton.font + renderType: Text.NativeRendering + } +} diff --git a/resources/qml/qmldir b/resources/qml/qmldir index 7ca2b36b4b..a73d154c6a 100644 --- a/resources/qml/qmldir +++ b/resources/qml/qmldir @@ -24,6 +24,7 @@ ToolTip 1.0 ToolTip.qml CheckBox 1.0 CheckBox.qml ComboBox 1.0 ComboBox.qml ProgressBar 1.0 ProgressBar.qml +RadioButton 1.0 RadioButton.qml TabButton 1.0 TabButton.qml From 2511b7a26a9aee25abd6c041d43e31b41efaf797 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 26 Mar 2019 15:18:54 +0100 Subject: [PATCH 30/33] Implement More-info button on Data Collection page --- .../WelcomePages/DataCollectionsContent.qml | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/resources/qml/WelcomePages/DataCollectionsContent.qml b/resources/qml/WelcomePages/DataCollectionsContent.qml index 9c5ed3820f..8b67e1fdeb 100644 --- a/resources/qml/WelcomePages/DataCollectionsContent.qml +++ b/resources/qml/WelcomePages/DataCollectionsContent.qml @@ -36,11 +36,12 @@ Item anchors.bottom: getStartedButton.top anchors.left: parent.left anchors.right: parent.right - anchors.margins: UM.Theme.getSize("default_margin").width + anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width Column { anchors.centerIn: parent + width: parent.width spacing: UM.Theme.getSize("welcome_pages_default_margin").height @@ -54,12 +55,29 @@ Item Label { id: textLabel + width: parent.width anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter - text: catalog.i18nc("@text", "Ultimaker Cura collects anonymous data to improve print quality
and user experience. More information") + text: + { + var t = catalog.i18nc("@text", "Ultimaker Cura collects anonymous data to improve print quality and user experience.") + var t2 = catalog.i18nc("@text", "More information") + t += " " + t2 + "" + return t + } textFormat: Text.RichText + wrapMode: Text.WordWrap font: UM.Theme.getFont("medium") renderType: Text.NativeRendering + + MouseArea + { + anchors.fill: parent + onClicked: + { + CuraApplication.showMoreInformationDialogForAnonymousDataCollection() + } + } } } } From 6dbae6f088e4c03fee93ee686b5f976877195ed2 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 27 Mar 2019 09:34:48 +0100 Subject: [PATCH 31/33] Show machine actions page optionally --- .../Models/FirstStartMachineActionsModel.py | 48 +++++++++- cura/UI/WelcomePagesModel.py | 94 ++++++++++++++----- .../FirstStartMachineActionsContent.qml | 48 ++++------ 3 files changed, 136 insertions(+), 54 deletions(-) diff --git a/cura/Machines/Models/FirstStartMachineActionsModel.py b/cura/Machines/Models/FirstStartMachineActionsModel.py index aabf8b8a8a..73deb6ac24 100644 --- a/cura/Machines/Models/FirstStartMachineActionsModel.py +++ b/cura/Machines/Models/FirstStartMachineActionsModel.py @@ -1,9 +1,9 @@ # Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. -from typing import Optional +from typing import Optional, Dict, Any -from PyQt5.QtCore import QObject, Qt +from PyQt5.QtCore import QObject, Qt, pyqtProperty, pyqtSignal, pyqtSlot from UM.Qt.ListModel import ListModel @@ -27,6 +27,8 @@ class FirstStartMachineActionsModel(ListModel): self.addRoleName(self.ContentRole, "content") self.addRoleName(self.ActionRole, "action") + self._current_action_index = 0 + from cura.CuraApplication import CuraApplication self._application = CuraApplication.getInstance() @@ -36,6 +38,47 @@ class FirstStartMachineActionsModel(ListModel): self._application.getMachineManager().globalContainerChanged.connect(self._update) self._update() + currentActionIndexChanged = pyqtSignal() + allFinished = pyqtSignal() # Emitted when all actions have been finished. + + @pyqtProperty(int, notify = currentActionIndexChanged) + def currentActionIndex(self) -> int: + return self._current_action_index + + @pyqtProperty("QVariantMap", notify = currentActionIndexChanged) + def currentItem(self) -> Optional[Dict[str, Any]]: + if self._current_action_index >= self.count: + return dict() + else: + return self.getItem(self._current_action_index) + + @pyqtProperty(bool, notify = currentActionIndexChanged) + def hasMoreActions(self) -> bool: + return self._current_action_index < self.count - 1 + + @pyqtSlot() + def goToNextAction(self) -> None: + # finish the current item + if "action" in self.currentItem: + self.currentItem["action"].setFinished() + + if not self.hasMoreActions: + self.allFinished.emit() + self.reset() + return + + self._current_action_index += 1 + self.currentActionIndexChanged.emit() + + # Resets the current action index to 0 so the wizard panel can show actions from the beginning. + @pyqtSlot() + def reset(self) -> None: + self._current_action_index = 0 + self.currentActionIndexChanged.emit() + + if self.count == 0: + self.allFinished.emit() + def _update(self) -> None: global_stack = self._application.getMachineManager().activeMachine if global_stack is None: @@ -53,6 +96,7 @@ class FirstStartMachineActionsModel(ListModel): }) self.setItems(item_list) + self.reset() __all__ = ["FirstStartMachineActionsModel"] diff --git a/cura/UI/WelcomePagesModel.py b/cura/UI/WelcomePagesModel.py index 6cbe59e349..5cb29436d9 100644 --- a/cura/UI/WelcomePagesModel.py +++ b/cura/UI/WelcomePagesModel.py @@ -13,7 +13,20 @@ from UM.Resources import Resources if TYPE_CHECKING: from PyQt5.QtCore import QObject - +# +# This is the Qt ListModel that contains all welcome pages data. Each page is a page that can be shown as a step in the +# welcome wizard dialog. Each item in this ListModel represents a page, which contains the following fields: +# +# - id : A unique page_id which can be used in function goToPage(page_id) +# - page_url : The QUrl to the QML file that contains the content of this page +# - next_page_id : (OPTIONAL) The next page ID to go to when this page finished. This is optional. If this is not +# provided, it will go to the page with the current index + 1 +# - should_show_function : (OPTIONAL) An optional function that returns True/False indicating if this page should be +# shown. By default all pages should be shown. If a function returns False, that page will +# be skipped and its next page will be shown. +# +# Note that in any case, a page that has its "should_show_function" == False will ALWAYS be skipped. +# class WelcomePagesModel(ListModel): IdRole = Qt.UserRole + 1 # Page ID @@ -57,26 +70,40 @@ class WelcomePagesModel(ListModel): self.currentPageIndexChanged.emit() # Goes to the next page. + # If "from_index" is given, it will look for the next page to show starting from the "from_index" page instead of + # the "self._current_page_index". @pyqtSlot() - def goToNextPage(self) -> None: - page_item = self._items[self._current_page_index] - # Check if there's a "next_page_id" assigned. If so, go to that page. Otherwise, go to the page with the - # current index + 1. - next_page_id = page_item.get("next_page_id") - next_page_index = self._current_page_index + 1 - if next_page_id: - idx = self.getPageIndexById(next_page_id) - if idx is None: - # FIXME: If we cannot find the next page, we cannot do anything here. - Logger.log("e", "Cannot find page with ID [%s]", next_page_id) - return - next_page_index = idx + def goToNextPage(self, from_index: Optional[int] = None) -> None: + # Look for the next page that should be shown + current_index = self._current_page_index if from_index is None else from_index + while True: + page_item = self._items[current_index] - # If we have reached the last page, emit allFinished signal and reset. - if next_page_index == len(self._items): - self.allFinished.emit() - self.resetState() - return + # Check if there's a "next_page_id" assigned. If so, go to that page. Otherwise, go to the page with the + # current index + 1. + next_page_id = page_item.get("next_page_id") + next_page_index = current_index + 1 + if next_page_id: + idx = self.getPageIndexById(next_page_id) + if idx is None: + # FIXME: If we cannot find the next page, we cannot do anything here. + Logger.log("e", "Cannot find page with ID [%s]", next_page_id) + return + next_page_index = idx + + # If we have reached the last page, emit allFinished signal and reset. + if next_page_index == len(self._items): + self.allFinished.emit() + self.resetState() + return + + # Check if the this page should be shown (default yes), if not, keep looking for the next one. + next_page_item = self.getItem(next_page_index) + if self._shouldPageBeShown(next_page_index): + break + + Logger.log("d", "Page [%s] should not be displayed, look for the next page.", next_page_item["id"]) + current_index = next_page_index # Move to the next page self._setCurrentPageIndex(next_page_index) @@ -101,8 +128,19 @@ class WelcomePagesModel(ListModel): Logger.log("e", "Cannot find page with ID [%s]", page_index) return - # Move to that page - self._setCurrentPageIndex(page_index) + if self._shouldPageBeShown(page_index): + # Move to that page if it should be shown + self._setCurrentPageIndex(page_index) + else: + # Find the next page to show starting from the "page_index" + self.goToNextPage(from_index = page_index) + + # Checks if the page with the given index should be shown by calling the "should_show_function" associated with it. + # If the function is not present, returns True (show page by default). + def _shouldPageBeShown(self, page_index: int) -> bool: + next_page_item = self.getItem(page_index) + should_show_function = next_page_item.get("should_show_function", lambda: True) + return should_show_function() # Resets the state of the WelcomePagesModel. This functions does the following: # - Resets current_page_index to 0 @@ -154,6 +192,7 @@ class WelcomePagesModel(ListModel): self._pages.append({"id": "machine_actions", "page_url": self._getBuiltinWelcomePagePath("FirstStartMachineActionsContent.qml"), "next_page_id": "cloud", + "should_show_function": self.shouldShowMachineActions, }) self._pages.append({"id": "cloud", "page_url": self._getBuiltinWelcomePagePath("CloudContent.qml"), @@ -161,6 +200,19 @@ class WelcomePagesModel(ListModel): self.setItems(self._pages) + # Indicates if the machine action panel should be shown by checking if there's any first start machine actions + # available. + def shouldShowMachineActions(self) -> bool: + from cura.CuraApplication import CuraApplication + application = CuraApplication.getInstance() + global_stack = application.getMachineManager().activeMachine + if global_stack is None: + return False + + definition_id = global_stack.definition.getId() + first_start_actions = application.getMachineActionManager().getFirstStartActions(definition_id) + return len(first_start_actions) > 0 + def addPage(self) -> None: pass diff --git a/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml index 6b4a79a24a..f1a178e018 100644 --- a/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml +++ b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml @@ -17,25 +17,19 @@ Item property var machineActionsModel: CuraApplication.getFirstStartMachineActionsModel() - property int currentActionIndex: 0 - property var currentActionItem: currentActionIndex >= machineActionsModel.count - ? null : machineActionsModel.getItem(currentActionIndex) - property bool hasActions: machineActionsModel.count > 0 + Component.onCompleted: + { + // Reset the action to start from the beginning when it is shown. + machineActionsModel.reset() + } - // Reset to the first page if the model gets changed. + // Go to the next page when all machine actions have been finished Connections { target: machineActionsModel - onItemsChanged: currentActionIndex = 0 - } - - onVisibleChanged: - { - if (visible) + onAllFinished: { - // Reset the action to start from the beginning when it is shown. - currentActionIndex = 0 - if (!hasActions) + if (visible) { base.showNextPage() } @@ -49,7 +43,7 @@ Item anchors.topMargin: UM.Theme.getSize("welcome_pages_default_margin").height anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter - text: currentActionItem == null ? "" : currentActionItem.title + text: machineActionsModel.currentItem.title == undefined ? "" : machineActionsModel.currentItem.title color: UM.Theme.getColor("primary_button") font: UM.Theme.getFont("large_bold") renderType: Text.NativeRendering @@ -63,7 +57,13 @@ Item anchors.left: parent.left anchors.right: parent.right - data: currentActionItem == undefined ? null : currentActionItem.content + data: machineActionsModel.currentItem.content == undefined ? emptyItem : machineActionsModel.currentItem.content + } + + // An empty item in case there's no currentItem.content to show + Item + { + id: emptyItem } Cura.PrimaryButton @@ -75,20 +75,6 @@ Item text: catalog.i18nc("@button", "Next") width: UM.Theme.getSize("welcome_pages_button").width fixedWidthMode: true - onClicked: - { - // If no more first-start actions to show, go to the next page. - if (currentActionIndex + 1 >= machineActionsModel.count) - { - currentActionIndex = 0 - base.showNextPage() - return - } - - // notify the current MachineAction that it has finished - currentActionItem.action.setFinished() - // move on to the next MachineAction - currentActionIndex++ - } + onClicked: machineActionsModel.goToNextAction() } } From 9091eaa6f853cf8f49551609ddf39bb5520be2d1 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 27 Mar 2019 17:20:17 +0100 Subject: [PATCH 32/33] Re-added the imports to the conftest These are really really needed, otherwise the tests wont run. I've added a few more comments to further stress the importance of these. CURA-6057 --- tests/conftest.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 5336c28fba..7f46c202b3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -6,10 +6,15 @@ import unittest.mock import pytest +# Prevents error: "PyCapsule_GetPointer called with incorrect name" with conflicting SIP configurations between Arcus and PyQt: Import Arcus and Savitar first! +import Savitar # Dont remove this line +import Arcus # No really. Don't. It needs to be there! +from UM.Qt.QtApplication import QtApplication # QtApplication import is required, even though it isn't used. +# Even though your IDE says these files are not used, don't believe it. It's lying. They need to be there. + from cura.CuraApplication import CuraApplication from cura.UI.MachineActionManager import MachineActionManager - # Create a CuraApplication object that will be shared among all tests. It needs to be initialized. # Since we need to use it more that once, we create the application the first time and use its instance afterwards. @pytest.fixture() From 84aa7fd007ef037a5ce6c15efd1883912ae941a5 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 27 Mar 2019 17:40:33 +0100 Subject: [PATCH 33/33] Fix mypy type errors CURA-6057 --- cura/UI/ObjectsModel.py | 8 +++++--- cura/UI/TextManager.py | 14 +++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/cura/UI/ObjectsModel.py b/cura/UI/ObjectsModel.py index 09304451a5..36d590a668 100644 --- a/cura/UI/ObjectsModel.py +++ b/cura/UI/ObjectsModel.py @@ -51,12 +51,14 @@ class ObjectsModel(ListModel): group_nr = 1 name_count_dict = defaultdict(int) # type: Dict[str, int] - for node in DepthFirstIterator(Application.getInstance().getController().getScene().getRoot()): + for node in DepthFirstIterator(Application.getInstance().getController().getScene().getRoot()): # type: ignore if not isinstance(node, SceneNode): continue if (not node.getMeshData() and not node.callDecoration("getLayerData")) and not node.callDecoration("isGroup"): continue - if node.getParent() and node.getParent().callDecoration("isGroup"): + + parent = node.getParent() + if parent and parent.callDecoration("isGroup"): continue # Grouped nodes don't need resetting as their parent (the group) is resetted) if not node.callDecoration("isSliceable") and not node.callDecoration("isGroup"): continue @@ -72,7 +74,7 @@ class ObjectsModel(ListModel): group_nr += 1 if hasattr(node, "isOutsideBuildArea"): - is_outside_build_area = node.isOutsideBuildArea() + is_outside_build_area = node.isOutsideBuildArea() # type: ignore else: is_outside_build_area = False diff --git a/cura/UI/TextManager.py b/cura/UI/TextManager.py index a2708801bb..c09fc9b1c2 100644 --- a/cura/UI/TextManager.py +++ b/cura/UI/TextManager.py @@ -2,7 +2,7 @@ # Cura is released under the terms of the LGPLv3 or higher. import collections -from typing import Optional +from typing import Optional, Dict, List, cast from PyQt5.QtCore import QObject, pyqtSlot @@ -29,9 +29,9 @@ class TextManager(QObject): def _loadChangeLogText(self) -> str: # Load change log texts and organize them with a dict file_path = Resources.getPath(Resources.Texts, "change_log.txt") - change_logs_dict = {} + change_logs_dict = {} # type: Dict[Version, Dict[str, List[str]]] with open(file_path, "r", encoding = "utf-8") as f: - open_version = None + open_version = None # type: Optional[Version] open_header = "" # Initialise to an empty header in case there is no "*" in the first line of the changelog for line in f: line = line.replace("\n", "") @@ -43,11 +43,11 @@ class TextManager(QObject): change_logs_dict[open_version] = collections.OrderedDict() elif line.startswith("*"): open_header = line.replace("*", "") - change_logs_dict[open_version][open_header] = [] + change_logs_dict[cast(Version, open_version)][open_header] = [] elif line != "": - if open_header not in change_logs_dict[open_version]: - change_logs_dict[open_version][open_header] = [] - change_logs_dict[open_version][open_header].append(line) + if open_header not in change_logs_dict[cast(Version, open_version)]: + change_logs_dict[cast(Version, open_version)][open_header] = [] + change_logs_dict[cast(Version, open_version)][open_header].append(line) # Format changelog text content = ""