mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-05 20:16:09 +08:00
Added reset profile to default option.
This commit is contained in:
parent
d59953be3e
commit
ef0d96a041
@ -50,6 +50,9 @@ class mainWindow(configBase.configWindowBase):
|
|||||||
i = fileMenu.Append(-1, 'Save Profile...')
|
i = fileMenu.Append(-1, 'Save Profile...')
|
||||||
self.Bind(wx.EVT_MENU, self.OnSaveProfile, i)
|
self.Bind(wx.EVT_MENU, self.OnSaveProfile, i)
|
||||||
fileMenu.AppendSeparator()
|
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...')
|
i = fileMenu.Append(-1, 'Preferences...')
|
||||||
self.Bind(wx.EVT_MENU, self.OnPreferences, i)
|
self.Bind(wx.EVT_MENU, self.OnPreferences, i)
|
||||||
fileMenu.AppendSeparator()
|
fileMenu.AppendSeparator()
|
||||||
@ -256,6 +259,14 @@ class mainWindow(configBase.configWindowBase):
|
|||||||
profile.saveGlobalProfile(profileFile)
|
profile.saveGlobalProfile(profileFile)
|
||||||
dlg.Destroy()
|
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):
|
def OnPreferences(self, e):
|
||||||
prefDialog = preferencesDialog.preferencesDialog(self)
|
prefDialog = preferencesDialog.preferencesDialog(self)
|
||||||
prefDialog.Centre()
|
prefDialog.Centre()
|
||||||
|
@ -239,7 +239,7 @@ class simpleModeWindow(configBase.configWindowBase):
|
|||||||
put('bottom_thickness', '0.2')
|
put('bottom_thickness', '0.2')
|
||||||
elif self.printTypeJoris.GetValue():
|
elif self.printTypeJoris.GetValue():
|
||||||
put('wall_thickness', nozzle_size * 1.5)
|
put('wall_thickness', nozzle_size * 1.5)
|
||||||
put('layer_height', '0.2')
|
put('layer_height', '0.3')
|
||||||
put('fill_density', '0')
|
put('fill_density', '0')
|
||||||
put('joris', 'True')
|
put('joris', 'True')
|
||||||
put('extra_base_wall_thickness', '15.0')
|
put('extra_base_wall_thickness', '15.0')
|
||||||
@ -247,6 +247,7 @@ class simpleModeWindow(configBase.configWindowBase):
|
|||||||
put('force_first_layer_sequence', 'False')
|
put('force_first_layer_sequence', 'False')
|
||||||
put('solid_top', 'False')
|
put('solid_top', 'False')
|
||||||
put('support', 'None')
|
put('support', 'None')
|
||||||
|
put('cool_min_layer_time', '3')
|
||||||
|
|
||||||
put('filament_diameter', self.printMaterialDiameter.GetValue())
|
put('filament_diameter', self.printMaterialDiameter.GetValue())
|
||||||
if self.printMaterialPLA.GetValue():
|
if self.printMaterialPLA.GetValue():
|
||||||
|
@ -182,6 +182,11 @@ def loadGlobalProfile(filename):
|
|||||||
globalProfileParser = ConfigParser.ConfigParser()
|
globalProfileParser = ConfigParser.ConfigParser()
|
||||||
globalProfileParser.read(filename)
|
globalProfileParser.read(filename)
|
||||||
|
|
||||||
|
def resetGlobalProfile():
|
||||||
|
#Read a configuration file as global config
|
||||||
|
global globalProfileParser
|
||||||
|
globalProfileParser = ConfigParser.ConfigParser()
|
||||||
|
|
||||||
def saveGlobalProfile(filename):
|
def saveGlobalProfile(filename):
|
||||||
#Save the current profile to an ini file
|
#Save the current profile to an ini file
|
||||||
globalProfileParser.write(open(filename, 'w'))
|
globalProfileParser.write(open(filename, 'w'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user