mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
Show time remaining instead of "Paused"
Contributes to CL-1047
This commit is contained in:
parent
13717d3ce6
commit
90e8c41fa2
1 changed files with 8 additions and 7 deletions
|
@ -645,6 +645,12 @@ Component
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Sometimes total minus elapsed is less than 0. Use Math.max() to prevent remaining
|
||||||
|
time from ever being less than 0. Negative durations cause strange behavior such
|
||||||
|
as displaying "-1h -1m". */
|
||||||
|
var activeJob = modelData.activePrintJob
|
||||||
|
var remainingTime = Math.max(activeJob.timeTotal - activeJob.timeElapsed, 0);
|
||||||
|
|
||||||
switch(modelData.activePrintJob.state)
|
switch(modelData.activePrintJob.state)
|
||||||
{
|
{
|
||||||
case "wait_cleanup":
|
case "wait_cleanup":
|
||||||
|
@ -662,18 +668,13 @@ Component
|
||||||
case "pausing":
|
case "pausing":
|
||||||
return catalog.i18nc("@label:status", "Pausing")
|
return catalog.i18nc("@label:status", "Pausing")
|
||||||
case "paused":
|
case "paused":
|
||||||
return catalog.i18nc("@label:status", "Paused")
|
return OutputDevice.formatDuration( remainingTime )
|
||||||
case "resuming":
|
case "resuming":
|
||||||
return catalog.i18nc("@label:status", "Resuming")
|
return catalog.i18nc("@label:status", "Resuming")
|
||||||
case "queued":
|
case "queued":
|
||||||
return catalog.i18nc("@label:status", "Action required")
|
return catalog.i18nc("@label:status", "Action required")
|
||||||
default:
|
default:
|
||||||
/* Sometimes total minus elapsed is less than 0. Use Math.max() to prevent
|
return OutputDevice.formatDuration( remainingTime )
|
||||||
remaining time from ever being less than 0. Negative durations cause
|
|
||||||
strange behavior such as displaying "-1h -1m". */
|
|
||||||
var activeJob = modelData.activePrintJob
|
|
||||||
var remaining = activeJob.timeTotal - activeJob.timeElapsed;
|
|
||||||
OutputDevice.formatDuration(Math.max(remaining, 0))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue