From: Youness Alaoui Date: Thu, 29 Jan 2015 17:42:35 +0000 (-0500) Subject: Save the quickprint settings in the profile X-Git-Tag: lulzbot-15.02.1-1.01~74 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=d42fee6c7ef6285e234d086a7de438d07a46b123;p=cura.git Save the quickprint settings in the profile This helps avoid frustration if you want to keep your settings the same (especially material choice). Fixes issue #69 --- diff --git a/Cura/gui/simpleMode.py b/Cura/gui/simpleMode.py index 7e529082..0343c81e 100644 --- a/Cura/gui/simpleMode.py +++ b/Cura/gui/simpleMode.py @@ -3,6 +3,7 @@ __copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AG import wx from Cura.util import profile +import cPickle as pickle class simpleModePanel(wx.Panel): "Main user interface window for Quickprint mode" @@ -83,7 +84,34 @@ class simpleModePanel(wx.Panel): self.printSupport.Bind(wx.EVT_CHECKBOX, lambda e: self._callback()) self.printBrim.Bind(wx.EVT_CHECKBOX, lambda e: self._callback()) + self.loadSettings() + + def getSavedSettings(self): + try: + return pickle.loads(str(profile.getProfileSetting('simpleModeSettings'))) + except: + return {} + + def loadSettings(self): + settings = self.getSavedSettings() + for item in settings.keys(): + if getattr(self, item, None): + getattr(self, item).SetValue(settings[item]) + + def saveSettings(self): + settings = {} + settingItems = ['printTypeHigh', 'printTypeNormal', 'printTypeLow', 'printTypeJoris', + 'printMaterialHIPS', 'printMaterialABS', 'printMaterialPLA', + 'printSupport', 'printBrim'] + + for item in settingItems: + if getattr(self, item, None): + settings[item] = getattr(self, item).GetValue() + + profile.putProfileSetting('simpleModeSettings', pickle.dumps(settings)) + def setupSlice(self): + self.saveSettings() put = profile.setTempOverride get = profile.getProfileSetting for setting in profile.settingsList: diff --git a/Cura/util/profile.py b/Cura/util/profile.py index 437a5875..2cc65c4d 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -258,6 +258,8 @@ setting('plugin_config', '', str, 'hidden', 'hidden') setting('object_center_x', -1, float, 'hidden', 'hidden') setting('object_center_y', -1, float, 'hidden', 'hidden') +setting('simpleModeSettings', '', str, 'hidden', 'hidden') + setting('start.gcode', """;Sliced at: {day} {date} {time} ;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density} ;Print time: {print_time}