From 6dfb302efcca843d7c9f17cdb94130e6fcb0888f Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Fri, 6 Mar 2015 13:24:58 -0500 Subject: [PATCH] quickprint: Change simple mode profile/material preference setting into a profile setting 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 | 8 ++++---- Cura/util/profile.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cura/gui/simpleMode.py b/Cura/gui/simpleMode.py index 903f0af8..b2e6556a 100644 --- a/Cura/gui/simpleMode.py +++ b/Cura/gui/simpleMode.py @@ -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): diff --git a/Cura/util/profile.py b/Cura/util/profile.py index b1ba0d61..44b4501c 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -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.")) -- 2.30.2