chiark / gitweb /
quickprint: Also allow alteration settings to be overridden by ini files
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Fri, 13 Mar 2015 20:17:33 +0000 (16:17 -0400)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Fri, 13 Mar 2015 20:17:35 +0000 (16:17 -0400)
This allows the start.gcode and end.gcode settings to be overriden
which is crutial for the lulzbot Mini.

Cura/gui/mainWindow.py
Cura/gui/simpleMode.py
Cura/util/profile.py

index fbab3ac25ca6561221dc71b7af06c245857a7388..6a7b541bc1699e29f3c4f28d382752621bc650b9 100644 (file)
@@ -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()
 
index b2e6556a654abb82b6dc33f0f636ef29e20c34a0..4800e4a59b69eb70c2a5bc49dd91201e105dd675 100644 (file)
@@ -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())
 
index 44b4501c42a53e65efc4b5cd43954b1213e01144..ef9d454b5ccbdf4cd9cd8d2eed74bf01c6cd5b7b 100644 (file)
@@ -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():
        """