[GRASS-SVN] r73233 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Sep 3 12:31:04 PDT 2018


Author: annakrat
Date: 2018-09-03 12:31:04 -0700 (Mon, 03 Sep 2018)
New Revision: 73233

Modified:
   grass/trunk/gui/wxpython/gui_core/preferences.py
Log:
wxGUI: missing checkboxes in g.mapsets dialog with wx4, see #3629

Modified: grass/trunk/gui/wxpython/gui_core/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/preferences.py	2018-09-03 14:45:58 UTC (rev 73232)
+++ grass/trunk/gui/wxpython/gui_core/preferences.py	2018-09-03 19:31:04 UTC (rev 73233)
@@ -47,11 +47,12 @@
 from core.gcmd import RunCommand, GError
 from core.utils import ListOfMapsets, GetColorTables, ReadEpsgCodes, _
 from core.settings import UserSettings
+from core.globalvar import wxPythonPhoenix
 from gui_core.dialogs import SymbolDialog, DefaultFontDialog
 from gui_core.widgets import IntegerValidator, ColorTablesComboBox
 from core.debug import Debug
 from gui_core.wrap import SpinCtrl, Button, BitmapButton, StaticText, \
-    StaticBox, TextCtrl
+    StaticBox, TextCtrl, ListCtrl
 
 
 class PreferencesBaseDialog(wx.Dialog):
@@ -2177,14 +2178,14 @@
 
 
 class CheckListMapset(
-        wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.CheckListCtrlMixin):
+        ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.CheckListCtrlMixin):
     """List of mapset/owner/group"""
 
     def __init__(self, parent, log=None):
         self.parent = parent
 
-        wx.ListCtrl.__init__(self, parent, wx.ID_ANY,
-                             style=wx.LC_REPORT)
+        ListCtrl.__init__(self, parent, wx.ID_ANY,
+                          style=wx.LC_REPORT)
         listmix.CheckListCtrlMixin.__init__(self)
         self.log = log
 
@@ -2202,7 +2203,12 @@
             gisenv['LOCATION_NAME'])
 
         for mapset in self.parent.all_mapsets_ordered:
-            index = self.InsertStringItem(self.GetItemCount(), mapset)
+            # unclear why this is needed,
+            # wrap.ListrCtrl should do the job but it doesn't in this case
+            if wxPythonPhoenix:
+                index = self.InsertItem(self.GetItemCount(), mapset)
+            else:
+                index = self.InsertStringItem(self.GetItemCount(), mapset)
             mapsetPath = os.path.join(locationPath,
                                       mapset)
             stat_info = os.stat(mapsetPath)



More information about the grass-commit mailing list