1 parent
81d523b73d
commit
601451a3f1
6 files changed
+17
-6
No files matched your search
@@ -92,7 +92,8 @@ def getSettings():
|
||||
"colorTransparent": s.getBoolean(["appearance", "colorTransparent"]),
|
||||
"colorIcon": s.getBoolean(["appearance", "colorIcon"]),
|
||||
"defaultLanguage": s.get(["appearance", "defaultLanguage"]),
|
||||
"showFahrenheitAlso": s.getBoolean(["appearance", "showFahrenheitAlso"])
|
||||
"showFahrenheitAlso": s.getBoolean(["appearance", "showFahrenheitAlso"]),
|
||||
"fuzzyTimes": s.getBoolean(["appearance", "fuzzyTimes"])
|
||||
},
|
||||
"printer": {
|
||||
"defaultExtrusionLength": s.getInt(["printerParameters", "defaultExtrusionLength"])
|
||||
@@ -379,6 +380,7 @@ def _saveSettings(data):
|
||||
if "colorIcon" in data["appearance"]: s.setBoolean(["appearance", "colorIcon"], data["appearance"]["colorIcon"])
|
||||
if "defaultLanguage" in data["appearance"]: s.set(["appearance", "defaultLanguage"], data["appearance"]["defaultLanguage"])
|
||||
if "showFahrenheitAlso" in data["appearance"]: s.setBoolean(["appearance", "showFahrenheitAlso"], data["appearance"]["showFahrenheitAlso"])
|
||||
if "fuzzyTimes" in data["appearance"]: s.setBoolean(["appearance", "fuzzyTimes"], data["appearance"]["fuzzyTimes"])
|
||||
|
||||
if "printer" in data.keys():
|
||||
if "defaultExtrusionLength" in data["printer"]: s.setInt(["printerParameters", "defaultExtrusionLength"], data["printer"]["defaultExtrusionLength"])
|
||||
|
||||
@@ -292,6 +292,7 @@ default_settings = {
|
||||
"colorIcon": True,
|
||||
"defaultLanguage": "_default",
|
||||
"showFahrenheitAlso": False,
|
||||
"fuzzyTimes": True,
|
||||
"components": {
|
||||
"order": {
|
||||
"navbar": ["settings", "systemmenu", "plugin_announcements", "plugin_pi_support", "login"],
|
||||
|
||||
@@ -625,7 +625,7 @@ $(function() {
|
||||
});
|
||||
}
|
||||
}
|
||||
output += gettext("Estimated print time") + ": " + formatFuzzyPrintTime(data["gcodeAnalysis"]["estimatedPrintTime"]) + "<br>";
|
||||
output += gettext("Estimated print time") + ": " + (self.settingsViewModel.appearance_fuzzyTimes() ? formatFuzzyPrintTime(data["gcodeAnalysis"]["estimatedPrintTime"]) : formatDuration(data["gcodeAnalysis"]["estimatedPrintTime"])) + "<br>";
|
||||
}
|
||||
if (data["prints"] && data["prints"]["last"]) {
|
||||
output += gettext("Last printed") + ": " + formatTimeAgo(data["prints"]["last"]["date"]) + "<br>";
|
||||
|
||||
@@ -58,9 +58,9 @@ $(function() {
|
||||
|
||||
self.estimatedPrintTimeString = ko.pureComputed(function() {
|
||||
if (self.lastPrintTime())
|
||||
return formatFuzzyPrintTime(self.lastPrintTime());
|
||||
return self.settings.appearance_fuzzyTimes() ? formatFuzzyPrintTime(self.lastPrintTime()) : formatDuration(self.lastPrintTime());
|
||||
if (self.estimatedPrintTime())
|
||||
return formatFuzzyPrintTime(self.estimatedPrintTime());
|
||||
return self.settings.appearance_fuzzyTimes() ? formatFuzzyPrintTime(self.estimatedPrintTime()) : formatDuration(self.estimatedPrintTime());
|
||||
return "-";
|
||||
});
|
||||
self.byteString = ko.pureComputed(function() {
|
||||
@@ -80,14 +80,14 @@ $(function() {
|
||||
return formatDuration(self.printTime());
|
||||
});
|
||||
self.printTimeLeftString = ko.pureComputed(function() {
|
||||
if (self.printTimeLeft() == undefined) {
|
||||
if (self.printTimeLeft() === undefined) {
|
||||
if (!self.printTime() || !(self.isPrinting() || self.isPaused())) {
|
||||
return "-";
|
||||
} else {
|
||||
return gettext("Still stabilizing...");
|
||||
}
|
||||
} else {
|
||||
return formatFuzzyPrintTime(self.printTimeLeft());
|
||||
return self.settings.appearance_fuzzyTimes() ? formatFuzzyPrintTime(self.printTimeLeft()) : formatDuration(self.printTimeLeft());
|
||||
}
|
||||
});
|
||||
self.printTimeLeftOriginString = ko.pureComputed(function() {
|
||||
|
||||
@@ -114,6 +114,7 @@ $(function() {
|
||||
self.appearance_colorIcon = ko.observable();
|
||||
self.appearance_defaultLanguage = ko.observable();
|
||||
self.appearance_showFahrenheitAlso = ko.observable(undefined);
|
||||
self.appearance_fuzzyTimes = ko.observable(undefined);
|
||||
|
||||
self.printer_defaultExtrusionLength = ko.observable(undefined);
|
||||
|
||||
|
||||
@@ -50,6 +50,13 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: appearance_fuzzyTimes" id="settings-appearanceFuzzyTimes"> {{ _('Show fuzzy print time estimates') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="settings_appearance_managelanguagesdialog" class="modal hide fade">
|
||||
|
||||
Reference in new issue
Block a user