Browse Source

Merge branch 'ui_rework_4_0' into cura4.0_header

Diego Prado Gesto 6 years ago
parent
commit
18c9e9f05a

+ 1 - 0
CMakeLists.txt

@@ -17,6 +17,7 @@ if(CURA_DEBUGMODE)
     set(_cura_debugmode "ON")
 endif()
 
+set(CURA_APP_DISPLAY_NAME "Ultimaker Cura" CACHE STRING "Display name of Cura")
 set(CURA_VERSION "master" CACHE STRING "Version name of Cura")
 set(CURA_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'")
 set(CURA_SDK_VERSION "" CACHE STRING "SDK version of Cura")

+ 3 - 1
cura/CuraApplication.py

@@ -128,8 +128,9 @@ if TYPE_CHECKING:
 numpy.seterr(all = "ignore")
 
 try:
-    from cura.CuraVersion import CuraVersion, CuraBuildType, CuraDebugMode, CuraSDKVersion
+    from cura.CuraVersion import CuraAppDisplayName, CuraVersion, CuraBuildType, CuraDebugMode, CuraSDKVersion
 except ImportError:
+    CuraAppDisplayName = "Ultimaker Cura"
     CuraVersion = "master"  # [CodeStyle: Reflecting imported value]
     CuraBuildType = ""
     CuraDebugMode = False
@@ -161,6 +162,7 @@ class CuraApplication(QtApplication):
 
     def __init__(self, *args, **kwargs):
         super().__init__(name = "cura",
+                         app_display_name = CuraAppDisplayName,
                          version = CuraVersion,
                          buildtype = CuraBuildType,
                          is_debug_mode = CuraDebugMode,

+ 1 - 0
cura/CuraVersion.py.in

@@ -1,6 +1,7 @@
 # Copyright (c) 2015 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 
+CuraAppDisplayName = "@CURA_APP_DISPLAY_NAME@"
 CuraVersion = "@CURA_VERSION@"
 CuraBuildType = "@CURA_BUILDTYPE@"
 CuraDebugMode = True if "@_cura_debugmode@" == "ON" else False

+ 1 - 1
cura/Machines/Models/SettingVisibilityPresetsModel.py

@@ -140,7 +140,7 @@ class SettingVisibilityPresetsModel(QObject):
         item_to_set = self._active_preset_item
         if matching_preset_item is None:
             # The new visibility setup is "custom" should be custom
-            if self._active_preset_item.presetId == "custom":
+            if self._active_preset_item is None or self._active_preset_item.presetId == "custom":
                 # We are already in custom, just save the settings
                 self._preferences.setValue("cura/custom_visible_settings", visibility_string)
             else:

+ 5 - 0
cura/PrintInformation.py

@@ -369,6 +369,11 @@ class PrintInformation(QObject):
             else:
                 self._base_name = ""
 
+            # Strip the old "curaproject" extension from the name
+            OLD_CURA_PROJECT_EXT = ".curaproject"
+            if self._base_name.endswith(OLD_CURA_PROJECT_EXT):
+                self._base_name = self._base_name[:len(self._base_name) - len(OLD_CURA_PROJECT_EXT)]
+
             self._updateJobName()
 
     @pyqtProperty(str, fset = setBaseName, notify = baseNameChanged)

+ 6 - 0
cura/Scene/ConvexHullDecorator.py

@@ -142,6 +142,12 @@ class ConvexHullDecorator(SceneNodeDecorator):
         controller = Application.getInstance().getController()
         root = controller.getScene().getRoot()
         if self._node is None or controller.isToolOperationActive() or not self.__isDescendant(root, self._node):
+            # If the tool operation is still active, we need to compute the convex hull later after the controller is
+            # no longer active.
+            if controller.isToolOperationActive():
+                self.recomputeConvexHullDelayed()
+                return
+
             if self._convex_hull_node:
                 self._convex_hull_node.setParent(None)
                 self._convex_hull_node = None

+ 0 - 156
installer.nsi

@@ -1,156 +0,0 @@
-!ifndef VERSION
-  !define VERSION '15.09.80'
-!endif
-
-; The name of the installer
-Name "Cura ${VERSION}"
-
-; The file to write
-OutFile "Cura_${VERSION}.exe"
-
-; The default installation directory
-InstallDir $PROGRAMFILES\Cura_${VERSION}
-
-; Registry key to check for directory (so if you install again, it will 
-; overwrite the old one automatically)
-InstallDirRegKey HKLM "Software\Cura_${VERSION}" "Install_Dir"
-
-; Request application privileges for Windows Vista
-RequestExecutionLevel admin
-
-; Set the LZMA compressor to reduce size.
-SetCompressor /SOLID lzma
-;--------------------------------
-
-!include "MUI2.nsh"
-!include "Library.nsh"
-
-; !define MUI_ICON "dist/resources/cura.ico"
-!define MUI_BGCOLOR FFFFFF
-
-; Directory page defines
-!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
-
-; Header
-; Don't show the component description box
-!define MUI_COMPONENTSPAGE_NODESC
-
-;Do not leave (Un)Installer page automaticly
-!define MUI_FINISHPAGE_NOAUTOCLOSE
-!define MUI_UNFINISHPAGE_NOAUTOCLOSE
-
-;Run Cura after installing
-!define MUI_FINISHPAGE_RUN
-!define MUI_FINISHPAGE_RUN_TEXT "Start Cura ${VERSION}"
-!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
-
-;Add an option to show release notes
-!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\plugins\ChangeLogPlugin\changelog.txt"
-
-; Pages
-;!insertmacro MUI_PAGE_WELCOME
-!insertmacro MUI_PAGE_DIRECTORY
-!insertmacro MUI_PAGE_COMPONENTS
-!insertmacro MUI_PAGE_INSTFILES
-!insertmacro MUI_PAGE_FINISH
-!insertmacro MUI_UNPAGE_CONFIRM
-!insertmacro MUI_UNPAGE_INSTFILES
-!insertmacro MUI_UNPAGE_FINISH
-
-; Languages
-!insertmacro MUI_LANGUAGE "English"
-
-; Reserve Files
-!insertmacro MUI_RESERVEFILE_LANGDLL
-ReserveFile '${NSISDIR}\Plugins\InstallOptions.dll'
-
-;--------------------------------
-
-; The stuff to install
-Section "Cura ${VERSION}"
-
-  SectionIn RO
-  
-  ; Set output path to the installation directory.
-  SetOutPath $INSTDIR
-  
-  ; Put file there
-  File /r "dist\"
-  
-  ; Write the installation path into the registry
-  WriteRegStr HKLM "SOFTWARE\Cura_${VERSION}" "Install_Dir" "$INSTDIR"
-  
-  ; Write the uninstall keys for Windows
-  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "DisplayName" "Cura ${VERSION}"
-  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "UninstallString" '"$INSTDIR\uninstall.exe"'
-  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "NoModify" 1
-  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "NoRepair" 1
-  WriteUninstaller "uninstall.exe"
-
-  ; Write start menu entries for all users
-  SetShellVarContext all
-  
-  CreateDirectory "$SMPROGRAMS\Cura ${VERSION}"
-  CreateShortCut "$SMPROGRAMS\Cura ${VERSION}\Uninstall Cura ${VERSION}.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
-  CreateShortCut "$SMPROGRAMS\Cura ${VERSION}\Cura ${VERSION}.lnk" "$INSTDIR\Cura.exe" '' "$INSTDIR\Cura.exe" 0
-  
-SectionEnd
-
-Function LaunchLink
-  ; Write start menu entries for all users
-  SetShellVarContext all
-  Exec '"$WINDIR\explorer.exe" "$SMPROGRAMS\Cura ${VERSION}\Cura ${VERSION}.lnk"'
-FunctionEnd
-
-Section "Install Visual Studio 2010 Redistributable"
-    SetOutPath "$INSTDIR"
-    File "vcredist_2010_20110908_x86.exe"
-    
-    IfSilent +2
-      ExecWait '"$INSTDIR\vcredist_2010_20110908_x86.exe" /q /norestart'
-
-SectionEnd
-
-Section "Install Arduino Drivers"
-  ; Set output path to the driver directory.
-  SetOutPath "$INSTDIR\drivers\"
-  File /r "drivers\"
-  
-  ${If} ${RunningX64}
-    IfSilent +2
-      ExecWait '"$INSTDIR\drivers\dpinst64.exe" /lm'
-  ${Else}
-    IfSilent +2
-      ExecWait '"$INSTDIR\drivers\dpinst32.exe" /lm'
-  ${EndIf}
-SectionEnd
-
-Section "Open STL files with Cura"
-   ${registerExtension} "$INSTDIR\Cura.exe" ".stl" "STL_File"
-SectionEnd
-
-Section /o "Open OBJ files with Cura"
-	WriteRegStr HKCR .obj "" "Cura OBJ model file"
-	DeleteRegValue HKCR .obj "Content Type"
-	WriteRegStr HKCR "Cura OBJ model file\DefaultIcon" "" "$INSTDIR\Cura.exe,0"
-	WriteRegStr HKCR "Cura OBJ model file\shell" "" "open"
-	WriteRegStr HKCR "Cura OBJ model file\shell\open\command" "" '"$INSTDIR\Cura.exe" "%1"'
-SectionEnd
-
-;--------------------------------
-
-; Uninstaller
-
-Section "Uninstall"
-  
-  ; Remove registry keys
-  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}"
-  DeleteRegKey HKLM "SOFTWARE\Cura_${VERSION}"
-
-  ; Write start menu entries for all users
-  SetShellVarContext all
-  ; Remove directories used
-  RMDir /r "$SMPROGRAMS\Cura ${VERSION}"
-  RMDir /r "$INSTDIR"
-
-SectionEnd

+ 44 - 0
resources/definitions/fdmprinter.def.json

@@ -4378,6 +4378,50 @@
                         }
                     }
                 },
