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()
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()
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')
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():
globalProfileParser = ConfigParser.ConfigParser()\r
globalProfileParser.read(filename)\r
\r
+def resetGlobalProfile():\r
+ #Read a configuration file as global config\r
+ global globalProfileParser\r
+ globalProfileParser = ConfigParser.ConfigParser()\r
+\r
def saveGlobalProfile(filename):\r
#Save the current profile to an ini file\r
globalProfileParser.write(open(filename, 'w'))\r