chiark / gitweb /
Turn the preferences window into a dialog, which fixes the window not showing up...
authorDaid <Daid303@gmail.com>
Mon, 22 Apr 2013 12:48:42 +0000 (14:48 +0200)
committerDaid <Daid303@gmail.com>
Mon, 22 Apr 2013 12:48:42 +0000 (14:48 +0200)
Cura/gui/mainWindow.py
Cura/gui/preferencesDialog.py

index 78a49943da16360ff0f2ff5f1a2336bf06672029..1c2aefbaa4083e74b63908f9a022928a25bcb58f 100644 (file)
@@ -272,7 +272,7 @@ class mainWindow(wx.Frame):
        def OnPreferences(self, e):
                prefDialog = preferencesDialog.preferencesDialog(self)
                prefDialog.Centre()
-               prefDialog.Show(True)
+               prefDialog.Show()
 
        def _showOpenDialog(self, title, wildcard = meshLoader.wildcardFilter()):
                dlg=wx.FileDialog(self, title, os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)
index 5744dc0115a0a732bc440f1f7adbcd271856b017..1a8f6144b1fa409ef121b7a4581df06c0a5fe602 100644 (file)
@@ -7,9 +7,9 @@ from Cura.util import validators
 from Cura.util import machineCom
 from Cura.util import profile
 
-class preferencesDialog(wx.Frame):
+class preferencesDialog(wx.Dialog):
        def __init__(self, parent):
-               super(preferencesDialog, self).__init__(None, title="Preferences", style=wx.DEFAULT_DIALOG_STYLE)
+               super(preferencesDialog, self).__init__(None, title="Preferences")
                
                wx.EVT_CLOSE(self, self.OnClose)
                
@@ -72,15 +72,13 @@ class preferencesDialog(wx.Frame):
 
                self.okButton = wx.Button(right, -1, 'Ok')
                right.GetSizer().Add(self.okButton, (right.GetSizer().GetRows(), 0), flag=wx.BOTTOM, border=5)
-               self.okButton.Bind(wx.EVT_BUTTON, self.OnClose)
+               self.okButton.Bind(wx.EVT_BUTTON, lambda e: self.Close())
                
-               self.MakeModal(True)
                main.Fit()
                self.Fit()
 
        def OnClose(self, e):
                if self.oldExtruderAmount != int(profile.getPreference('extruder_amount')):
                        wx.MessageBox('After changing the amount of extruders you need to restart Cura for full effect.', 'Extruder amount warning.', wx.OK | wx.ICON_INFORMATION)
-               self.MakeModal(False)
                self.parent.updateProfileToControls()
                self.Destroy()