|
@@ -2111,16 +2111,16 @@ class MapsetAccess(wx.Dialog):
|
|
|
|
|
|
wx.Dialog.__init__(self, parent, id, title, pos, size, style)
|
|
|
|
|
|
- self.all_mapsets = utils.ListOfMapsets(all=True)
|
|
|
- self.accessible_mapsets = utils.ListOfMapsets(all=False)
|
|
|
+ self.all_mapsets_ordered = utils.ListOfMapsets(ordered=True)
|
|
|
+ self.accessible_mapsets = utils.ListOfMapsets(accessible=True)
|
|
|
self.curr_mapset = grass.gisenv()['MAPSET']
|
|
|
|
|
|
# make a checklistbox from available mapsets and check those that are active
|
|
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
|
|
|
|
|
label = wx.StaticText(parent=self, id=wx.ID_ANY,
|
|
|
- label=_("Check mapset to make it accessible, uncheck it to hide it.%s"
|
|
|
- "Note: PERMANENT and current mapset are always accessible.") % os.linesep)
|
|
|
+ label=_("Check a mapset to make it accessible, uncheck it to hide it.%s"
|
|
|
+ "Note: The current mapset is always accessible.") % os.linesep)
|
|
|
sizer.Add(item=label, proportion=0,
|
|
|
flag=wx.ALL, border=5)
|
|
|
|
|
@@ -2132,7 +2132,7 @@ class MapsetAccess(wx.Dialog):
|
|
|
|
|
|
# check all accessible mapsets
|
|
|
for mset in self.accessible_mapsets:
|
|
|
- self.mapsetlb.CheckItem(self.all_mapsets.index(mset), True)
|
|
|
+ self.mapsetlb.CheckItem(self.all_mapsets_ordered.index(mset), True)
|
|
|
|
|
|
# dialog buttons
|
|
|
line = wx.StaticLine(parent=self, id=wx.ID_ANY,
|
|
@@ -2163,7 +2163,7 @@ class MapsetAccess(wx.Dialog):
|
|
|
"""!Get list of checked mapsets"""
|
|
|
ms = []
|
|
|
i = 0
|
|
|
- for mset in self.all_mapsets:
|
|
|
+ for mset in self.all_mapsets_ordered:
|
|
|
if self.mapsetlb.IsChecked(i):
|
|
|
ms.append(mset)
|
|
|
i += 1
|
|
@@ -2192,17 +2192,7 @@ class CheckListMapset(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Check
|
|
|
gisenv = grass.gisenv()
|
|
|
locationPath = os.path.join(gisenv['GISDBASE'], gisenv['LOCATION_NAME'])
|
|
|
|
|
|
- ret = gcmd.RunCommand('g.mapsets',
|
|
|
- parent = self,
|
|
|
- flags = 'l',
|
|
|
- fs = '|',
|
|
|
- read = True)
|
|
|
-
|
|
|
- mapsets = []
|
|
|
- if ret:
|
|
|
- mapsets = ret.replace('\n', '').split('|')
|
|
|
-
|
|
|
- for mapset in mapsets:
|
|
|
+ for mapset in self.parent.all_mapsets_ordered:
|
|
|
index = self.InsertStringItem(sys.maxint, mapset)
|
|
|
mapsetPath = os.path.join(locationPath,
|
|
|
mapset)
|
|
@@ -2221,6 +2211,6 @@ class CheckListMapset(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Check
|
|
|
|
|
|
def OnCheckItem(self, index, flag):
|
|
|
"""!Mapset checked/unchecked"""
|
|
|
- mapset = self.parent.all_mapsets[index]
|
|
|
- if mapset == 'PERMANENT' or mapset == self.parent.curr_mapset:
|
|
|
+ mapset = self.parent.all_mapsets_ordered[index]
|
|
|
+ if mapset == self.parent.curr_mapset:
|
|
|
self.CheckItem(index, True)
|