Browse Source

Merge branch '4.0' into STAR-322_cloud-connection

ChrisTerBeke 6 years ago
parent
commit
21cde5535a

+ 1 - 1
cura/PrinterOutputDevice.py

@@ -229,7 +229,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
     # Returns the unique configurations of the printers within this output device
     # Returns the unique configurations of the printers within this output device
     @pyqtProperty("QStringList", notify = uniqueConfigurationsChanged)
     @pyqtProperty("QStringList", notify = uniqueConfigurationsChanged)
     def uniquePrinterTypes(self) -> List[str]:
     def uniquePrinterTypes(self) -> List[str]:
-        return list(set([configuration.printerType for configuration in self._unique_configurations]))
+        return list(sorted(set([configuration.printerType for configuration in self._unique_configurations])))
 
 
     def _onPrintersChanged(self) -> None:
     def _onPrintersChanged(self) -> None:
         for printer in self._printers:
         for printer in self._printers:

+ 8 - 0
plugins/MonitorStage/MonitorMain.qml

@@ -16,12 +16,20 @@ Item
 
 
         color: UM.Theme.getColor("viewport_overlay")
         color: UM.Theme.getColor("viewport_overlay")
         anchors.fill: parent
         anchors.fill: parent
+
+        // This mouse area is to prevent mouse clicks to be passed onto the scene.
         MouseArea
         MouseArea
         {
         {
             anchors.fill: parent
             anchors.fill: parent
             acceptedButtons: Qt.AllButtons
             acceptedButtons: Qt.AllButtons
             onWheel: wheel.accepted = true
             onWheel: wheel.accepted = true
         }
         }
+
+        // Disable dropping files into Cura when the monitor page is active
+        DropArea
+        {
+            anchors.fill: parent
+        }
     }
     }
 
 
     Loader
     Loader

+ 70 - 46
plugins/PostProcessingPlugin/PostProcessingPlugin.qml

@@ -25,7 +25,7 @@ UM.Dialog
     {
     {
         if(!visible) //Whenever the window is closed (either via the "Close" button or the X on the window frame), we want to update it in the stack.
         if(!visible) //Whenever the window is closed (either via the "Close" button or the X on the window frame), we want to update it in the stack.
         {
         {
-            manager.writeScriptsToStack();
+            manager.writeScriptsToStack()
         }
         }
     }
     }
 
 
@@ -67,12 +67,17 @@ UM.Dialog
             ListView
             ListView
             {
             {
                 id: activeScriptsList
                 id: activeScriptsList
-                anchors.top: activeScriptsHeader.bottom
-                anchors.topMargin: base.textMargin
-                anchors.left: parent.left
-                anchors.leftMargin: UM.Theme.getSize("default_margin").width
-                anchors.right: parent.right
-                anchors.rightMargin: base.textMargin
+
+                anchors
+                {
+                    top: activeScriptsHeader.bottom
+                    left: parent.left
+                    right: parent.right
+                    rightMargin: base.textMargin
+                    topMargin: base.textMargin
+                    leftMargin: UM.Theme.getSize("default_margin").width
+                }
+
                 height: childrenRect.height
                 height: childrenRect.height
                 model: manager.scriptList
                 model: manager.scriptList
                 delegate: Item
                 delegate: Item
@@ -84,8 +89,12 @@ UM.Dialog
                         id: activeScriptButton
                         id: activeScriptButton
                         text: manager.getScriptLabelByKey(modelData.toString())
                         text: manager.getScriptLabelByKey(modelData.toString())
                         exclusiveGroup: selectedScriptGroup
                         exclusiveGroup: selectedScriptGroup
+                        width: parent.width
+                        height: UM.Theme.getSize("setting").height
                         checkable: true
                         checkable: true
-                        checked: {
+
+                        checked:
+                        {
                             if (manager.selectedScriptIndex == index)
                             if (manager.selectedScriptIndex == index)
                             {
                             {
                                 base.activeScriptName = manager.getScriptLabelByKey(modelData.toString())
                                 base.activeScriptName = manager.getScriptLabelByKey(modelData.toString())
@@ -102,8 +111,7 @@ UM.Dialog
                             manager.setSelectedScriptIndex(index)
                             manager.setSelectedScriptIndex(index)
                             base.activeScriptName = manager.getScriptLabelByKey(modelData.toString())
                             base.activeScriptName = manager.getScriptLabelByKey(modelData.toString())
                         }
                         }
-                        width: parent.width
-                        height: UM.Theme.getSize("setting").height
+
                         style: ButtonStyle
                         style: ButtonStyle
                         {
                         {
                             background: Rectangle
                             background: Rectangle
@@ -121,6 +129,7 @@ UM.Dialog
                             }
                             }
                         }
                         }
                     }
                     }
