Merge branch 'cura4.0_header' into cura4.0_action_panel

This commit is contained in:
Diego Prado Gesto 2018-11-06 09:23:39 +01:00
commit 257d482184
14 changed files with 119 additions and 174 deletions

View file

@ -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")

View file

@ -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,

View file

@ -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

View file

@ -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:

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -45,6 +45,7 @@ Item
id: machineSelection
width: UM.Theme.getSize("machine_selector_widget").width - configSelection.width
height: prepareMenu.height
z: openFileButton.z - 1
}
Cura.QuickConfigurationSelector

View file

@ -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",

View file

@ -11,6 +11,7 @@ Column
{
property var profile: null
property var loggedIn: false
property var profileImage: ""
padding: 2 * UM.Theme.getSize("default_margin").height
spacing: 2 * UM.Theme.getSize("default_margin").height
@ -21,7 +22,18 @@ Column
width: UM.Theme.getSize("avatar_image").width
height: UM.Theme.getSize("avatar_image").height
anchors.horizontalCenter: parent.horizontalCenter
source: loggedIn ? profile["profile_image_url"] : UM.Theme.getImage("avatar_no_user")
source:
{
if(loggedIn)
{
if(profileImage)
{
return profileImage
}
return UM.Theme.getImage("avatar_no_user")
}
return UM.Theme.getImage("avatar_no_user")
}
outlineColor: loggedIn ? UM.Theme.getColor("account_widget_outline_active") : UM.Theme.getColor("lining")
}

View file

@ -25,7 +25,18 @@ Button
anchors.verticalCenter: accountWidget.verticalCenter
anchors.horizontalCenter: accountWidget.horizontalCenter
source: loggedIn ? profile["profile_image_url"] : UM.Theme.getImage("avatar_no_user")
source:
{
if(loggedIn)
{
if(profile["profile_image_url"])
{
return profile["profile_image_url"]
}
return UM.Theme.getImage("avatar_no_user")
}
return UM.Theme.getImage("avatar_no_user")
}
outlineColor: loggedIn ? UM.Theme.getColor("account_widget_outline_active") : UM.Theme.getColor("lining")
}
@ -45,6 +56,7 @@ Button
id: panel
profile: Cura.API.account.userProfile
loggedIn: Cura.API.account.isLoggedIn
profileImage: Cura.API.account.profileImageUrl
}
background: UM.PointingRectangle

View file

@ -24,6 +24,7 @@ Item
source: UM.Theme.getImage("avatar_default")
fillMode: Image.PreserveAspectCrop
visible: false
mipmap: true
}
Rectangle
@ -44,7 +45,10 @@ Item
UM.RecolorImage
{
id: profileImageOutline
anchors.fill: parent
anchors.centerIn: parent
// Make it a bit bigger than it has to, otherwise it sometimes shows a white border.
width: parent.width + 2
height: parent.height + 2
source: UM.Theme.getIcon("circle_outline")
sourceSize: Qt.size(parent.width, parent.height)
color: UM.Theme.getColor("account_widget_ouline_active")

View file

@ -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;
}

View file

@ -106,10 +106,10 @@ Rectangle
model: modesListModel
width: Math.round(parent.width * 0.55)
height: UM.Theme.getSize("print_setup_mode_toggle").height
visible: !hideSettings
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("thick_margin").width
anchors.top: settingsModeLabel.top
ButtonGroup
@ -191,6 +191,8 @@ Rectangle
anchors.right: parent.right
height: UM.Theme.getSize("print_setup_widget").height
visible: !hideSettings
// We load both of them at once (instead of using a loader) because the advanced sidebar can take
// quite some time to load. So in this case we sacrifice memory for speed.
SidebarAdvanced