[GRASS-SVN] r56692 - grass/branches/develbranch_6/gui/wxpython/gui_core

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


Author: annakrat
Date: 2013-06-13 06:31:03 -0700 (Thu, 13 Jun 2013)
New Revision: 56692

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_core/preferences.py
Log:
wxGUI: fix #2001 (merge from trunk, r56690)

Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/preferences.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/preferences.py	2013-06-13 13:30:36 UTC (rev 56691)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/preferences.py	2013-06-13 13:31:03 UTC (rev 56692)
@@ -1274,31 +1274,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