Merge branch 'master' of github.com:Ultimaker/Cura

This commit is contained in:
Jaime van Kessel 2016-09-27 14:06:41 +02:00
commit fc69b110f3

View File

@ -31,6 +31,8 @@ Rectangle
{ {
case "printing": case "printing":
case "paused": case "paused":
case "pausing":
case "resuming":
return true; return true;
case "pre_print": // heating, etc. case "pre_print": // heating, etc.
case "wait_cleanup": case "wait_cleanup":
@ -62,6 +64,8 @@ Rectangle
case "printing": case "printing":
case "pre_print": case "pre_print":
case "wait_cleanup": case "wait_cleanup":
case "pausing":
case "resuming":
return UM.Theme.getColor("status_busy"); return UM.Theme.getColor("status_busy");
case "ready": case "ready":
case "": case "":
@ -99,8 +103,10 @@ Rectangle
return catalog.i18nc("@label:MonitorStatus", "Lost connection with the printer"); return catalog.i18nc("@label:MonitorStatus", "Lost connection with the printer");
case "printing": case "printing":
return catalog.i18nc("@label:MonitorStatus", "Printing..."); return catalog.i18nc("@label:MonitorStatus", "Printing...");
//TODO: Add text for case "pausing".
case "paused": case "paused":
return catalog.i18nc("@label:MonitorStatus", "Paused"); return catalog.i18nc("@label:MonitorStatus", "Paused");
//TODO: Add text for case "resuming".
case "pre_print": case "pre_print":
return catalog.i18nc("@label:MonitorStatus", "Preparing..."); return catalog.i18nc("@label:MonitorStatus", "Preparing...");
case "wait_cleanup": case "wait_cleanup":
@ -137,26 +143,44 @@ Rectangle
visible: showProgress visible: showProgress
} }
Rectangle ProgressBar
{ {
id: progressBar id: progressBar;
width: parent.width - 2 * UM.Theme.getSize("default_margin").width minimumValue: 0;
height: UM.Theme.getSize("progressbar").height maximumValue: 100;
anchors.top: statusLabel.bottom value: 0;
anchors.topMargin: UM.Theme.getSize("default_margin").height / 4
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
radius: UM.Theme.getSize("progressbar_radius").width
color: UM.Theme.getColor("progressbar_background")
visible: showProgress
Rectangle //Doing this in an explicit binding since the implicit binding breaks on occasion.
Binding
{ {
width: Math.max(parent.width * base.progress / 100) target: progressBar;
height: parent.height property: "value";
color: base.statusColor value: base.progress;
radius: UM.Theme.getSize("progressbar_radius").width
} }
visible: showProgress;
indeterminate:
{
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
{
case "pausing":
case "resuming":
return true;
default:
return false;
}
}
style: UM.Theme.styles.progressbar;
property string backgroundColor: UM.Theme.getColor("progressbar_background");
property string controlColor: base.statusColor;
width: parent.width - 2 * UM.Theme.getSize("default_margin").width;
height: UM.Theme.getSize("progressbar").height;
anchors.top: statusLabel.bottom;
anchors.topMargin: UM.Theme.getSize("default_margin").height / 4;
anchors.left: parent.left;
anchors.leftMargin: UM.Theme.getSize("default_margin").width;
} }
Row { Row {