From cb24549d7d0caa4f010bb0c26a40e0a8ace84a5e Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 1 Nov 2018 08:29:52 +0100 Subject: [PATCH 1/3] Set CuraApplication display name CURA-5842 --- cura/CuraApplication.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index fc9ba1ebf4..3e9e44149b 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -161,6 +161,7 @@ class CuraApplication(QtApplication): def __init__(self, *args, **kwargs): super().__init__(name = "cura", + app_display_name = "Ultimaker Cura", version = CuraVersion, buildtype = CuraBuildType, is_debug_mode = CuraDebugMode, From ff4dfcf9a6259b477bee7a5685e025df1b6c5b12 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 1 Nov 2018 12:14:49 +0100 Subject: [PATCH 2/3] Make Cura app display name configurable CURA-5842 --- CMakeLists.txt | 1 + cura/CuraApplication.py | 5 +++-- cura/CuraVersion.py.in | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e9bf4b538..deb4e63935 100644 --- a/CMakeLists.txt +++ b/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") diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 3e9e44149b..454c2529dc 100755 --- a/cura/CuraApplication.py +++ b/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,7 +162,7 @@ class CuraApplication(QtApplication): def __init__(self, *args, **kwargs): super().__init__(name = "cura", - app_display_name = "Ultimaker Cura", + app_display_name = CuraAppDisplayName, version = CuraVersion, buildtype = CuraBuildType, is_debug_mode = CuraDebugMode, diff --git a/cura/CuraVersion.py.in b/cura/CuraVersion.py.in index 226b2183f2..388429bc02 100644 --- a/cura/CuraVersion.py.in +++ b/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 From e61a6e7a5cea0d4aa4812738d485c4dcfca9ec05 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 1 Nov 2018 09:32:23 +0100 Subject: [PATCH 3/3] Fix codestyle --- resources/qml/AddMachineDialog.qml | 35 ++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/resources/qml/AddMachineDialog.qml b/resources/qml/AddMachineDialog.qml index 1b39cdeac2..0df8b891d9 100644 --- a/resources/qml/AddMachineDialog.qml +++ b/resources/qml/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; }