mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-23 06:09:38 +08:00
Fix a couple of qml casting errors
This commit is contained in:
parent
a9ed562a58
commit
0c8d0a11a9
@ -16,6 +16,7 @@ UM.Dialog
|
||||
{
|
||||
id: base
|
||||
title: catalog.i18nc("@title:window", "Add Printer")
|
||||
property bool firstRun: false
|
||||
property string preferredCategory: "Ultimaker"
|
||||
property string activeCategory: preferredCategory
|
||||
|
||||
@ -32,7 +33,7 @@ UM.Dialog
|
||||
signal machineAdded(string id)
|
||||
function getMachineName()
|
||||
{
|
||||
var name = machineList.model.get(machineList.currentIndex).name
|
||||
var name = machineList.model.get(machineList.currentIndex) != undefined ? machineList.model.get(machineList.currentIndex).name : ""
|
||||
return name
|
||||
}
|
||||
|
||||
|
@ -677,6 +677,7 @@ UM.MainWindow
|
||||
id: addMachineDialog
|
||||
onMachineAdded:
|
||||
{
|
||||
machineActionsWizard.firstRun = addMachineDialog.firstRun
|
||||
machineActionsWizard.start(id)
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ UM.ManagementPage
|
||||
Repeater
|
||||
{
|
||||
id: machineActionRepeater
|
||||
model: Cura.MachineActionManager.getSupportedActions(Cura.MachineManager.getDefinitionByMachineId(base.currentItem.id))
|
||||
model: base.currentItem ? Cura.MachineActionManager.getSupportedActions(Cura.MachineManager.getDefinitionByMachineId(base.currentItem.id)) : null
|
||||
|
||||
Button
|
||||
{
|
||||
@ -125,8 +125,8 @@ UM.ManagementPage
|
||||
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
Label { text: catalog.i18nc("@label", "Type") }
|
||||
Label { text: base.currentItem ? base.currentItem.metadata.definition_name : "" }
|
||||
Label { text: catalog.i18nc("@label", "Type"); visible: base.currentItem }
|
||||
Label { text: (base.currentItem && base.currentItem.metadata) ? base.currentItem.metadata.definition_name : "" }
|
||||
}
|
||||
|
||||
UM.I18nCatalog { id: catalog; name: "uranium"; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user