forked from fieldOfView/Cura-OctoPrintPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOctoPrintComponents.qml
31 lines (25 loc) · 1 KB
/
OctoPrintComponents.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) 2019 Aldo Hoeben / fieldOfView
// OctoPrintPlugin is released under the terms of the AGPLv3 or higher.
import UM 1.2 as UM
import Cura 1.0 as Cura
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1
Item
{
id: base
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
property bool octoPrintConnected: printerConnected && Cura.MachineManager.printerOutputDevices[0].hasOwnProperty("octoprintVersion")
Button
{
objectName: "openOctoPrintButton"
height: UM.Theme.getSize("save_button_save_to_button").height
tooltip: catalog.i18nc("@info:tooltip", "Open the OctoPrint web interface")
text: catalog.i18nc("@action:button", "OctoPrint...")
style: UM.Theme.styles.sidebar_action_button
onClicked: manager.openWebPage(Cura.MachineManager.printerOutputDevices[0].baseURL)
visible: octoPrintConnected
}
UM.I18nCatalog{id: catalog; name:"cura"}
}