chiark / gitweb /
Added reset profile to default option.
authorDaid <daid303@gmail.com>
Wed, 20 Jun 2012 07:06:29 +0000 (09:06 +0200)
committerDaid <daid303@gmail.com>
Wed, 20 Jun 2012 07:06:29 +0000 (09:06 +0200)
Cura/gui/mainWindow.py
Cura/gui/simpleMode.py
Cura/util/profile.py

index affdfa38507176b2a21ee283bbf332f8b1f687b6..34b8426214b0e9d8d2d66a3a271c26bba31b07aa 100644 (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()
index 0d9e95a7bc12097638b8b8611f212e18ec8f0188..f3730ddc462e1a481519f5f369297c1aa964c9a3 100644 (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():
index 9304706267dcd9d7566fc51c1e063d6a380f0cff..fdc7135ae5729bd0c384e63ffa9e13c52056c379 100644 (file)
@@ -182,6 +182,11 @@ def loadGlobalProfile(filename):
        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