Merge branch 'master' of github.com:Ultimaker/Cura

This commit is contained in:
Jaime van Kessel 2018-11-02 16:14:37 +01:00
commit e2a166ca83
4 changed files with 28 additions and 13 deletions

View File

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

View File

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

View File

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

View File

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