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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 13 06:22:08 PDT 2013


Author: annakrat
Date: 2013-06-13 06:22:07 -0700 (Thu, 13 Jun 2013)
New Revision: 56690

Modified:
   grass/trunk/gui/wxpython/gui_core/preferences.py
Log:
wxGUI: fix #2001

Modified: grass/trunk/gui/wxpython/gui_core/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/preferences.py	2013-06-13 08:10:21 UTC (rev 56689)
+++ grass/trunk/gui/wxpython/gui_core/preferences.py	2013-06-13 13:22:07 UTC (rev 56690)
@@ -1383,31 +1383,29 @@
         path = win.GetValue()
 
         self.epsgCodeDict = ReadEpsgCodes(path)
-        list = self.FindWindowById(self.winId['projection:statusbar:epsg'])
+        epsgCombo = self.FindWindowById(self.winId['projection:statusbar:epsg'])
         if type(self.epsgCodeDict) == type(''):
             wx.MessageBox(parent = self,
                           message = _("Unable to read EPSG codes: %s") % self.epsgCodeDict,
                           caption = _("Error"),  style = wx.OK | wx.ICON_ERROR | wx.CENTRE)
             self.epsgCodeDict = dict()
-            list.SetItems([])
-            list.SetValue('')
+            epsgCombo.SetItems([])
+            epsgCombo.SetValue('')
             self.FindWindowById(self.winId['projection:statusbar:proj4']).SetValue('')
             return
         
         choices = map(str, self.epsgCodeDict.keys())
 
-        list.SetItems(choices)
-        try:
-            code = int(list.GetValue())
-        except ValueError:
-            code = -1
+        epsgCombo.SetItems(choices)
+        code = 4326 # default
         win = self.FindWindowById(self.winId['projection:statusbar:proj4'])
         if code in self.epsgCodeDict:
-            win.SetValue(self.epsgCodeDict[code][1])
+            epsgCombo.SetStringSelection(str(code))
+            win.SetValue(self.epsgCodeDict[code][1].replace('<>', '').strip())
         else:
-            list.SetSelection(0)
-            code = int(list.GetStringSelection())
-            win.SetValue(self.epsgCodeDict[code][1])
+            epsgCombo.SetSelection(0)
+            code = int(epsgCombo.GetStringSelection())
+            win.SetValue(self.epsgCodeDict[code][1].replace('<>', '').strip())
     
     def OnSetEpsgCode(self, event):
         """!EPSG code selected"""



More information about the grass-commit mailing list