+                "support_interface_offset": 
+                {
+                    "label": "Support Interface Offset",
+                    "description": "Amount of offset applied to the support interface polygons.",
+                    "unit": "mm",
+                    "type": "float",
+                    "minimum_value": "0",
+                    "default_value": 0.0,
+                    "limit_to_extruder": "support_interface_extruder_nr",
+                    "enabled": "support_interface_enable and (support_enable or support_tree_enable)",
+                    "settable_per_mesh": false,
+                    "settable_per_extruder": true,
+                    "children":
+                    {
+                        "support_roof_offset": 
+                        {
+                            "label": "Support Roof Offset",
+                            "description": "Amount of offset applied to the roofs of the support.",
+                            "unit": "mm",
+                            "type": "float",
+                            "minimum_value": "0",
+                            "default_value": 0.0,
+                            "value": "extruderValue(support_roof_extruder_nr, 'support_interface_offset')",
+                            "limit_to_extruder": "support_roof_extruder_nr",
+                            "enabled": "support_roof_enable and (support_enable or support_tree_enable)",
+                            "settable_per_mesh": false,
+                            "settable_per_extruder": true
+                        },
+                        "support_bottom_offset": 
+                        {
+                            "label": "Support Floor Offset",
+                            "description": "Amount of offset applied to the floors of the support.",
+                            "unit": "mm",
+                            "type": "float",
+                            "minimum_value": "0",
+                            "default_value": 0.0,
+                            "value": "extruderValue(support_bottom_extruder_nr, 'support_interface_offset')",
+                            "limit_to_extruder": "support_bottom_extruder_nr",
+                            "enabled": "support_bottom_enable and (support_enable or support_tree_enable)",
+                            "settable_per_mesh": false,
+                            "settable_per_extruder": true
+                        }
+                    }
+                },
                 "support_fan_enable":
                 {
                     "label": "Fan Speed Override",

+ 23 - 12
resources/qml/Dialogs/AddMachineDialog.qml

@@ -25,7 +25,8 @@ UM.Dialog
     width: minimumWidth
     height: minimumHeight
 
-    flags: {
+    flags:
+    {
         var window_flags = Qt.Dialog | Qt.CustomizeWindowHint | Qt.WindowTitleHint;
         if (Cura.MachineManager.activeDefinitionId !== "") //Disallow closing the window if we have no active printer yet. You MUST add a printer.
         {
@@ -48,22 +49,28 @@ UM.Dialog
 
     function getMachineName()
     {
-        return machineList.model.getItem(machineList.currentIndex) != undefined ? machineList.model.getItem(machineList.currentIndex).name : "";
+        if (machineList.model.getItem(machineList.currentIndex) != undefined)
+        {
+            return machineList.model.getItem(machineList.currentIndex).name;
+        }
+        return  "";
     }
 
     function getMachineMetaDataEntry(key)
     {
-        var metadata = machineList.model.getItem(machineList.currentIndex) != undefined ? machineList.model.getItem(machineList.currentIndex).metadata : undefined;
-        if (metadata)
+        if (machineList.model.getItem(machineList.currentIndex) != undefined)
         {
-            return metadata[key];
+            return machineList.model.getItem(machineList.currentIndex).metadata[key];
         }
-        return undefined;
+        return  "";
     }
-    Label {
+
+    Label
+    {
         id: titleLabel
 
-        anchors {
+        anchors
+        {
             top: parent.top
             left: parent.left
             topMargin: UM.Theme.getSize("default_margin")
@@ -102,7 +109,8 @@ UM.Dialog
         width: Math.round(parent.width * 0.45)
 
         frameVisible: true;
-        Rectangle {
+        Rectangle
+        {
             parent: viewport
             anchors.fill: parent
             color: palette.light
@@ -159,11 +167,14 @@ UM.Dialog
                 onClicked:
                 {
                     base.activeCategory = section;
-                    if (machineList.model.getItem(machineList.currentIndex).section != section) {
+                    if (machineList.model.getItem(machineList.currentIndex).section != section)
+                    {
                         // Find the first machine from this section
-                        for(var i = 0; i < machineList.model.rowCount(); i++) {
+                        for(var i = 0; i < machineList.model.rowCount(); i++)
+                        {
                             var item = machineList.model.getItem(i);
-                            if (item.section == section) {
+                            if (item.section == section)
+                            {
                                 machineList.currentIndex = i;
                                 break;
                             }