Browse Source

Merge branch 'ui_rework_4_0' into CURA-5941_restyle_setting_dropdown

Diego Prado Gesto 6 years ago
parent
commit
07d58c3aef

+ 2 - 2
cura/Settings/ExtruderManager.py

@@ -63,7 +63,7 @@ class ExtruderManager(QObject):
         if not self._application.getGlobalContainerStack():
             return None  # No active machine, so no active extruder.
         try:
-            return self._extruder_trains[self._application.getGlobalContainerStack().getId()][str(self._active_extruder_index)].getId()
+            return self._extruder_trains[self._application.getGlobalContainerStack().getId()][str(self.activeExtruderIndex)].getId()
         except KeyError:  # Extruder index could be -1 if the global tab is selected, or the entry doesn't exist if the machine definition is wrong.
             return None
 
@@ -144,7 +144,7 @@ class ExtruderManager(QObject):
 
     @pyqtSlot(result = QObject)
     def getActiveExtruderStack(self) -> Optional["ExtruderStack"]:
-        return self.getExtruderStack(self._active_extruder_index)
+        return self.getExtruderStack(self.activeExtruderIndex)
 
     ##  Get an extruder stack by index
     def getExtruderStack(self, index) -> Optional["ExtruderStack"]:

+ 2 - 2
cura/Settings/ExtruderStack.py

@@ -52,8 +52,8 @@ class ExtruderStack(CuraContainerStack):
         return super().getNextStack()
 
     def setEnabled(self, enabled: bool) -> None:
-        if "enabled" not in self._metadata:
-            self.setMetaDataEntry("enabled", "True")
+        if self.getMetaDataEntry("enabled", True) == enabled: #No change.
+            return #Don't emit a signal then.
         self.setMetaDataEntry("enabled", str(enabled))
         self.enabledChanged.emit()
 

+ 3 - 3
cura/Settings/ExtrudersModel.py

@@ -1,4 +1,4 @@
-# Copyright (c) 2017 Ultimaker B.V.
+# Copyright (c) 2018 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot, pyqtProperty, QTimer
@@ -165,7 +165,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
     def __updateExtruders(self):
         extruders_changed = False
 
-        if self.rowCount() != 0:
+        if self.count != 0:
             extruders_changed = True
 
         items = []
@@ -177,7 +177,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
             machine_extruder_count = global_container_stack.getProperty("machine_extruder_count", "value")
 
             for extruder in Application.getInstance().getExtruderManager().getActiveExtruderStacks():
-                position = extruder.getMetaDataEntry("position", default = "0")  # Get the position
+                position = extruder.getMetaDataEntry("position", default = "0")
                 try:
                     position = int(position)
                 except ValueError:

+ 2 - 2
cura/Settings/MachineManager.py

@@ -874,7 +874,7 @@ class MachineManager(QObject):
             caution_message = Message(catalog.i18nc(
                 "@info:generic",
                 "Settings have been changed to match the current availability of extruders: [%s]" % ", ".join(add_user_changes)),
-                lifetime=0,
+                lifetime = 0,
                 title = catalog.i18nc("@info:title", "Settings updated"))
             caution_message.show()
 
@@ -1553,7 +1553,7 @@ class MachineManager(QObject):
             elif word.isdigit():
                 abbr_machine += word
             else:
-                stripped_word = ''.join(char for char in unicodedata.normalize('NFD', word.upper()) if unicodedata.category(char) != 'Mn')
+                stripped_word = "".join(char for char in unicodedata.normalize("NFD", word.upper()) if unicodedata.category(char) != "Mn")
                 # - use only the first character if the word is too long (> 3 characters)
                 # - use the whole word if it's not too long (<= 3 characters)
                 if len(stripped_word) > 3:

+ 1 - 1
plugins/CuraEngineBackend/ProcessSlicedLayersJob.py

@@ -195,7 +195,7 @@ class ProcessSlicedLayersJob(Job):
         if extruders:
             material_color_map = numpy.zeros((len(extruders), 4), dtype=numpy.float32)
             for extruder in extruders:
