mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-03 03:54:01 -06:00
Merge branch 'ui_rework_4_0' into cura4.0_header
This commit is contained in:
commit
18c9e9f05a
9 changed files with 84 additions and 170 deletions
|
@ -17,6 +17,7 @@ if(CURA_DEBUGMODE)
|
||||||
set(_cura_debugmode "ON")
|
set(_cura_debugmode "ON")
|
||||||
endif()
|
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_VERSION "master" CACHE STRING "Version name of Cura")
|
||||||
set(CURA_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'")
|
set(CURA_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'")
|
||||||
set(CURA_SDK_VERSION "" CACHE STRING "SDK version of Cura")
|
set(CURA_SDK_VERSION "" CACHE STRING "SDK version of Cura")
|
||||||
|
|
|
@ -128,8 +128,9 @@ if TYPE_CHECKING:
|
||||||
numpy.seterr(all = "ignore")
|
numpy.seterr(all = "ignore")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from cura.CuraVersion import CuraVersion, CuraBuildType, CuraDebugMode, CuraSDKVersion
|
from cura.CuraVersion import CuraAppDisplayName, CuraVersion, CuraBuildType, CuraDebugMode, CuraSDKVersion
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
CuraAppDisplayName = "Ultimaker Cura"
|
||||||
CuraVersion = "master" # [CodeStyle: Reflecting imported value]
|
CuraVersion = "master" # [CodeStyle: Reflecting imported value]
|
||||||
CuraBuildType = ""
|
CuraBuildType = ""
|
||||||
CuraDebugMode = False
|
CuraDebugMode = False
|
||||||
|
@ -161,6 +162,7 @@ class CuraApplication(QtApplication):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(name = "cura",
|
super().__init__(name = "cura",
|
||||||
|
app_display_name = CuraAppDisplayName,
|
||||||
version = CuraVersion,
|
version = CuraVersion,
|
||||||
buildtype = CuraBuildType,
|
buildtype = CuraBuildType,
|
||||||
is_debug_mode = CuraDebugMode,
|
is_debug_mode = CuraDebugMode,
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# Copyright (c) 2015 Ultimaker B.V.
|
# Copyright (c) 2015 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
|
CuraAppDisplayName = "@CURA_APP_DISPLAY_NAME@"
|
||||||
CuraVersion = "@CURA_VERSION@"
|
CuraVersion = "@CURA_VERSION@"
|
||||||
CuraBuildType = "@CURA_BUILDTYPE@"
|
CuraBuildType = "@CURA_BUILDTYPE@"
|
||||||
CuraDebugMode = True if "@_cura_debugmode@" == "ON" else False
|
CuraDebugMode = True if "@_cura_debugmode@" == "ON" else False
|
||||||
|
|
|
@ -140,7 +140,7 @@ class SettingVisibilityPresetsModel(QObject):
|
||||||
item_to_set = self._active_preset_item
|
item_to_set = self._active_preset_item
|
||||||
if matching_preset_item is None:
|
if matching_preset_item is None:
|
||||||
# The new visibility setup is "custom" should be custom
|
# 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
|
# We are already in custom, just save the settings
|
||||||
self._preferences.setValue("cura/custom_visible_settings", visibility_string)
|
self._preferences.setValue("cura/custom_visible_settings", visibility_string)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -369,6 +369,11 @@ class PrintInformation(QObject):
|
||||||
else:
|
else:
|
||||||
self._base_name = ""
|
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()
|
self._updateJobName()
|
||||||
|
|
||||||
@pyqtProperty(str, fset = setBaseName, notify = baseNameChanged)
|
@pyqtProperty(str, fset = setBaseName, notify = baseNameChanged)
|
||||||
|
|
|
@ -142,6 +142,12 @@ class ConvexHullDecorator(SceneNodeDecorator):
|
||||||
controller = Application.getInstance().getController()
|
controller = Application.getInstance().getController()
|
||||||
root = controller.getScene().getRoot()
|
root = controller.getScene().getRoot()
|
||||||
if self._node is None or controller.isToolOperationActive() or not self.__isDescendant(root, self._node):
|
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:
|
if self._convex_hull_node:
|
||||||
self._convex_hull_node.setParent(None)
|
self._convex_hull_node.setParent(None)
|
||||||
self._convex_hull_node = None
|
self._convex_hull_node = None
|
||||||
|
|
156
installer.nsi
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
|
|
|
@ -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":
|
"support_fan_enable":
|
||||||
{
|
{
|
||||||
"label": "Fan Speed Override",
|
"label": "Fan Speed Override",
|
||||||
|
|
|
@ -25,7 +25,8 @@ UM.Dialog
|
||||||
width: minimumWidth
|
width: minimumWidth
|
||||||
height: minimumHeight
|
height: minimumHeight
|
||||||
|
|
||||||
flags: {
|
flags:
|
||||||
|
{
|
||||||
var window_flags = Qt.Dialog | Qt.CustomizeWindowHint | Qt.WindowTitleHint;
|
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.
|
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()
|
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)
|
function getMachineMetaDataEntry(key)
|
||||||
{
|
{
|
||||||
var metadata = machineList.model.getItem(machineList.currentIndex) != undefined ? machineList.model.getItem(machineList.currentIndex).metadata : undefined;
|
if (machineList.model.getItem(machineList.currentIndex) != undefined)
|
||||||
if (metadata)
|
|
||||||
{
|
{
|
||||||
return metadata[key];
|
return machineList.model.getItem(machineList.currentIndex).metadata[key];
|
||||||
}
|
}
|
||||||
return undefined;
|
return "";
|
||||||
}
|
}
|
||||||
Label {
|
|
||||||
|
Label
|
||||||
|
{
|
||||||
id: titleLabel
|
id: titleLabel
|
||||||
|
|
||||||
anchors {
|
anchors
|
||||||
|
{
|
||||||
top: parent.top
|
top: parent.top
|
||||||
left: parent.left
|
left: parent.left
|
||||||
topMargin: UM.Theme.getSize("default_margin")
|
topMargin: UM.Theme.getSize("default_margin")
|
||||||
|
@ -102,7 +109,8 @@ UM.Dialog
|
||||||
width: Math.round(parent.width * 0.45)
|
width: Math.round(parent.width * 0.45)
|
||||||
|
|
||||||
frameVisible: true;
|
frameVisible: true;
|
||||||
Rectangle {
|
Rectangle
|
||||||
|
{
|
||||||
parent: viewport
|
parent: viewport
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: palette.light
|
color: palette.light
|
||||||
|
@ -159,11 +167,14 @@ UM.Dialog
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
base.activeCategory = section;
|
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
|
// 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);
|
var item = machineList.model.getItem(i);
|
||||||
if (item.section == section) {
|
if (item.section == section)
|
||||||
|
{
|
||||||
machineList.currentIndex = i;
|
machineList.currentIndex = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue