mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Add connectedPrinter to HeatedBedBox
CURA-5943
This commit is contained in:
parent
8eb0f66df3
commit
d8c3078d78
1 changed files with 6 additions and 5 deletions
|
|
@ -1,10 +1,10 @@
|
||||||
// Copyright (c) 2017 Ultimaker B.V.
|
// Copyright (c) 2017 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.
|
||||||
|
|
||||||
import QtQuick 2.2
|
import QtQuick 2.10
|
||||||
import QtQuick.Controls 1.1
|
import QtQuick.Controls 1.4
|
||||||
import QtQuick.Controls.Styles 1.1
|
import QtQuick.Controls.Styles 1.4
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts 1.3
|
||||||
|
|
||||||
import UM 1.2 as UM
|
import UM 1.2 as UM
|
||||||
import Cura 1.0 as Cura
|
import Cura 1.0 as Cura
|
||||||
|
|
@ -14,6 +14,7 @@ Item
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
height: visible ? UM.Theme.getSize("print_setup_extruder_box").height : 0
|
height: visible ? UM.Theme.getSize("print_setup_extruder_box").height : 0
|
||||||
property var printerModel
|
property var printerModel
|
||||||
|
property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
|
|
@ -114,7 +115,7 @@ Item
|
||||||
{
|
{
|
||||||
return false; //Can't preheat if not connected.
|
return false; //Can't preheat if not connected.
|
||||||
}
|
}
|
||||||
if (!connectedPrinter.acceptsCommands)
|
if (connectedPrinter == null || !connectedPrinter.acceptsCommands)
|
||||||
{
|
{
|
||||||
return false; //Not allowed to do anything.
|
return false; //Not allowed to do anything.
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue