Browse Source

Merge branch '15.10'

* 15.10:
  Properly clear stored layer data
  Render SupportInfillType so support is rendered correctly again.
  Fix issues with crash handler and log file creation on Windows
  Bump version
  Make the UMO upgrade selection page work properly
  Update preference dialog to the changed API
  Disable crash handler if debug mode is not enabled
  Prevent crashes when centering an object
  Also disable output device selection when main save button is disabled
  Fix name of Low Quality profile
  Fix stdout/stderr output location so we do not output to UM but to cura
Arjen Hiemstra 9 years ago
parent
commit
ae3705514f

+ 12 - 5
cura/CrashHandler.py

@@ -8,9 +8,16 @@ from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTex
 from UM.i18n import i18nCatalog
 catalog = i18nCatalog("cura")
 
-def show(type, value, tb):
-    if not hasattr(sys, "frozen"):
-        traceback.print_exception(type, value, tb)
+debug_mode = False
+
+def show(exception_type, value, tb):
+    if QCoreApplication.instance() and QCoreApplication.instance().getCommandLineOption("debug-mode", False):
+        debug_mode = True
+
+    traceback.print_exception(exception_type, value, tb)
+
+    if not debug_mode:
+        return
 
     application = QCoreApplication.instance()
     if not application:
@@ -34,7 +41,7 @@ def show(type, value, tb):
     except:
         version = "Unknown"
 
-    trace = "".join(traceback.format_exception(type, value, tb))
+    trace = "".join(traceback.format_exception(exception_type, value, tb))
 
     crash_info = "Version: {0}\nPlatform: {1}\nQt: {2}\nPyQt: {3}\n\nException:\n{4}"
     crash_info = crash_info.format(version, platform.platform(), QT_VERSION_STR, PYQT_VERSION_STR, trace)
@@ -44,7 +51,7 @@ def show(type, value, tb):
     buttons = QDialogButtonBox(QDialogButtonBox.Close, dialog)
     layout.addWidget(buttons)
     buttons.addButton(catalog.i18nc("@action:button", "Open Web Page"), QDialogButtonBox.HelpRole)
-    buttons.rejected.connect(lambda: dialog.close())
+    buttons.rejected.connect(dialog.close)
     buttons.helpRequested.connect(lambda: webbrowser.open("http://github.com/Ultimaker/Cura/issues"))
 
     dialog.exec_()

+ 17 - 11
cura/CuraApplication.py

@@ -68,7 +68,7 @@ class CuraApplication(QtApplication):
         if not hasattr(sys, "frozen"):
             Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), ".."))
 
-        super().__init__(name = "cura", version = "15.09.85")
+        super().__init__(name = "cura", version = "15.09.90")
 
         self.setWindowIcon(QIcon(Resources.getPath(Resources.Images, "cura-icon.png")))
 
@@ -132,6 +132,7 @@ class CuraApplication(QtApplication):
     def addCommandLineOptions(self, parser):
         super().addCommandLineOptions(parser)
         parser.add_argument("file", nargs="*", help="Files to load after starting the application.")
+        parser.add_argument("--debug", dest="debug-mode", action="store_true", default=False, help="Enable detailed crash reports.")
 
     def run(self):
         self._i18n_catalog = i18nCatalog("cura");
@@ -259,16 +260,16 @@ class CuraApplication(QtApplication):
     ##  Remove an object from the scene
     @pyqtSlot("quint64")
     def deleteObject(self, object_id):
-        object = self.getController().getScene().findObject(object_id)
+        node = self.getController().getScene().findObject(object_id)
 
-        if not object and object_id != 0: #Workaround for tool handles overlapping the selected object
-            object = Selection.getSelectedObject(0)
-        
-        if object:
-            if object.getParent():
-                group_node = object.getParent()
+        if not node and object_id != 0: #Workaround for tool handles overlapping the selected object
+            node = Selection.getSelectedObject(0)
+
+        if node:
+            if node.getParent():
+                group_node = node.getParent()
                 if not group_node.callDecoration("isGroup"):
-                    op = RemoveSceneNodeOperation(object)
+                    op = RemoveSceneNodeOperation(node)
                 else:
                     while group_node.getParent().callDecoration("isGroup"):
                         group_node = group_node.getParent()
@@ -302,10 +303,15 @@ class CuraApplication(QtApplication):
     @pyqtSlot("quint64")
     def centerObject(self, object_id):
         node = self.getController().getScene().findObject(object_id)
-        if node.getParent() and node.getParent().callDecoration("isGroup"):
-            node = node.getParent()
         if not node and object_id != 0: #Workaround for tool handles overlapping the selected object
             node = Selection.getSelectedObject(0)
+
+        if not node:
+            return
+
+        if node.getParent() and node.getParent().callDecoration("isGroup"):
+            node = node.getParent()
+
         if node:
             op = SetTransformOperation(node, Vector())
             op.push()

+ 1 - 1
cura/LayerData.py

@@ -107,7 +107,7 @@ class Layer():
     def build(self, offset, vertices, colors, indices):
         result = offset
         for polygon in self._polygons:
-            if polygon._type == Polygon.InfillType or polygon._type == Polygon.SupportInfillType or polygon.type == Polygon.MoveCombingType or polygon.type == Polygon.MoveRetractionType:
+            if polygon._type == Polygon.InfillType or polygon.type == Polygon.MoveCombingType or polygon.type == Polygon.MoveRetractionType:
                 continue
 
             polygon.build(result, vertices, colors, indices)

