From 7fb2745f8f73b2b81d187109eea0e266237f6cd8 Mon Sep 17 00:00:00 2001 From: Dattas Moonchaser Date: Wed, 19 Oct 2016 15:22:15 -0600 Subject: [PATCH] Add confirmation dialog to cancel to prevent accidental cancel of print (which is hard to undo!) --- src/octoprint/static/js/app/viewmodels/printerstate.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/octoprint/static/js/app/viewmodels/printerstate.js b/src/octoprint/static/js/app/viewmodels/printerstate.js index 08747b10..745d3551 100644 --- a/src/octoprint/static/js/app/viewmodels/printerstate.js +++ b/src/octoprint/static/js/app/viewmodels/printerstate.js @@ -288,7 +288,12 @@ $(function() { }; self.cancel = function() { - OctoPrint.job.cancel(); + showConfirmationDialog({ + message: gettext("This will cancel your print."), + onproceed: function() { + OctoPrint.job.cancel(); + } + }); }; }