diff --git a/src/octoprint/static/js/app/dataupdater.js b/src/octoprint/static/js/app/dataupdater.js index 443f657d..c607016d 100644 --- a/src/octoprint/static/js/app/dataupdater.js +++ b/src/octoprint/static/js/app/dataupdater.js @@ -7,7 +7,6 @@ function DataUpdater(allViewModels) { self._configHash = undefined; self.reloadOverlay = $("#reloadui_overlay"); - $("#reloadui_overlay_reload").click(function() { location.reload(true); }); self.connect = function() { OctoPrint.socket.connect({debug: !!SOCKJS_DEBUG}); diff --git a/src/octoprint/static/js/app/viewmodels/settings.js b/src/octoprint/static/js/app/viewmodels/settings.js index f3d0ed20..0e2a23d5 100644 --- a/src/octoprint/static/js/app/viewmodels/settings.js +++ b/src/octoprint/static/js/app/viewmodels/settings.js @@ -705,7 +705,7 @@ $(function() { data = getOnlyChangedData(self.getLocalData(), self.lastReceivedSettings); } - OctoPrint.settings.save(data) + return OctoPrint.settings.save(data) .done(function(data, status, xhr) { self.receiving(true); self.sending(false); diff --git a/src/octoprint/static/js/app/viewmodels/wizard.js b/src/octoprint/static/js/app/viewmodels/wizard.js index 54ca62e4..de9db3d0 100644 --- a/src/octoprint/static/js/app/viewmodels/wizard.js +++ b/src/octoprint/static/js/app/viewmodels/wizard.js @@ -6,6 +6,7 @@ $(function() { self.settingsViewModel = parameters[1]; self.wizardDialog = undefined; + self.reloadOverlay = undefined; self.allViewModels = undefined; @@ -40,6 +41,7 @@ $(function() { self.onStartup = function() { self.wizardDialog = $("#wizard_dialog"); + self.reloadOverlay = $("#reloadui_overlay"); }; self.onUserLoggedIn = function() { @@ -126,8 +128,7 @@ $(function() { .done(function() { self.closeDialog(); if (reload) { - log.info("Wizard requested reloading"); - location.reload(true); + self.reloadOverlay.show(); } }); } @@ -144,12 +145,27 @@ $(function() { }; self.finishWizard = function() { + var deferred = $.Deferred(); self.finishing = true; - self.settingsViewModel.saveData(); - return OctoPrint.wizard.finish(self.wizards) - .always(function() { - self.finishing = false; + + self.settingsViewModel.saveData() + .done(function() { + OctoPrint.wizard.finish(self.wizards) + .done(function() { + deferred.resolve(arguments); + }) + .fail(function() { + deferred.reject(arguments); + }) + .always(function() { + self.finishing = false; + }); + }) + .fail(function() { + deferred.reject(arguments); }); + + return deferred; }; self.onSettingsPreventRefresh = function() { diff --git a/src/octoprint/templates/overlays/reloadui.jinja2 b/src/octoprint/templates/overlays/reloadui.jinja2 index 8790002e..746c9129 100644 --- a/src/octoprint/templates/overlays/reloadui.jinja2 +++ b/src/octoprint/templates/overlays/reloadui.jinja2 @@ -4,9 +4,14 @@
{{ _('There is a new version of the server active now, a reload of the user interface is needed. This will not interrupt any print jobs you might have ongoing. Please reload the web interface now by clicking the button below.') }}
+{% trans %} + There is a new version of the server active now, a reload + of the user interface is needed. This will not interrupt + any print jobs you might have ongoing. Please reload the + web interface now by clicking the button below. + {% endtrans %}