[GRASS-SVN] r36777 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Apr 18 08:18:18 EDT 2009


Author: martinl
Date: 2009-04-18 08:18:18 -0400 (Sat, 18 Apr 2009)
New Revision: 36777

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py
Log:
Fix wxGUI location wizard: Search in description with 0 hits (trac #554)
    (merge from relbr64, r36775 & r36776)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py	2009-04-18 12:15:16 UTC (rev 36776)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py	2009-04-18 12:18:18 UTC (rev 36777)
@@ -621,7 +621,7 @@
         """
         if str == '':
             self.Populate(self.sourceData)
-            return None
+            return []
 
         data = []
         str = str.lower()
@@ -633,12 +633,13 @@
             except UnicodeDecodeError:
                 # osgeo4w problem (should be fixed)
                 pass
-        self.Populate(data)
         
         if len(data) > 0:
+            self.Populate(data)
             return data[0]
         else:
-            return None
+            self.Populate(self.sourceData)
+            return []
 
 class ProjTypePage(TitledPage):
     """
@@ -1351,10 +1352,11 @@
             if not nextButton.IsEnabled():
                 nextButton.Enable(True)
         else:
+            self.epsgcode = None # not found
             if nextButton.IsEnabled():
                 nextButton.Enable(False)
             self.epsgdesc = self.epsgparams = ''
-
+        
     def OnSearch(self, event):
         value =  self.searchb.GetValue()
         if self.epsglist.GetItemCount() == 0:
@@ -1364,9 +1366,10 @@
         try:
             self.epsgcode = self.epsglist.Search(index=1, str=value)[0]
             self.tcode.SetValue(str(self.epsgcode))
-        except IndexError:
+        except IndexError: # -> no item found
             self.epsgcode = None
             self.tcode.SetValue('')
+            self.searchb.SetValue('')
 
         event.Skip()
         



More information about the grass-commit mailing list