Always show unfuzzy times for total print time and time left in tooltip

This commit is contained in:
Bryan Mayland committed 2019-02-14 14:41:01 +00:00
1 parent 38868303da
commit 28a515ba6a
2 files changed
+21 -9

No files matched your search

@@ -56,14 +56,20 @@ $(function() {
self.titlePrintButton = ko.observable(self.TITLE_PRINT_BUTTON_UNPAUSED);
self.titlePauseButton = ko.observable(self.TITLE_PAUSE_BUTTON_UNPAUSED);
self.estimatedPrintTimeString = ko.pureComputed(function() {
var estimatedPrintTimeStringHlpr = function (fmt) {
if (self.lastPrintTime())
return self.settings.appearance_fuzzyTimes() ? formatFuzzyPrintTime(self.lastPrintTime()) : formatDuration(self.lastPrintTime());
return fmt(self.lastPrintTime());
if (self.estimatedPrintTime())
return self.settings.appearance_fuzzyTimes() ? formatFuzzyPrintTime(self.estimatedPrintTime()) : formatDuration(self.estimatedPrintTime());
return fmt(self.estimatedPrintTime());
return "-";
}
self.estimatedPrintTimeString = ko.pureComputed(function() {
return estimatedPrintTimeStringHlpr(self.settings.appearance_fuzzyTimes() ? formatFuzzyPrintTime : formatDuration);
});
self.byteString = ko.pureComputed(function() {
self.estimatedPrintTimeExactString = ko.pureComputed(function() {
return estimatedPrintTimeStringHlpr(formatDuration);
});
self.byteString = ko.pureComputed(function() {
if (!self.filesize())
return "-";
var filepos = self.filepos() ? formatSize(self.filepos()) : "-";
@@ -79,16 +85,22 @@ $(function() {
return "-";
return formatDuration(self.printTime());
});
self.printTimeLeftString = ko.pureComputed(function() {
if (self.printTimeLeft() === undefined) {
var printTimeLeftStringHlpr = function (fmt) {
if (self.printTimeLeft() == undefined) {
if (!self.printTime() || !(self.isPrinting() || self.isPaused())) {
return "-";
} else {
return gettext("Still stabilizing...");
}
} else {
return self.settings.appearance_fuzzyTimes() ? formatFuzzyPrintTime(self.printTimeLeft()) : formatDuration(self.printTimeLeft());
return fmt(self.printTimeLeft());
}
}
self.printTimeLeftString = ko.pureComputed(function() {
return printTimeLeftStringHlpr(self.settings.appearance_fuzzyTimes() ? formatFuzzyPrintTime : formatDuration);
});
self.printTimeLeftExactString = ko.pureComputed(function() {
return printTimeLeftStringHlpr(formatDuration);
});
self.printTimeLeftOriginString = ko.pureComputed(function() {
var value = self.printTimeLeftOrigin();
+2 -2
View File
@@ -10,10 +10,10 @@
<!-- ko foreach: filament -->
<span data-bind="text: 'Filament (' + name() + '): ', title: 'Filament usage for ' + name()"></span><strong data-bind="text: formatFilament(data())"></strong><br>
<!-- /ko -->
<span title="{{ _('Estimated total print time based on analysis of the file or past prints') }}">{{ _('Approx. Total Print Time') }}</span>: <strong data-bind="text: estimatedPrintTimeString"></strong><br>
<span title="{{ _('Estimated total print time based on analysis of the file or past prints') }}">{{ _('Approx. Total Print Time') }}</span>: <strong data-bind="text: estimatedPrintTimeString, attr: {title: estimatedPrintTimeExactString}"></strong><br>
<hr>
<span title="{{ _('Total print time so far') }}">{{ _('Print Time') }}</span>: <strong data-bind="text: printTimeString"></strong><br>
<span title="{{ _('Estimated time until the print job is done. This is only an estimate and accuracy depends heavily on various factors!') }}">{{ _('Print Time Left') }}</span>: <strong data-bind="text: printTimeLeftString"></strong> <span id="state_printtimeleft_popover" style="display: none" data-bind="visible: printTimeLeftOrigin, attr: {title: printTimeLeftOriginString}, css: printTimeLeftOriginClass">&#9679;</span><br>
<span title="{{ _('Estimated time until the print job is done. This is only an estimate and accuracy depends heavily on various factors!') }}">{{ _('Print Time Left') }}</span>: <strong data-bind="text: printTimeLeftString, attr: {title: printTimeLeftExactString}"></strong> <span id="state_printtimeleft_popover" style="display: none" data-bind="visible: printTimeLeftOrigin, attr: {title: printTimeLeftOriginString}, css: printTimeLeftOriginClass">&#9679;</span><br>
<span title="{{ _('Bytes printed vs total bytes of file') }}">{{ _('Printed') }}</span>: <strong data-bind="text: byteString"></strong><br>