From: Daid Date: Wed, 20 Jun 2012 07:06:29 +0000 (+0200) Subject: Added reset profile to default option. X-Git-Tag: 12.07~38 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ef0d96a0419a35c0f61763b9b43cd5874f614df2;p=cura.git Added reset profile to default option. --- diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index affdfa38..34b84262 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -50,6 +50,9 @@ class mainWindow(configBase.configWindowBase): i = fileMenu.Append(-1, 'Save Profile...') self.Bind(wx.EVT_MENU, self.OnSaveProfile, i) fileMenu.AppendSeparator() + i = fileMenu.Append(-1, 'Reset Profile to default') + self.Bind(wx.EVT_MENU, self.OnResetProfile, i) + fileMenu.AppendSeparator() i = fileMenu.Append(-1, 'Preferences...') self.Bind(wx.EVT_MENU, self.OnPreferences, i) fileMenu.AppendSeparator() @@ -256,6 +259,14 @@ class mainWindow(configBase.configWindowBase): profile.saveGlobalProfile(profileFile) dlg.Destroy() + def OnResetProfile(self, e): + dlg = wx.MessageDialog(self, 'This will reset all profile settings to defaults.\nUnless you have saved your current profile, all settings will be lost!\nDo you really want to reset?', 'Profile reset', wx.YES_NO | wx.ICON_QUESTION) + result = dlg.ShowModal() == wx.ID_YES + dlg.Destroy() + if result: + profile.resetGlobalProfile() + self.updateProfileToControls() + def OnPreferences(self, e): prefDialog = preferencesDialog.preferencesDialog(self) prefDialog.Centre() diff --git a/Cura/gui/simpleMode.py b/Cura/gui/simpleMode.py index 0d9e95a7..f3730ddc 100644 --- a/Cura/gui/simpleMode.py +++ b/Cura/gui/simpleMode.py @@ -239,7 +239,7 @@ class simpleModeWindow(configBase.configWindowBase): put('bottom_thickness', '0.2') elif self.printTypeJoris.GetValue(): put('wall_thickness', nozzle_size * 1.5) - put('layer_height', '0.2') + put('layer_height', '0.3') put('fill_density', '0') put('joris', 'True') put('extra_base_wall_thickness', '15.0') @@ -247,6 +247,7 @@ class simpleModeWindow(configBase.configWindowBase): put('force_first_layer_sequence', 'False') put('solid_top', 'False') put('support', 'None') + put('cool_min_layer_time', '3') put('filament_diameter', self.printMaterialDiameter.GetValue()) if self.printMaterialPLA.GetValue(): diff --git a/Cura/util/profile.py b/Cura/util/profile.py index 93047062..fdc7135a 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -182,6 +182,11 @@ def loadGlobalProfile(filename): globalProfileParser = ConfigParser.ConfigParser() globalProfileParser.read(filename) +def resetGlobalProfile(): + #Read a configuration file as global config + global globalProfileParser + globalProfileParser = ConfigParser.ConfigParser() + def saveGlobalProfile(filename): #Save the current profile to an ini file globalProfileParser.write(open(filename, 'w'))