[GRASS-SVN] r68477 - in grass/trunk/gui/wxpython: . dbmgr gmodeler gui_core modules psmap vdigit

svn_grass at osgeo.org svn_grass at osgeo.org
Fri May 20 12:02:54 PDT 2016


Author: annakrat
Date: 2016-05-20 12:02:54 -0700 (Fri, 20 May 2016)
New Revision: 68477

Modified:
   grass/trunk/gui/wxpython/dbmgr/base.py
   grass/trunk/gui/wxpython/gis_set.py
   grass/trunk/gui/wxpython/gmodeler/dialogs.py
   grass/trunk/gui/wxpython/gui_core/preferences.py
   grass/trunk/gui/wxpython/modules/extensions.py
   grass/trunk/gui/wxpython/psmap/dialogs.py
   grass/trunk/gui/wxpython/vdigit/dialogs.py
Log:
wxGUI: don't use sys.maxsize with wx.ListCtrl - breaks GUI on 64bit Windows, see #3011

Modified: grass/trunk/gui/wxpython/dbmgr/base.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/base.py	2016-05-20 14:54:35 UTC (rev 68476)
+++ grass/trunk/gui/wxpython/dbmgr/base.py	2016-05-20 19:02:54 UTC (rev 68477)
@@ -2699,7 +2699,7 @@
         # add item to the list of table columns
         tlist = self.FindWindowById(self.layerPage[self.selLayer]['tableData'])
 
-        index = tlist.InsertStringItem(sys.maxsize, str(name))
+        index = tlist.InsertStringItem(tlist.GetItemCount(), str(name))
         tlist.SetStringItem(index, 0, str(name))
         tlist.SetStringItem(index, 1, str(ctype))
         tlist.SetStringItem(index, 2, str(length))
@@ -2889,7 +2889,7 @@
 
         i = 0
         for column in self.columns:
-            index = self.InsertStringItem(sys.maxsize, str(column))
+            index = self.InsertStringItem(i, str(column))
             self.SetStringItem(index, 0, str(column))
             self.SetStringItem(index, 1, str(self.table[column]['type']))
             self.SetStringItem(index, 2, str(self.table[column]['length']))
@@ -2947,7 +2947,7 @@
 
         i = 0
         for layer in self.layers.keys():
-            index = self.InsertStringItem(sys.maxsize, str(layer))
+            index = self.InsertStringItem(i, str(layer))
             self.SetStringItem(index, 0, str(layer))
             database = str(self.layers[layer]['database'])
             driver = str(self.layers[layer]['driver'])

