chiark / gitweb /
Fixed windows tooltip bug
authorDaid <daid303@gmail.com>
Fri, 9 Mar 2012 14:47:39 +0000 (15:47 +0100)
committerDaid <daid303@gmail.com>
Fri, 9 Mar 2012 14:47:39 +0000 (15:47 +0100)
Fixed SerialExeception import bug
Possibly fixed MacOS layout bug`

SkeinPyPy_NewUI/avr_isp/stk500v2.py
SkeinPyPy_NewUI/newui/configBase.py
SkeinPyPy_NewUI/newui/configWizard.py
SkeinPyPy_NewUI/newui/mainWindow.py

index 97cf8a317ae453e1e38b9d3dc3a12191378ea0ad..a420bdcdac2c9e82dd22c9b08481265d90f26743 100644 (file)
@@ -1,6 +1,7 @@
 import os, struct, sys, time\r
 \r
 from serial import Serial\r
+from serial import SerialException\r
 \r
 import ispBase, intelHex\r
 \r
@@ -15,7 +16,7 @@ class Stk500v2(ispBase.IspBase):
                        self.close()\r
                try:\r
                        self.serial = Serial(port, speed, timeout=1)\r
-               except Serial.SerialException as e:\r
+               except SerialException as e:\r
                        raise ispBase.IspError("Failed to open serial port")\r
                self.seq = 1\r
                \r
index 39a914c0f8f5c831e8568fc29e9b517715b125dd..10e3442443ccda09e91b2a150ba96a0b43c78256 100644 (file)
@@ -50,16 +50,8 @@ class configWindowBase(wx.Frame):
                return leftConfigPanel, rightConfigPanel, configPanel
        
        def OnPopupDisplay(self, setting):
-               x, y = setting.ctrl.ClientToScreenXY(0, 0)
-               sx, sy = setting.ctrl.GetSizeTuple()
-               #if platform.system() == "Windows":
-               #       for some reason, under windows, the popup is relative to the main window... in some cases. (Wierd ass bug)
-               #       wx, wy = self.ClientToScreenXY(0, 0)
-               #       x -= wx
-               #       y -= wy
                self.popup.setting = setting
                self.UpdatePopup(setting)
-               self.popup.SetPosition((x, y+sy))
                self.popup.Show(True)
                
        def OnPopupHide(self, e):
@@ -73,6 +65,14 @@ class configWindowBase(wx.Frame):
                                self.popup.text.SetLabel(setting.helpText)
                        self.popup.text.Wrap(350)
                        self.popup.Fit()
+                       x, y = setting.ctrl.ClientToScreenXY(0, 0)
+                       sx, sy = setting.ctrl.GetSizeTuple()
+                       #if platform.system() == "Windows":
+                       #       for some reason, under windows, the popup is relative to the main window... in some cases. (Wierd ass bug)
+                       #       wx, wy = self.ClientToScreenXY(0, 0)
+                       #       x -= wx
+                       #       y -= wy
+                       self.popup.SetPosition((x, y+sy))
        
        def updateProfileToControls(self):
                "Update the configuration wx controls to show the new configuration settings"
@@ -88,8 +88,8 @@ class TitleRow():
                sizer = panel.GetSizer()
                self.title = wx.StaticText(panel, -1, name)
                self.title.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.FONTWEIGHT_BOLD))
-               sizer.Add(self.title, (sizer.GetRows(),sizer.GetCols()), (1,3), flag=wx.EXPAND)
-               sizer.Add(wx.StaticLine(panel), (sizer.GetRows()+1,sizer.GetCols()), (1,3), flag=wx.EXPAND)
+               sizer.Add(self.title, (sizer.GetRows(),0), (1,3), flag=wx.EXPAND)
+               sizer.Add(wx.StaticLine(panel), (sizer.GetRows()+1,0), (1,3), flag=wx.EXPAND)
                sizer.SetRows(sizer.GetRows() + 2)
 
 class SettingRow():
@@ -97,7 +97,7 @@ class SettingRow():
                "Add a setting to the configuration panel"
                sizer = panel.GetSizer()
                x = sizer.GetRows()
-               y = sizer.GetCols()
+               y = 0
                
                self.validators = []
                self.validationMsg = ''
@@ -169,6 +169,7 @@ class SettingRow():
                        self.ctrl.SetValue(value)
 
 #Settings notify works as a validator, but instead of validating anything, it calls another function, which can use the value.
+# A bit hacky, bit it works.
 class settingNotify():
        def __init__(self, setting, func):
                self.setting = setting
@@ -183,4 +184,3 @@ class settingNotify():
                except ValueError:
                        self.func()
                        return validators.SUCCESS, ''
-
index 1ca0ca0692e1fc4fe22a71eef2366af77e0d41a5..ad7853a17be77d31961cf15d9a3b318271857344 100644 (file)
@@ -110,9 +110,9 @@ class FirmwareUpgradePage(InfoPage):
                self.AddText('The firmware shipping with new Ultimakers works, but upgrades\nhave been made to make better prints, and make calibration easier.')\r
                self.AddHiddenSeperator()\r
                self.AddText('SkeinPyPy requires these new features and thus\nyour firmware will most likely need to be upgraded.\nYou will get the chance to do so now.')\r
-               b1, b2 = self.AddDualButton('Upgrade firmware', 'Skip upgrade')\r
-               b1.Bind(wx.EVT_BUTTON, self.OnUpgradeClick)\r
-               b2.Bind(wx.EVT_BUTTON, self.OnSkipClick)\r
+               upgradeButton, skipUpgradeButton = self.AddDualButton('Upgrade to Marlin firmware', 'Skip upgrade')\r
+               upgradeButton.Bind(wx.EVT_BUTTON, self.OnUpgradeClick)\r
+               skipUpgradeButton.Bind(wx.EVT_BUTTON, self.OnSkipClick)\r
                self.AddHiddenSeperator()\r
                self.AddText('Do not upgrade to this firmware if:')\r
                self.AddText('* You have an older machine based on ATMega1280')\r
index b6fb9a3f9df17cc45c9ef2d5209d011c7bfa3496..2a0dd310f98476657161edf517e9576e5ca62f3b 100644 (file)
@@ -117,9 +117,6 @@ class mainWindow(configBase.configWindowBase):
                c = configBase.SettingRow(left, "Machine center Y (mm)", 'machine_center_y', '100', 'The center of your machine, your print will be placed at this location')
                validators.validInt(c, 10)
                configBase.settingNotify(c, self.preview3d.updateCenterY)
-               #self.AddSetting(left, "Width (mm)", settings.IntSpin().getFromValue(10, "machine_width", None, 1000, 205))
-               #self.AddSetting(left, "Depth (mm)", settings.IntSpin().getFromValue(10, "machine_depth", None, 1000, 205))
-               #self.AddSetting(left, "Height (mm)", settings.IntSpin().getFromValue(10, "machine_height", None, 1000, 200))
 
                configBase.TitleRow(left, "Machine nozzle")
                c = configBase.SettingRow(left, "Nozzle size (mm)", 'nozzle_size', '0.4', 'The nozzle size is very important, this is used to calculate the line width of the infill, and used to calculate the amount of outside wall lines and thickness for the wall thickness you entered in the print settings.')
@@ -147,7 +144,6 @@ class mainWindow(configBase.configWindowBase):
                validators.validFloat(c, 0.0)
 
                configBase.TitleRow(right, "Cool")
-               #c = SettingRow(right, "Cool type", self.plugins['cool'].preferencesDict['Cool_Type'])
                c = configBase.SettingRow(right, "Minimal layer time (sec)", 'cool_min_layer_time', '10', 'Minimum time spend in a layer, gives the layer time to cool down before the next layer is put on top. If the layer will be placed down too fast the printer will slow down to make sure it has spend atleast this amount of seconds printing this layer.')
                validators.validFloat(c, 0.0)
 
@@ -183,7 +179,7 @@ class mainWindow(configBase.configWindowBase):
                sizer.Add(self.preview3d, (0,1), span=(1,3), flag=wx.EXPAND)
                sizer.AddGrowableCol(2)
                sizer.AddGrowableRow(0)
-               sizer.Add(loadButton, (1,1))
+               sizer.Add(loadButton, (1,1), flag=wx.RIGHT, border=5)
                sizer.Add(sliceButton, (1,2))
                self.sizer = sizer