diff --git a/octoprint/server.py b/octoprint/server.py index 34df0b7a..d8e536d2 100644 --- a/octoprint/server.py +++ b/octoprint/server.py @@ -453,10 +453,10 @@ def getSettings(): "system": { "actions": s.get(["system", "actions"]) }, - "cura_engine": { - "cura_enabled": s.get(["cura_engine", "cura_enabled"]), - "cura_path": s.get(["cura_engine", "cura_path"]), - "cura_config": s.get(["cura_engine", "cura_config"]) + "curaEngine": { + "enabled": s.getBoolean(["curaEngine", "enabled"]), + "path": s.get(["curaEngine", "path"]), + "config": s.get(["curaEngine", "config"]) } }) @@ -504,21 +504,21 @@ def setSettings(): if "system" in data.keys(): if "actions" in data["system"].keys(): s.set(["system", "actions"], data["system"]["actions"]) - cura_engine = data.get("cura_engine", None) + curaEngine = data.get("curaEngine", None) - if cura_engine: + if curaEngine: - cura_enabled = cura_engine.get("cura_enabled") - if cura_enabled: - s.setBoolean(["cura_engine", "cura_path"], cura_enabled) + path = curaEngine.get("path") + if path: + s.set(["curaEngine", "path"], path) - cura_path = cura_engine.get("cura_path") - if cura_path: - s.set(["cura_engine", "cura_path"], cura_path) + config = curaEngine.get("config") + if config: + s.set(["curaEngine", "config"], config) - cura_config = cura_engine.get("cura_config") - if cura_config: - s.set(["cura_engine", "cura_config"], cura_config) + # Enabled is a boolean so we cannot check that we have a result + enabled = curaEngine.get("enabled") + s.setBoolean(["curaEngine", "enabled"], enabled) s.save() diff --git a/octoprint/settings.py b/octoprint/settings.py index 458495a0..eac62ecd 100644 --- a/octoprint/settings.py +++ b/octoprint/settings.py @@ -80,10 +80,10 @@ default_settings = { "userManager": "octoprint.users.FilebasedUserManager", "userfile": None }, - "cura_engine": { - "cura_enabled": True, - "cura_path": "/something/wicked/this/way/comes/", - "cura_config": "/here/there/be/dragons" + "curaEngine": { + "enabled": True, + "config": "/here/there/be/dragons/that/want/to/eat/you/", + "path": "/here/there/be/dragons/that/want/to/eat/you/" } } @@ -140,6 +140,7 @@ class Settings(object): #~~ getter def get(self, path): + logging.info("SETTINGS:GET:%s" % path) if len(path) == 0: return None @@ -166,15 +167,20 @@ class Settings(object): results = [] for key in keys: if key in config.keys(): + logging.info("USERSET") results.append(config[key]) elif key in defaults: + logging.info("DEFAULT") results.append(defaults[key]) else: results.append(None) if not isinstance(k, (list, tuple)): - return results.pop() + result = results.pop() + logging.info("SETTINGS:GET:RESULT:%s" % str(result)) + return result else: + logging.info("SETTINGS:GET:RESULTS:%s" % str(results)) return results def getInt(self, path): diff --git a/octoprint/static/js/ui.js b/octoprint/static/js/ui.js index b521eac0..8986b5d5 100644 --- a/octoprint/static/js/ui.js +++ b/octoprint/static/js/ui.js @@ -1392,9 +1392,9 @@ function SettingsViewModel(loginStateViewModel, usersViewModel) { self.folder_timelapseTmp(response.folder.timelapseTmp); self.folder_logs(response.folder.logs); - self.cura_enabled(response.cura_engine.cura_enabled); - self.cura_path(response.cura_engine.cura_path); - self.cura_config(response.cura_engine.config_path); + self.cura_enabled(response.curaEngine.enabled); + self.cura_path(response.curaEngine.path); + self.cura_config(response.curaEngine.config); self.temperature_profiles(response.temperature.profiles); @@ -1440,10 +1440,10 @@ function SettingsViewModel(loginStateViewModel, usersViewModel) { "system": { "actions": self.system_actions() }, - "cura_engine": { + "curaEngine": { "enabled": self.cura_enabled(), - "cura_path": self.cura_path(), - "cura_config": self.cura_config() + "path": self.cura_path(), + "config": self.cura_config() } } diff --git a/octoprint/templates/settings.jinja2 b/octoprint/templates/settings.jinja2 index a8c8ab34..91ee3f8b 100644 --- a/octoprint/templates/settings.jinja2 +++ b/octoprint/templates/settings.jinja2 @@ -210,15 +210,19 @@