Prechádzať zdrojové kódy

wxGUI: missing checkboxes in g.mapsets dialog with wx4, see https://trac.osgeo.org/grass/ticket/3629

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73233 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 6 rokov pred
rodič
commit
823412867a
1 zmenil súbory, kde vykonal 11 pridanie a 5 odobranie
  1. 11 5
      gui/wxpython/gui_core/preferences.py

+ 11 - 5
gui/wxpython/gui_core/preferences.py

@@ -47,11 +47,12 @@ from core import globalvar
 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 MapsetAccess(wx.Dialog):
 
 
 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 @@ class CheckListMapset(
             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)