Add some comments

Contributes to CL-1154
This commit is contained in:
Ian Paschal 2019-01-25 12:39:27 +01:00
parent ee5c6ed3fb
commit 3b8281dc5b

View file

@ -20,6 +20,12 @@ Rectangle
color: UM.Theme.getColor("viewport_overlay")
anchors.fill: parent
UM.I18nCatalog
{
id: catalog
name: "cura"
}
// This mouse area is to prevent mouse clicks to be passed onto the scene.
MouseArea
{
@ -47,15 +53,21 @@ Rectangle
sourceComponent: Cura.MachineManager.printerOutputDevices.length > 0 ? Cura.MachineManager.printerOutputDevices[0].monitorItem : null
}
/**
* In an ideal world, this code would go in the UM3NetworkingPlugin but that plugin is never even loaded unless we
* manage to connect to them. Moving the conditional in monitorViewComponent.sourceComponent would allow us to
* always load the UM3NetworkingPlugin and then evaluate what UI to show, but it would break any other plugins which
* use this plugin. So putting some code here felt like the lesser evil.
*/
Column
{
anchors
{
top: parent.top
topMargin: 67 * screenScaleFactor
topMargin: 67 * screenScaleFactor // TODO: Theme!
horizontalCenter: parent.horizontalCenter
}
width: 480 * screenScaleFactor
width: 480 * screenScaleFactor // TODO: Theme!
spacing: UM.Theme.getSize("default_margin").height
Label
@ -65,11 +77,11 @@ Rectangle
horizontalCenter: parent.horizontalCenter
}
visible: isNetworkEnabled && !isConnected
text: "Please smake sure your printer has connection:\n- Check if the printer is turned on.\n- Check if the printer is connected to the network."
text: catalog.i18nc("@info", "Please smake sure your printer has connection:\n- Check if the printer is turned on.\n- Check if the printer is connected to the network.")
font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("monitor_text_primary")
wrapMode: Text.WordWrap
lineHeight: 28 * screenScaleFactor
lineHeight: 28 * screenScaleFactor // TODO: Theme!
lineHeightMode: Text.FixedHeight
width: contentWidth
}
@ -81,11 +93,8 @@ Rectangle
horizontalCenter: parent.horizontalCenter
}
visible: isNetworkEnabled && !isConnected
text: "Reconnect"
onClicked:
{
// nothing
}
text: catalog.i18nc("@action:button", "Reconnect")
onClicked: Cura.MachineManager.setActiveMachine(Cura.MachineManager.activeMachineId) // Try to refresh
}
Label
@ -95,12 +104,12 @@ Rectangle
horizontalCenter: parent.horizontalCenter
}
visible: !isNetworkEnabled
text: "Please select a network connected printer to monitor the status and queue or connect your Ultimaker printer to your local network."
text: catalog.i18nc("@info", "Please select a network connected printer to monitor the status and queue or connect your Ultimaker printer to your local network.")
font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("monitor_text_primary")
wrapMode: Text.WordWrap
width: parent.width
lineHeight: 28 * screenScaleFactor
lineHeight: 28 * screenScaleFactor // TODO: Theme!
lineHeightMode: Text.FixedHeight
}
Item
@ -119,8 +128,8 @@ Rectangle
anchors.verticalCenter: parent.verticalCenter
color: UM.Theme.getColor("monitor_text_link")
source: UM.Theme.getIcon("external_link")
width: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!)
height: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!)
width: 16 * screenScaleFactor // TODO: Theme!
height: 16 * screenScaleFactor // TODO: Theme!
}
Label
{