-                position = int(extruder.getMetaDataEntry("position", default="0"))  # Get the position
+                position = int(extruder.getMetaDataEntry("position", default = "0"))
                 try:
                     default_color = ExtrudersModel.defaultColors[position]
                 except IndexError:

+ 2 - 2
plugins/MachineSettingsAction/MachineSettingsAction.qml

@@ -1,4 +1,4 @@
-// Copyright (c) 2016 Ultimaker B.V.
+// Copyright (c) 2018 Ultimaker B.V.
 // Cura is released under the terms of the LGPLv3 or higher.
 
 import QtQuick 2.2
@@ -23,7 +23,7 @@ Cura.MachineAction
         target: base.extrudersModel
         onModelChanged:
         {
-            var extruderCount = base.extrudersModel.rowCount();
+            var extruderCount = base.extrudersModel.count;
             base.extruderTabsCount = extruderCount;
         }
     }

+ 0 - 1
plugins/ModelChecker/ModelChecker.qml

@@ -33,7 +33,6 @@ Button
             {
                 width: UM.Theme.getSize("save_button_specs_icons").width;
                 height: UM.Theme.getSize("save_button_specs_icons").height;
-                sourceSize.width: width;
                 sourceSize.height: width;
                 color: control.hovered ? UM.Theme.getColor("text_scene_hover") : UM.Theme.getColor("text_scene");
                 source: "model_checker.svg"

+ 0 - 1
plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml

@@ -265,7 +265,6 @@ Item {
                                         anchors.verticalCenter: parent.verticalCenter
                                         width: parent.width
                                         height: width
-                                        sourceSize.width: width
                                         sourceSize.height: width
                                         color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button")
                                         source: UM.Theme.getIcon("minus")

+ 0 - 4
plugins/PostProcessingPlugin/PostProcessingPlugin.qml

@@ -141,7 +141,6 @@ UM.Dialog
                                     anchors.horizontalCenter: parent.horizontalCenter
                                     width: Math.round(control.width / 2.7)
                                     height: Math.round(control.height / 2.7)
-                                    sourceSize.width: width
                                     sourceSize.height: width
                                     color: palette.text
                                     source: UM.Theme.getIcon("cross1")
@@ -176,7 +175,6 @@ UM.Dialog
                                     anchors.horizontalCenter: parent.horizontalCenter
                                     width: Math.round(control.width / 2.5)
                                     height: Math.round(control.height / 2.5)
-                                    sourceSize.width: width
                                     sourceSize.height: width
                                     color: control.enabled ? palette.text : disabledPalette.text
                                     source: UM.Theme.getIcon("arrow_bottom")
@@ -211,7 +209,6 @@ UM.Dialog
                                     anchors.horizontalCenter: parent.horizontalCenter
                                     width: Math.round(control.width / 2.5)
                                     height: Math.round(control.height / 2.5)
-                                    sourceSize.width: width
                                     sourceSize.height: width
                                     color: control.enabled ? palette.text : disabledPalette.text
                                     source: UM.Theme.getIcon("arrow_top")
@@ -498,7 +495,6 @@ UM.Dialog
                     anchors.horizontalCenter: parent.horizontalCenter
                     width: Math.round(parent.width / 2)
                     height: Math.round(parent.height / 2)
-                    sourceSize.width: width
                     sourceSize.height: height
                     color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") :
                                control.pressed ? UM.Theme.getColor("action_button_active_text") :

+ 1 - 2
plugins/PrepareStage/PrepareMenu.qml

@@ -56,7 +56,7 @@ Item
                 color: UM.Theme.getColor("lining")
             }
 
-            Cura.QuickConfigurationSelector
+            Cura.ConfigurationMenu
             {
                 Layout.fillHeight: true
                 Layout.fillWidth: true
@@ -102,7 +102,6 @@ Item
                     height: UM.Theme.getSize("button_icon").height
                     color: UM.Theme.getColor("toolbar_button_text")
 
-                    sourceSize.width: width
                     sourceSize.height: height
                 }
             }

Some files were not shown because too many files changed in this diff