+ 5 - 3
cura_app.py

@@ -14,9 +14,11 @@ sys.excepthook = exceptHook
 import cura.CuraApplication
 
 if sys.platform == "win32" and hasattr(sys, "frozen"):
-    from UM.Resources import Resources
-    sys.stdout = open(Resources.getStoragePath(Resources.Resources, "stdout.log"), "w")
-    sys.stderr = open(Resources.getStoragePath(Resources.Resources, "stderr.log"), "w")
+    import os
+    dirpath = os.path.expanduser("~/AppData/Local/cura/")
+    os.makedirs(dirpath, exist_ok = True)
+    sys.stdout = open(os.path.join(dirpath, "stdout.log"), "w")
+    sys.stderr = open(os.path.join(dirpath, "stderr.log"), "w")
 
 app = cura.CuraApplication.CuraApplication.getInstance()
 app.run()

+ 1 - 0
plugins/CuraEngineBackend/CuraEngineBackend.py

@@ -335,6 +335,7 @@ class CuraEngineBackend(Backend):
                 if self._stored_layer_data:
                     job = ProcessSlicedObjectListJob.ProcessSlicedObjectListJob(self._stored_layer_data)
                     job.start()
+                    self._stored_layer_data = None
             else:
                 self._layer_view_active = False
 

+ 2 - 4
resources/machines/ultimaker_original.json

@@ -71,10 +71,8 @@
         },
         "machine_end_gcode": {
             "default": "M104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300  ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nM84 ;steppers off\nG90 ;absolute positioning"
-        }
-    },
+        },
 
-    "overrides": {
-        "material_bed_temperature": { "visible": false }
+        "machine_extruder_drive_upgrade": { "default": false }
     }
 }

+ 1 - 1
resources/profiles/Low+Quality.cfg

@@ -1,6 +1,6 @@
 [general]
 version = 1
-name = High Quality
+name = Low Quality
 
 [settings]
 layer_height = 0.15

+ 15 - 2
resources/qml/Cura.qml

@@ -465,14 +465,27 @@ UM.MainWindow
         {
             //; Remove & re-add the general page as we want to use our own instead of uranium standard.
             removePage(0);
-            insertPage(0, catalog.i18nc("@title:tab","General") , "" , Qt.resolvedUrl("./GeneralPage.qml"));
+            insertPage(0, catalog.i18nc("@title:tab","General"), generalPage);
 
             //: View preferences page title
-            insertPage(1, catalog.i18nc("@title:tab","View"), "view-preview", Qt.resolvedUrl("./ViewPage.qml"));
+            insertPage(1, catalog.i18nc("@title:tab","View"), viewPage);
 
             //Force refresh
             setPage(0)
         }
+
+        Item {
+            visible: false
+            GeneralPage
+            {
+                id: generalPage
+            }
+
+            ViewPage
+            {
+                id: viewPage
+            }
+        }
     }
 
     Actions

+ 11 - 1
resources/qml/SaveButton.qml

@@ -245,12 +245,22 @@ Rectangle {
             anchors.rightMargin: UM.Theme.sizes.default_margin.width
             width: UM.Theme.sizes.save_button_save_to_button.height
             height: UM.Theme.sizes.save_button_save_to_button.height
+            enabled: base.progress > 0.99 && base.activity == true
             //iconSource: UM.Theme.icons[UM.OutputDeviceManager.activeDeviceIconName];
 
             style: ButtonStyle {
                 background: Rectangle {
                     id: deviceSelectionIcon
-                    color: control.hovered ? UM.Theme.colors.load_save_button_hover : UM.Theme.colors.load_save_button
+                    color: {
+                        if(!control.enabled){
+                            return UM.Theme.colors.button;
+                        }
+                        else if(control.enabled && control.hovered) {
+                            return UM.Theme.colors.load_save_button_hover
+                        } else {
+                            return UM.Theme.colors.load_save_button
+                        }
+                    }
                     Behavior on color { ColorAnimation { duration: 50; } }
                     anchors.left: parent.left
                     anchors.leftMargin: UM.Theme.sizes.save_button_text_margin.width / 2;

+ 5 - 1
resources/qml/WizardPages/SelectUpgradedParts.qml

@@ -46,21 +46,25 @@ Item
             id: checkBox
             text: catalog.i18nc("@option:check","Extruder driver ugrades")
             checked: true
+            onClicked: UM.MachineManager.setMachineSettingValue("machine_extruder_drive_upgrade", true);
         }
         CheckBox
         {
             text: catalog.i18nc("@option:check","Heated printer bed (standard kit)")
             y: checkBox.height * 1
+            onClicked: UM.MachineManager.setMachineSettingValue("machine_heated_bed", true)
         }
         CheckBox
         {
             text: catalog.i18nc("@option:check","Heated printer bed (self built)")
             y: checkBox.height * 2
+            onClicked: UM.MachineManager.setMachineSettingValue("machine_heated_bed", true)
         }
         CheckBox
         {
             text: catalog.i18nc("@option:check","Dual extrusion (experimental)")
             y: checkBox.height * 3
+            enabled: false;
         }
     }
 
@@ -74,4 +78,4 @@ Item
     }
 
     ExclusiveGroup { id: printerGroup; }
-}
+}