mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 21:38:58 +08:00
Some cleanup
This commit is contained in:
parent
28c5debd61
commit
548761fcc3
@ -19,3 +19,40 @@ class MonitorStage(CuraStage):
|
|||||||
sidebar_component_path = os.path.join(Resources.getPath(Application.getInstance().ResourceTypes.QmlFiles), "Sidebar.qml")
|
sidebar_component_path = os.path.join(Resources.getPath(Application.getInstance().ResourceTypes.QmlFiles), "Sidebar.qml")
|
||||||
self.addDisplayComponent("sidebar", sidebar_component_path)
|
self.addDisplayComponent("sidebar", sidebar_component_path)
|
||||||
self.setIconSource(Application.getInstance().getTheme().getIcon("tab_status_connected"))
|
self.setIconSource(Application.getInstance().getTheme().getIcon("tab_status_connected"))
|
||||||
|
|
||||||
|
# property string iconSource:
|
||||||
|
# // {
|
||||||
|
# // if (!printerConnected)
|
||||||
|
# // {
|
||||||
|
# // return UM.Theme.getIcon("tab_status_unknown");
|
||||||
|
# // }
|
||||||
|
# // else if (!printerAcceptsCommands)
|
||||||
|
# // {
|
||||||
|
# // return UM.Theme.getIcon("tab_status_unknown");
|
||||||
|
# // }
|
||||||
|
# //
|
||||||
|
# // if (Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance")
|
||||||
|
# // {
|
||||||
|
# // return UM.Theme.getIcon("tab_status_busy");
|
||||||
|
# // }
|
||||||
|
# //
|
||||||
|
# // switch (Cura.MachineManager.printerOutputDevices[0].jobState)
|
||||||
|
# // {
|
||||||
|
# // case "printing":
|
||||||
|
# // case "pre_print":
|
||||||
|
# // case "pausing":
|
||||||
|
# // case "resuming":
|
||||||
|
# // return UM.Theme.getIcon("tab_status_busy");
|
||||||
|
# // case "wait_cleanup":
|
||||||
|
# // return UM.Theme.getIcon("tab_status_finished");
|
||||||
|
# // case "ready":
|
||||||
|
# // case "":
|
||||||
|
# // return UM.Theme.getIcon("tab_status_connected")
|
||||||
|
# // case "paused":
|
||||||
|
# // return UM.Theme.getIcon("tab_status_paused")
|
||||||
|
# // case "error":
|
||||||
|
# // return UM.Theme.getIcon("tab_status_stopped")
|
||||||
|
# // default:
|
||||||
|
# // return UM.Theme.getIcon("tab_status_unknown")
|
||||||
|
# // }
|
||||||
|
# // }
|
@ -16,7 +16,7 @@ Rectangle
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
height: UM.Theme.getSize("sidebar_header").height
|
height: UM.Theme.getSize("sidebar_header").height
|
||||||
color: UM.Controller.activeStage.id == "MonitorStage" ? UM.Theme.getColor("topbar_background_color_monitoring") : UM.Theme.getColor("topbar_background_color")
|
color: UM.Controller.activeStage.stageId == "MonitorStage" ? UM.Theme.getColor("topbar_background_color_monitoring") : UM.Theme.getColor("topbar_background_color")
|
||||||
|
|
||||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||||
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
|
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
|
||||||
@ -87,66 +87,6 @@ Rectangle
|
|||||||
}
|
}
|
||||||
|
|
||||||
ExclusiveGroup { id: topbarMenuGroup }
|
ExclusiveGroup { id: topbarMenuGroup }
|
||||||
|
|
||||||
// Button
|
|
||||||
// {
|
|
||||||
// id: showMonitor
|
|
||||||
// width: UM.Theme.getSize("topbar_button").width
|
|
||||||
// height: UM.Theme.getSize("sidebar_header").height
|
|
||||||
// text: catalog.i18nc("@title:tab", "Monitor")
|
|
||||||
// checkable: true
|
|
||||||
// checked: isChecked()
|
|
||||||
// exclusiveGroup: sidebarHeaderBarGroup
|
|
||||||
// style: UM.Theme.styles.topbar_header_tab_no_overlay
|
|
||||||
//
|
|
||||||
// // We use a Qt.binding to re-bind the checkbox state after manually setting it
|
|
||||||
// // https://stackoverflow.com/questions/38798450/qt-5-7-qml-why-are-my-checkbox-property-bindings-disappearing
|
|
||||||
// onClicked: {
|
|
||||||
// base.startMonitoringPrint()
|
|
||||||
// checked = Qt.binding(isChecked)
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// function isChecked () {
|
|
||||||
// return base.monitoringPrint
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// property string iconSource:
|
|
||||||
// {
|
|
||||||
// if (!printerConnected)
|
|
||||||
// {
|
|
||||||
// return UM.Theme.getIcon("tab_status_unknown");
|
|
||||||
// }
|
|
||||||
// else if (!printerAcceptsCommands)
|
|
||||||
// {
|
|
||||||
// return UM.Theme.getIcon("tab_status_unknown");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance")
|
|
||||||
// {
|
|
||||||
// return UM.Theme.getIcon("tab_status_busy");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// switch (Cura.MachineManager.printerOutputDevices[0].jobState)
|
|
||||||
// {
|
|
||||||
// case "printing":
|
|
||||||
// case "pre_print":
|
|
||||||
// case "pausing":
|
|
||||||
// case "resuming":
|
|
||||||
// return UM.Theme.getIcon("tab_status_busy");
|
|
||||||
// case "wait_cleanup":
|
|
||||||
// return UM.Theme.getIcon("tab_status_finished");
|
|
||||||
// case "ready":
|
|
||||||
// case "":
|
|
||||||
// return UM.Theme.getIcon("tab_status_connected")
|
|
||||||
// case "paused":
|
|
||||||
// return UM.Theme.getIcon("tab_status_paused")
|
|
||||||
// case "error":
|
|
||||||
// return UM.Theme.getIcon("tab_status_stopped")
|
|
||||||
// default:
|
|
||||||
// return UM.Theme.getIcon("tab_status_unknown")
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolButton
|
ToolButton
|
||||||
|
Loading…
x
Reference in New Issue
Block a user