+
                     Button
                     Button
                     {
                     {
                         id: removeButton
                         id: removeButton
@@ -249,8 +258,8 @@ UM.Dialog
                         onTriggered: manager.addScriptToList(modelData.toString())
                         onTriggered: manager.addScriptToList(modelData.toString())
                     }
                     }
 
 
-                    onObjectAdded: scriptsMenu.insertItem(index, object);
-                    onObjectRemoved: scriptsMenu.removeItem(object);
+                    onObjectAdded: scriptsMenu.insertItem(index, object)
+                    onObjectRemoved: scriptsMenu.removeItem(object)
                 }
                 }
             }
             }
         }
         }
@@ -268,12 +277,16 @@ UM.Dialog
             {
             {
                 id: scriptSpecsHeader
                 id: scriptSpecsHeader
                 text: manager.selectedScriptIndex == -1 ? catalog.i18nc("@label", "Settings") : base.activeScriptName
                 text: manager.selectedScriptIndex == -1 ? catalog.i18nc("@label", "Settings") : base.activeScriptName
-                anchors.top: parent.top
-                anchors.topMargin: base.textMargin
-                anchors.left: parent.left
-                anchors.leftMargin: base.textMargin
-                anchors.right: parent.right
-                anchors.rightMargin: base.textMargin
+                anchors
+                {
+                    top: parent.top
+                    topMargin: base.textMargin
+                    left: parent.left
+                    leftMargin: base.textMargin
+                    right: parent.right
+                    rightMargin: base.textMargin
+                }
+
                 elide: Text.ElideRight
                 elide: Text.ElideRight
                 height: 20 * screenScaleFactor
                 height: 20 * screenScaleFactor
                 font: UM.Theme.getFont("large")
                 font: UM.Theme.getFont("large")
@@ -283,11 +296,16 @@ UM.Dialog
             ScrollView
             ScrollView
             {
             {
                 id: scrollView
                 id: scrollView
-                anchors.top: scriptSpecsHeader.bottom
-                anchors.topMargin: settingsPanel.textMargin
-                anchors.left: parent.left
-                anchors.right: parent.right
-                anchors.bottom: parent.bottom
+                anchors
+                {
+                    top: scriptSpecsHeader.bottom
+                    topMargin: settingsPanel.textMargin
+                    left: parent.left
+                    leftMargin: UM.Theme.getSize("default_margin").width
+                    right: parent.right
+                    bottom: parent.bottom
+                }
+
                 visible: manager.selectedScriptDefinitionId != ""
                 visible: manager.selectedScriptDefinitionId != ""
                 style: UM.Theme.styles.scrollview;
                 style: UM.Theme.styles.scrollview;
 
 
@@ -297,11 +315,12 @@ UM.Dialog
                     spacing: UM.Theme.getSize("default_lining").height
                     spacing: UM.Theme.getSize("default_lining").height
                     model: UM.SettingDefinitionsModel
                     model: UM.SettingDefinitionsModel
                     {
                     {
-                        id: definitionsModel;
+                        id: definitionsModel
                         containerId: manager.selectedScriptDefinitionId
                         containerId: manager.selectedScriptDefinitionId
                         showAll: true
                         showAll: true
                     }
                     }
-                    delegate:Loader
+
+                    delegate: Loader
                     {
                     {
                         id: settingLoader
                         id: settingLoader
 
 
@@ -312,23 +331,24 @@ UM.Dialog
                             {
                             {
                                 if(model.type != undefined)
                                 if(model.type != undefined)
                                 {
                                 {
-                                    return UM.Theme.getSize("section").height;
+                                    return UM.Theme.getSize("section").height
                                 }
                                 }
                                 else
                                 else
                                 {
                                 {
-                                    return 0;
+                                    return 0
                                 }
                                 }
                             }
                             }
                             else
                             else
                             {
                             {
-                                return 0;
+                                return 0
                             }
                             }
-
                         }
                         }
                         Behavior on height { NumberAnimation { duration: 100 } }
                         Behavior on height { NumberAnimation { duration: 100 } }
                         opacity: provider.properties.enabled == "True" ? 1 : 0
                         opacity: provider.properties.enabled == "True" ? 1 : 0
+
                         Behavior on opacity { NumberAnimation { duration: 100 } }
                         Behavior on opacity { NumberAnimation { duration: 100 } }
                         enabled: opacity > 0
                         enabled: opacity > 0
+
                         property var definition: model
                         property var definition: model
                         property var settingDefinitionsModel: definitionsModel
                         property var settingDefinitionsModel: definitionsModel
                         property var propertyProvider: provider
                         property var propertyProvider: provider
@@ -339,11 +359,12 @@ UM.Dialog
                         //causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.
                         //causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.
                         asynchronous: model.type != "enum" && model.type != "extruder"
                         asynchronous: model.type != "enum" && model.type != "extruder"
 
 
-                        onLoaded: {
+                        onLoaded:
+                        {
                             settingLoader.item.showRevertButton = false
                             settingLoader.item.showRevertButton = false
                             settingLoader.item.showInheritButton = false
                             settingLoader.item.showInheritButton = false
                             settingLoader.item.showLinkedSettingIcon = false
                             settingLoader.item.showLinkedSettingIcon = false
-                            settingLoader.item.doDepthIndentation = true
+                            settingLoader.item.doDepthIndentation = false
                             settingLoader.item.doQualityUserSettingEmphasis = false
                             settingLoader.item.doQualityUserSettingEmphasis = false
                         }
                         }
 
 
@@ -395,18 +416,14 @@ UM.Dialog
 
 
                             onShowTooltip:
                             onShowTooltip:
                             {
                             {
-                                tooltip.text = text;
-                                var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0);
-                                tooltip.show(position);
+                                tooltip.text = text
+                                var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0)
+                                tooltip.show(position)
                                 tooltip.target.x = position.x + 1
                                 tooltip.target.x = position.x + 1
                             }
                             }
 
 
-                            onHideTooltip:
-                            {
-                                tooltip.hide();
-                            }
+                            onHideTooltip: tooltip.hide()
                         }
                         }
