From 87be930a684b4ca5647cfdf3a8fbcc5ecda417fb Mon Sep 17 00:00:00 2001 From: ntoff Date: Wed, 15 Mar 2017 02:42:12 +0100 Subject: [PATCH] timelapse tab unsaved warning and rearrange interval input box Addition of a notification under the save button when there are unsaved changes, and a notice under the save as default checkbox when unticked, that changes are only temporary. Also move the "interval" box up the top to position it underneath the timelapse type dropdown list, and change the text to be a bit more descriptive. (cherry picked from commit 381a016) --- .../static/js/app/viewmodels/timelapse.js | 5 +++++ src/octoprint/templates/tabs/timelapse.jinja2 | 21 ++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/octoprint/static/js/app/viewmodels/timelapse.js b/src/octoprint/static/js/app/viewmodels/timelapse.js index f50b6da1..fb24cede 100644 --- a/src/octoprint/static/js/app/viewmodels/timelapse.js +++ b/src/octoprint/static/js/app/viewmodels/timelapse.js @@ -21,6 +21,7 @@ $(function() { self.persist = ko.observable(false); self.isDirty = ko.observable(false); + self.isTemporary = ko.observable(true); self.isErrorOrClosed = ko.observable(undefined); self.isOperational = ko.observable(undefined); @@ -30,6 +31,10 @@ $(function() { self.isReady = ko.observable(undefined); self.isLoading = ko.observable(undefined); + self.isTemporary = ko.pureComputed(function() { + return self.isDirty() && !self.persist(); + }); + self.isBusy = ko.pureComputed(function() { return self.isPrinting() || self.isPaused(); }); diff --git a/src/octoprint/templates/tabs/timelapse.jinja2 b/src/octoprint/templates/tabs/timelapse.jinja2 index e876abb5..198549a8 100644 --- a/src/octoprint/templates/tabs/timelapse.jinja2 +++ b/src/octoprint/templates/tabs/timelapse.jinja2 @@ -13,6 +13,14 @@ {{ _('Warning') }} {{ _('Do not use with spiralized ("Joris") vases or similar continuous Z models.') }} {{ _('Note') }} {% trans %}Does not work when printing from the printer's SD Card (no way to detect the change in Z reliably). Use "Timed" mode for those prints instead.{% endtrans %} +
+ +
+ + {{ _('sec') }} +
+
+
@@ -31,15 +39,6 @@
- -
- -
- - {{ _('sec') }} -
-
-
@@ -51,12 +50,14 @@
+ {{ _('You have unsaved changes.') }}