chiark / gitweb /
quickprint: Change simple mode profile/material preference setting into a profile...
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Fri, 6 Mar 2015 18:24:58 +0000 (13:24 -0500)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Fri, 6 Mar 2015 18:25:58 +0000 (13:25 -0500)
This allows us to keep track of the profile/material selection for
each machine, which should help users with multiple machines using
different materials for example.
It also avoid issues with machines that has a per-machine configuration
which uses different ini filenames from other machines (invalid selection).

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

index 903f0af8f59668dc1a722221561601caba1c67f2..b2e6556a654abb82b6dc33f0f636ef29e20c34a0 100644 (file)
@@ -38,7 +38,7 @@ class simpleModePanel(wx.Panel):
                        button.base_filename = base_filename
                        button.filename = filename
                        self._print_profile_options.append(button)
-                       if profile.getPreference('simpleModeProfile') == base_filename:
+                       if profile.getProfileSetting('simpleModeProfile') == base_filename:
                                button.SetValue(True)
 
                printMaterialPanel = wx.Panel(self)
@@ -53,7 +53,7 @@ class simpleModePanel(wx.Panel):
                        button.base_filename = base_filename
                        button.filename = filename
                        self._print_material_options.append(button)
-                       if profile.getPreference('simpleModeMaterial') == base_filename:
+                       if profile.getProfileSetting('simpleModeMaterial') == base_filename:
                                button.SetValue(True)
 
                if profile.getMachineSetting('gcode_flavor') == 'UltiGCode':
@@ -106,10 +106,10 @@ class simpleModePanel(wx.Panel):
        def _update(self, e):
                for button in self._print_profile_options:
                        if button.GetValue():
-                               profile.putPreference('simpleModeProfile', button.base_filename)
+                               profile.putProfileSetting('simpleModeProfile', button.base_filename)
                for button in self._print_material_options:
                        if button.GetValue():
-                               profile.putPreference('simpleModeMaterial', button.base_filename)
+                               profile.putProfileSetting('simpleModeMaterial', button.base_filename)
                self._callback()
 
        def getSettingOverrides(self):
index b1ba0d6138649a5da9ce54483f27b5824bd2c758..44b4501c42a53e65efc4b5cd43954b1213e01144 100644 (file)
@@ -481,8 +481,8 @@ setting('postSwitchExtruder.gcode', """;Switch between the current extruder and
 """, str, 'alteration', 'alteration')
 
 setting('startMode', 'Simple', ['Simple', 'Normal'], 'preference', 'hidden')
-setting('simpleModeProfile', '2_normal', str, 'preference', 'hidden')
-setting('simpleModeMaterial', '1_pla', str, 'preference', 'hidden')
+setting('simpleModeProfile', '2_normal', str, 'hidden', 'hidden')
+setting('simpleModeMaterial', '1_pla', str, 'hidden', 'hidden')
 setting('oneAtATime', 'True', bool, 'preference', 'hidden')
 setting('lastFile', os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'resources', 'example', 'Rocktopus.stl')), str, 'preference', 'hidden')
 setting('save_profile', 'False', bool, 'preference', 'hidden').setLabel(_("Save profile on slice"), _("When slicing save the profile as [stl_file]_profile.ini next to the model."))