-
                     }
                     }
                 }
                 }
             }
             }
@@ -459,6 +476,7 @@ UM.Dialog
             Cura.SettingUnknown { }
             Cura.SettingUnknown { }
         }
         }
     }
     }
+
     rightButtons: Button
     rightButtons: Button
     {
     {
         text: catalog.i18nc("@action:button", "Close")
         text: catalog.i18nc("@action:button", "Close")
@@ -466,7 +484,8 @@ UM.Dialog
         onClicked: dialog.accept()
         onClicked: dialog.accept()
     }
     }
 
 
-    Button {
+    Button
+    {
         objectName: "postProcessingSaveAreaButton"
         objectName: "postProcessingSaveAreaButton"
         visible: activeScriptsList.count > 0
         visible: activeScriptsList.count > 0
         height: UM.Theme.getSize("save_button_save_to_button").height
         height: UM.Theme.getSize("save_button_save_to_button").height
@@ -474,8 +493,10 @@ UM.Dialog
         tooltip: catalog.i18nc("@info:tooltip", "Change active post-processing scripts")
         tooltip: catalog.i18nc("@info:tooltip", "Change active post-processing scripts")
         onClicked: dialog.show()
         onClicked: dialog.show()
 
 
-        style: ButtonStyle {
-            background: Rectangle {
+        style: ButtonStyle
+        {
+            background: Rectangle
+            {
                 id: deviceSelectionIcon
                 id: deviceSelectionIcon
                 border.width: UM.Theme.getSize("default_lining").width
                 border.width: UM.Theme.getSize("default_lining").width
                 border.color: !control.enabled ? UM.Theme.getColor("action_button_disabled_border") :
                 border.color: !control.enabled ? UM.Theme.getColor("action_button_disabled_border") :
@@ -485,12 +506,15 @@ UM.Dialog
                            control.pressed ? UM.Theme.getColor("action_button_active") :
                            control.pressed ? UM.Theme.getColor("action_button_active") :
                            control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
                            control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
                 Behavior on color { ColorAnimation { duration: 50; } }
                 Behavior on color { ColorAnimation { duration: 50; } }
+
                 anchors.left: parent.left
                 anchors.left: parent.left
-                anchors.leftMargin: Math.round(UM.Theme.getSize("save_button_text_margin").width / 2);
+                anchors.leftMargin: Math.round(UM.Theme.getSize("save_button_text_margin").width / 2)
+
                 width: parent.height
                 width: parent.height
                 height: parent.height
                 height: parent.height
 
 
-                UM.RecolorImage {
+                UM.RecolorImage
+                {
                     anchors.verticalCenter: parent.verticalCenter
                     anchors.verticalCenter: parent.verticalCenter
                     anchors.horizontalCenter: parent.horizontalCenter
                     anchors.horizontalCenter: parent.horizontalCenter
                     width: Math.round(parent.width / 2)
                     width: Math.round(parent.width / 2)
@@ -498,11 +522,11 @@ UM.Dialog
                     sourceSize.height: height
                     sourceSize.height: height
                     color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") :
                     color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") :
                                control.pressed ? UM.Theme.getColor("action_button_active_text") :
                                control.pressed ? UM.Theme.getColor("action_button_active_text") :
-                               control.hovered ? UM.Theme.getColor("action_button_hovered_text") : UM.Theme.getColor("action_button_text");
+                               control.hovered ? UM.Theme.getColor("action_button_hovered_text") : UM.Theme.getColor("action_button_text")
                     source: "postprocessing.svg"
                     source: "postprocessing.svg"
                 }
                 }
             }
             }
-            label: Label{ }
+            label: Label { }
         }
         }
     }
     }
 }
 }

+ 6 - 3
resources/qml/Menus/NetworkPrinterMenu.qml

@@ -7,11 +7,14 @@ import QtQuick.Controls 1.4
 import UM 1.2 as UM
 import UM 1.2 as UM
 import Cura 1.0 as Cura
 import Cura 1.0 as Cura
 
 
-Instantiator {
-    model: UM.ContainerStacksModel {
+Instantiator
+{
+    model: UM.ContainerStacksModel
+    {
         filter: {"type": "machine", "um_network_key": "*", "hidden": "False"}
         filter: {"type": "machine", "um_network_key": "*", "hidden": "False"}
     }
     }
-    MenuItem {
+    MenuItem
+    {
         // TODO: Use printer_group icon when it's a cluster. Not use it for now since it doesn't look as expected
         // TODO: Use printer_group icon when it's a cluster. Not use it for now since it doesn't look as expected
 //        iconSource: UM.Theme.getIcon("printer_single")
 //        iconSource: UM.Theme.getIcon("printer_single")
         text: model.metadata["connect_group_name"]
         text: model.metadata["connect_group_name"]