From: daid303 Date: Mon, 21 Jan 2013 11:53:43 +0000 (+0100) Subject: Properly handle the unfilled window positions. X-Git-Tag: 13.03~91 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=699e19af90ce60567319a76c17e3ac9d9c352410;p=cura.git Properly handle the unfilled window positions. --- diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index 68aea1b4..f83e47c6 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -219,19 +219,18 @@ class mainWindow(wx.Frame): self.Centre() # Restore the window position, size & state from the preferences file - try: - if profile.getPreference('window_maximized') == 'True': - self.Maximize(True) - else: - posx = int(profile.getPreference('window_pos_x')) - posy = int(profile.getPreference('window_pos_y')) - width = int(profile.getPreference('window_width')) - height = int(profile.getPreference('window_height')) + if profile.getPreference('window_maximized') == 'True': + self.Maximize(True) + else: + posx = int(profile.getPreference('window_pos_x')) + posy = int(profile.getPreference('window_pos_y')) + width = int(profile.getPreference('window_width')) + height = int(profile.getPreference('window_height')) + if posx > 0 or posy > 0: self.SetPosition((posx,posy)) + if width > 0 and height > 0: self.SetSize((width,height)) - except: - pass - + self.Show(True) def updateSliceMode(self): diff --git a/Cura/util/profile.py b/Cura/util/profile.py index 662ff317..bfd0c0d6 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -181,6 +181,12 @@ preferencesDefaultSettings = { 'model_colour2': '#CB3030', 'model_colour3': '#DDD93C', 'model_colour4': '#4550D3', + + 'window_maximized': 'False', + 'window_pos_x': '-1', + 'window_pos_y': '-1', + 'window_width': '-1', + 'window_height': '-1', } #########################################################