Merge branch 'master' of github.com:daid/Cura

master
Daid 2012-06-21 15:03:47 +02:00
commit 7a3137e1c7
3 changed files with 18 additions and 1 deletions

View File

@ -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()

View File

@ -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():

View File

@ -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'))