Blob Blame History Raw
Description: Update for wxPython 3.0
 These changes should remain compatible with wxPython 2.8.
 .
 SetMaxLength() is not valid on multi-line text controls under wxGTK, but
 the default should be to not limit the length anyway (aside from any limits
 the underlying platform imposes, which you can't get around anyway).
Bug-Debian: https://bugs.debian.org/759055
Forwarded: no
Last-Update: 2014-09-07

Index: openstv-1.6.1/openstv/BFE.py
===================================================================
--- openstv-1.6.1.orig/openstv/BFE.py
+++ openstv-1.6.1/openstv/BFE.py
@@ -58,7 +58,7 @@ class BFEFrame(wx.Frame):
     # Edit an existing ballot file
     elif mode == "old":
       dlg = wx.FileDialog(self, "Edit Ballot File",
-                          style=wx.OPEN|wx.CHANGE_DIR)
+                          style=wx.FD_OPEN|wx.FD_CHANGE_DIR)
       if dlg.ShowModal() != wx.ID_OK:
         dlg.Destroy()
         self.Destroy()
@@ -96,7 +96,6 @@ class BFEFrame(wx.Frame):
     self.log = wx.TextCtrl(nb, -1,
                            style=wx.TE_MULTILINE|wx.TE_READONLY|\
                            wx.TE_WORDWRAP|wx.FIXED)
-    self.log.SetMaxLength(0)
     nb.AddPage(self.log, "Log")
 
     # Initialize
@@ -158,7 +157,7 @@ class BFEFrame(wx.Frame):
 
     # Get the filename of the ballots to be appended
     dlg = wx.FileDialog(self, "Select Ballot File",
-                        style=wx.OPEN|wx.CHANGE_DIR)
+                        style=wx.FD_OPEN|wx.FD_CHANGE_DIR)
     if dlg.ShowModal() != wx.ID_OK:
       dlg.Destroy()
       return
@@ -197,7 +196,7 @@ class BFEFrame(wx.Frame):
 
     # Ask the user to choose the filename.
     dlg = wx.FileDialog(self, "Save Ballot File",
-                        style=wx.SAVE|wx.OVERWRITE_PROMPT|wx.CHANGE_DIR)
+                        style=wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT|wx.FD_CHANGE_DIR)
     if dlg.ShowModal() != wx.ID_OK:
       dlg.Destroy()
       return
@@ -233,7 +232,7 @@ class BFEFrame(wx.Frame):
 
   def OnSaveLogAs(self, event):
     dlg = wx.FileDialog(self, "Save Log to a File",
-                        style=wx.SAVE|wx.OVERWRITE_PROMPT|wx.CHANGE_DIR)
+                        style=wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT|wx.FD_CHANGE_DIR)
     if dlg.ShowModal() != wx.ID_OK:
       dlg.Destroy()
       return
Index: openstv-1.6.1/openstv/OpenSTV.py
===================================================================
--- openstv-1.6.1.orig/openstv/OpenSTV.py
+++ openstv-1.6.1/openstv/OpenSTV.py
@@ -181,7 +181,6 @@ class Frame(wx.Frame):
     self.console = wx.TextCtrl(self.notebook, -1,
                                style=wx.TE_MULTILINE|wx.TE_READONLY|\
                                wx.TE_WORDWRAP|wx.FIXED|wx.TE_RICH2)
-    self.console.SetMaxLength(0)
     ps = self.console.GetFont().GetPointSize()
     font = wx.Font(ps, wx.MODERN, wx.NORMAL, wx.NORMAL)
     self.console.SetFont(font)
@@ -383,7 +382,6 @@ to www.OpenSTV.org, or send an email to
     # create a new notebook page
     tc = wx.TextCtrl(self.notebook, -1,
                      style=wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.FIXED)
-    tc.SetMaxLength(0)
     ps = tc.GetFont().GetPointSize()
     font = wx.Font(ps, wx.MODERN, wx.NORMAL, wx.NORMAL)
     tc.SetFont(font)
@@ -436,7 +434,7 @@ to www.OpenSTV.org, or send an email to
       return
 
     dlg = wx.FileDialog(self, "Save Results in CSV Format",
-                        style=wx.SAVE|wx.OVERWRITE_PROMPT|wx.CHANGE_DIR)
+                        style=wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT|wx.FD_CHANGE_DIR)
     if dlg.ShowModal() != wx.ID_OK:
       dlg.Destroy()
       return
@@ -456,7 +454,7 @@ to www.OpenSTV.org, or send an email to
       return
 
     dlg = wx.FileDialog(self, "Save Results in Text Format",
-                        style=wx.SAVE|wx.OVERWRITE_PROMPT|wx.CHANGE_DIR)
+                        style=wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT|wx.FD_CHANGE_DIR)
     if dlg.ShowModal() != wx.ID_OK:
       dlg.Destroy()
       return
@@ -480,7 +478,7 @@ to www.OpenSTV.org, or send an email to
       return
 
     dlg = wx.FileDialog(self, "Save Results in HTML Format",
-                        style=wx.SAVE|wx.OVERWRITE_PROMPT|wx.CHANGE_DIR)
+                        style=wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT|wx.FD_CHANGE_DIR)
     if dlg.ShowModal() != wx.ID_OK:
       dlg.Destroy()
       return
@@ -636,7 +634,7 @@ See the Help menu for more information a
 
   def OnFilenameSelect(self, event):
     dlg = wx.FileDialog(self, "Select Input File", "",
-                        style=wx.OPEN|wx.CHANGE_DIR)
+                        style=wx.FD_OPEN|wx.FD_CHANGE_DIR)
     if dlg.ShowModal() != wx.ID_OK:
       dlg.Destroy()
       return
@@ -880,7 +878,6 @@ class HTMLFrame(wx.Frame):
 class App(wx.App):
 
   def OnInit(self):
-    wx.InitAllImageHandlers()
 
     # Show a splash screen
     png = os.path.join(getHome(), "Icons", "splash.png")