From: Youness Alaoui Date: Fri, 13 Mar 2015 20:17:33 +0000 (-0400) Subject: quickprint: Also allow alteration settings to be overridden by ini files X-Git-Tag: lulzbot-15.02.1-1.01~36 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=d6d4520946840fccc3fa9086a9a27fcd709e0007;p=cura.git quickprint: Also allow alteration settings to be overridden by ini files This allows the start.gcode and end.gcode settings to be overriden which is crutial for the lulzbot Mini. --- diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index fbab3ac2..6a7b541b 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -567,7 +567,10 @@ class mainWindow(wx.Frame): if result: profile.resetProfile() for k, v in self.simpleSettingsPanel.getSettingOverrides().items(): - profile.putProfileSetting(k, v) + if profile.isProfileSetting(k): + profile.putProfileSetting(k, v) + elif profile.isAlterationSetting(k): + profile.setAlterationFile(k, v) self.updateProfileToAllControls() self.updateSliceMode() diff --git a/Cura/gui/simpleMode.py b/Cura/gui/simpleMode.py index b2e6556a..4800e4a5 100644 --- a/Cura/gui/simpleMode.py +++ b/Cura/gui/simpleMode.py @@ -143,7 +143,7 @@ class simpleModePanel(wx.Panel): cp = configparser.ConfigParser() cp.read(button.filename) for setting in profile.settingsList: - if setting.isProfile(): + if setting.isProfile() or setting.isAlteration(): if cp.has_option('profile', setting.getName()): settings[setting.getName()] = cp.get('profile', setting.getName()) if profile.getMachineSetting('gcode_flavor') != 'UltiGCode': @@ -152,7 +152,7 @@ class simpleModePanel(wx.Panel): cp = configparser.ConfigParser() cp.read(button.filename) for setting in profile.settingsList: - if setting.isProfile(): + if setting.isProfile() or setting.isAlteration(): if cp.has_option('profile', setting.getName()): settings[setting.getName()] = cp.get('profile', setting.getName()) @@ -161,7 +161,7 @@ class simpleModePanel(wx.Panel): cp = configparser.ConfigParser() cp.read(button.filename) for setting in profile.settingsList: - if setting.isProfile(): + if setting.isProfile() or setting.isAlteration(): if cp.has_option('profile', setting.getName()): settings[setting.getName()] = cp.get('profile', setting.getName()) diff --git a/Cura/util/profile.py b/Cura/util/profile.py index 44b4501c..ef9d454b 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -919,6 +919,13 @@ def isProfileSetting(name): return True return False +def isAlterationSetting(name): + """ Check if a certain key name is actually a profile value. """ + global settingsDictionary + if name in settingsDictionary and settingsDictionary[name].isAlteration(): + return True + return False + ## Preferences functions def getPreferencePath(): """