[GRASS-SVN] r39166 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 13 03:42:41 EDT 2009


Author: martinl
Date: 2009-09-13 03:42:40 -0400 (Sun, 13 Sep 2009)
New Revision: 39166

Modified:
   grass/trunk/gui/wxpython/gui_modules/gdialogs.py
   grass/trunk/gui/wxpython/gui_modules/georect.py
Log:
wxGUI: use Location/MapsetSelect widget


Modified: grass/trunk/gui/wxpython/gui_modules/gdialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gdialogs.py	2009-09-13 03:29:51 UTC (rev 39165)
+++ grass/trunk/gui/wxpython/gui_modules/gdialogs.py	2009-09-13 07:42:40 UTC (rev 39166)
@@ -109,8 +109,8 @@
                                               size = globalvar.DIALOG_GSELECT_SIZE)
 
         self.element1 = gselect.MapsetSelect(parent = self.panel, id = wx.ID_ANY,
-                                             size = globalvar.DIALOG_GSELECT_SIZE)
-        self.element1.SetItems([])
+                                             size = globalvar.DIALOG_GSELECT_SIZE,
+                                             setItems = False)
         
         self.PostInit()
         

Modified: grass/trunk/gui/wxpython/gui_modules/georect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/georect.py	2009-09-13 03:29:51 UTC (rev 39165)
+++ grass/trunk/gui/wxpython/gui_modules/georect.py	2009-09-13 07:42:40 UTC (rev 39166)
@@ -294,22 +294,8 @@
         
         self.xylocation = ''
         self.xymapset = ''
-
-        tmplist = os.listdir(self.grassdatabase)
-        self.locList = []
-        self.mapsetList = []
         
         #
-        # create a list of valid locations
-        #
-        for item in tmplist:
-            if os.path.isdir(os.path.join(self.grassdatabase, item)) and \
-                    os.path.exists(os.path.join(self.grassdatabase, item, 'PERMANENT')):
-                self.locList.append(item)
-
-        utils.ListSortLower(self.locList)
-        
-        #
         # layout
         #
         self.sizer.AddGrowableCol(2)
@@ -326,9 +312,7 @@
         self.sizer.Add(item=wx.StaticText(parent=self, id=wx.ID_ANY, label=_('Select source location:')),
                        flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
                        pos=(2, 1))
-        self.cb_location = wx.ComboBox(parent=self, id=wx.ID_ANY, 
-                                     choices = self.locList, size=(300, -1),
-                                     style=wx.CB_DROPDOWN | wx.CB_READONLY)
+        self.cb_location = gselect.LocationSelect(parent = self, gisdbase = self.grassdatabase)
         self.sizer.Add(item=self.cb_location,
                        flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
                        pos=(2, 2))
@@ -337,9 +321,8 @@
         self.sizer.Add(item=wx.StaticText(parent=self, id=wx.ID_ANY, label=_('Select source mapset:')),
                        flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
                        pos=(3, 1))
-        self.cb_mapset = wx.ComboBox(parent=self, id=wx.ID_ANY,
-                                     choices = self.mapsetList, size=(300, -1),
-                                     style=wx.CB_DROPDOWN | wx.CB_READONLY)
+        self.cb_mapset = gselect.MapsetSelect(parent = self, gisdbase = self.grassdatabase,
+                                              setItems = False)
         self.sizer.Add(item=self.cb_mapset,
                        flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
                        pos=(3,2))



More information about the grass-commit mailing list