From 22f0a2dabf0c6d40fbae5197f01615a63b927034 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Sep 2016 12:52:50 +0200 Subject: [PATCH 1/3] Add TODOs for text to be added after string freeze We currently have a string freeze, so we can't add these cases here. Contributes to issue CURA-2060. --- resources/qml/MonitorButton.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index 0aac7d5197..c40adeae35 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -99,8 +99,10 @@ Rectangle return catalog.i18nc("@label:MonitorStatus", "Lost connection with the printer"); case "printing": return catalog.i18nc("@label:MonitorStatus", "Printing..."); + //TODO: Add text for case "pausing". case "paused": return catalog.i18nc("@label:MonitorStatus", "Paused"); + //TODO: Add text for case "resuming". case "pre_print": return catalog.i18nc("@label:MonitorStatus", "Preparing..."); case "wait_cleanup": From 3b2c173cd6c501fefe6d49fd264ced4ac79c0bd9 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Sep 2016 12:57:12 +0200 Subject: [PATCH 2/3] Keep showing progress while pausing/resuming I've chosen the blue 'progress' colour to be displayed while pausing and resuming. Contributes to issue CURA-2060. --- resources/qml/MonitorButton.qml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index c40adeae35..dd22a035e0 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -31,6 +31,8 @@ Rectangle { case "printing": case "paused": + case "pausing": + case "resuming": return true; case "pre_print": // heating, etc. case "wait_cleanup": @@ -62,6 +64,8 @@ Rectangle case "printing": case "pre_print": case "wait_cleanup": + case "pausing": + case "resuming": return UM.Theme.getColor("status_busy"); case "ready": case "": From f4d13713a2206df714fbe6c0ed5dac070711ba15 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Sep 2016 13:48:07 +0200 Subject: [PATCH 3/3] Replace progress bar with actual ProgressBar element QML has this progress bar that has more functionality than the progress bar we're using. We need an indeterminate state for the pausing and resuming states, so instead of implementing that myself, I'm using the QML ProgressBar element. Contributes to issue CURA-2060. --- resources/qml/MonitorButton.qml | 50 ++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index dd22a035e0..607d0a24ca 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -143,26 +143,44 @@ Rectangle visible: showProgress } - Rectangle + ProgressBar { - id: progressBar - 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 - radius: UM.Theme.getSize("progressbar_radius").width - color: UM.Theme.getColor("progressbar_background") - visible: showProgress + id: progressBar; + minimumValue: 0; + maximumValue: 100; + value: 0; - Rectangle + //Doing this in an explicit binding since the implicit binding breaks on occasion. + Binding { - width: Math.max(parent.width * base.progress / 100) - height: parent.height - color: base.statusColor - radius: UM.Theme.getSize("progressbar_radius").width + target: progressBar; + property: "value"; + value: base.progress; } + + 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 {