Modified: grass/trunk/gui/wxpython/gis_set.py
===================================================================
--- grass/trunk/gui/wxpython/gis_set.py	2016-05-20 14:54:35 UTC (rev 68476)
+++ grass/trunk/gui/wxpython/gis_set.py	2016-05-20 19:02:54 UTC (rev 68477)
@@ -1137,8 +1137,9 @@
         :param disabled: list of indices of non-selectable items
         """
         idx = 0
+        count = self.GetItemCount()
         for item in choices:
-            index = self.InsertStringItem(sys.maxsize, item)
+            index = self.InsertStringItem(count + idx, item)
             self.SetStringItem(index, 0, item)
 
             if idx in disabled:

Modified: grass/trunk/gui/wxpython/gmodeler/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/dialogs.py	2016-05-20 14:54:35 UTC (rev 68476)
+++ grass/trunk/gui/wxpython/gmodeler/dialogs.py	2016-05-20 19:02:54 UTC (rev 68477)
@@ -753,7 +753,7 @@
         self.DeleteAllItems()
         i = 0
         for name, vtype, value, desc in self.itemDataMap.itervalues():
-            index = self.InsertStringItem(sys.maxsize, name)
+            index = self.InsertStringItem(i, name)
             self.SetStringItem(index, 0, name)
             self.SetStringItem(index, 1, vtype)
             self.SetStringItem(index, 2, value)
@@ -772,7 +772,7 @@
                 return _("Variable <%s> already exists in the model. "
                          "Adding variable failed.") % name
 
-        index = self.InsertStringItem(sys.maxsize, name)
+        index = self.InsertStringItem(self.GetItemCount(), name)
         self.SetStringItem(index, 0, name)
         self.SetStringItem(index, 1, vtype)
         self.SetStringItem(index, 2, value)
@@ -938,7 +938,7 @@
         i = 0
         if len(self.columns) == 2:
             for name, desc in self.itemDataMap.itervalues():
-                index = self.InsertStringItem(sys.maxsize, str(i))
+                index = self.InsertStringItem(i, str(i))
                 self.SetStringItem(index, 0, name)
                 self.SetStringItem(index, 1, desc)
                 self.SetItemData(index, i)
@@ -947,7 +947,7 @@
                 i += 1
         else:
             for name, inloop, param, desc in self.itemDataMap.itervalues():
-                index = self.InsertStringItem(sys.maxsize, str(i))
+                index = self.InsertStringItem(i, str(i))
                 self.SetStringItem(index, 0, name)
                 self.SetStringItem(index, 1, inloop)
                 self.SetStringItem(index, 2, param)

Modified: grass/trunk/gui/wxpython/gui_core/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/preferences.py	2016-05-20 14:54:35 UTC (rev 68476)
+++ grass/trunk/gui/wxpython/gui_core/preferences.py	2016-05-20 19:02:54 UTC (rev 68477)
@@ -2292,7 +2292,7 @@
             gisenv['LOCATION_NAME'])
 
         for mapset in self.parent.all_mapsets_ordered:
-            index = self.InsertStringItem(sys.maxsize, mapset)
+            index = self.InsertStringItem(self.GetItemCount(), mapset)
             mapsetPath = os.path.join(locationPath,
                                       mapset)
             stat_info = os.stat(mapsetPath)

Modified: grass/trunk/gui/wxpython/modules/extensions.py
===================================================================
--- grass/trunk/gui/wxpython/modules/extensions.py	2016-05-20 14:54:35 UTC (rev 68476)
+++ grass/trunk/gui/wxpython/modules/extensions.py	2016-05-20 19:02:54 UTC (rev 68477)
@@ -533,7 +533,7 @@
                               quiet=True, parent=self, read=True,
                               flags='a').splitlines():
             if ext:
-                self.InsertStringItem(sys.maxsize, ext)
+                self.InsertStringItem(self.GetItemCount(), ext)
 
     def GetExtensions(self):
         """Get extensions to be un-installed

Modified: grass/trunk/gui/wxpython/psmap/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/dialogs.py	2016-05-20 14:54:35 UTC (rev 68476)
+++ grass/trunk/gui/wxpython/psmap/dialogs.py	2016-05-20 19:02:54 UTC (rev 68477)
@@ -3637,7 +3637,7 @@
 
             for vector in vectors:
                 index = self.vectorListCtrl.InsertStringItem(
-                    sys.maxsize, vector[0].split('@')[0])
+                    self.vectorListCtrl.GetItemCount(), vector[0].split('@')[0])
                 self.vectorListCtrl.SetStringItem(index, 1, vector[4])
                 self.vectorListCtrl.SetItemData(index, index)
                 self.vectorListCtrl.CheckItem(index, True)
@@ -4446,7 +4446,7 @@
             self.vectorListCtrl.DeleteAllItems()
             for vector in vectors:
                 index = self.vectorListCtrl.InsertStringItem(
-                    sys.maxsize, vector[0].split('@')[0])
+                    self.vectorListCtrl.GetItemCount(), vector[0].split('@')[0])
                 self.vectorListCtrl.SetStringItem(index, 1, vector[4])
                 self.vectorListCtrl.SetItemData(index, index)
                 self.vectorListCtrl.CheckItem(index, True)

Modified: grass/trunk/gui/wxpython/vdigit/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/dialogs.py	2016-05-20 14:54:35 UTC (rev 68476)
+++ grass/trunk/gui/wxpython/vdigit/dialogs.py	2016-05-20 19:02:54 UTC (rev 68477)
@@ -581,7 +581,7 @@
         for layer in cats.keys():
             catsList = cats[layer]
             for cat in catsList:
-                index = self.InsertStringItem(sys.maxsize, str(catsList[0]))
+                index = self.InsertStringItem(self.GetItemCount(), str(catsList[0]))
                 self.SetStringItem(index, 0, str(layer))
                 self.SetStringItem(index, 1, str(cat))
                 self.SetItemData(index, i)
@@ -801,7 +801,7 @@
         self.InsertColumn(1, _('Layer (Categories)'))
 
         for item in data:
-            index = self.InsertStringItem(sys.maxsize, str(item[0]))
+            index = self.InsertStringItem(self.GetItemCount(), str(item[0]))
             self.SetStringItem(index, 1, str(item[1]))
 
         # enable all items by default



More information about the grass-commit mailing list