[GRASS-dev] Re: [GRASS GIS] #987: Location wizard choose from EPSG robustness issues

GRASS GIS trac at osgeo.org
Sun Mar 7 12:37:36 EST 2010


#987: Location wizard choose from EPSG robustness issues
---------------------+------------------------------------------------------
  Reporter:  marisn  |       Owner:  martinl            
      Type:  defect  |      Status:  assigned           
  Priority:  normal  |   Milestone:  6.4.0              
 Component:  wxGUI   |     Version:  svn-releasebranch64
Resolution:          |    Keywords:  location wizard    
  Platform:  Linux   |         Cpu:  Unspecified        
---------------------+------------------------------------------------------
Comment (by marisn):

 That's much better.

 Still search should not be performed if proper file is not selected:
 {{{
 Traceback (most recent call last):
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 1437, in OnSearch
     self.epsglist.Search(index=[0,1,2], pattern=value)
 ValueError: need more than 0 values to unpack
 }}}

 Also currently EPSG file change is detected only after browse or on ENTER.
 It would be nice to detect simple edits without need to press ENTER.
 Following approach has one disadvantage - if file name field has focus
 when user chooses CANCEL, it also gives an warning about improper file
 name if it's wrong one. As I have no idea how events work in wxpython, I
 can't provide code, just an idea.
 {{{
 Index: wxpython/gui_modules/location_wizard.py
 ===================================================================
 --- wxpython/gui_modules/location_wizard.py     (revision 41318)
 +++ wxpython/gui_modules/location_wizard.py     (working copy)
 @@ -1350,6 +1350,7 @@
          # events
          self.bbrowse.Bind(wx.EVT_BUTTON, self.OnBrowse)
          self.tfile.Bind(wx.EVT_TEXT_ENTER, self.OnBrowseCodes)
 +        self.tfile.Bind(wx.EVT_KILL_FOCUS, self.OnBrowseCodes)
          self.tcode.Bind(wx.EVT_TEXT, self.OnText)
          self.tcode.Bind(wx.EVT_TEXT_ENTER, self.OnText)
          self.epsglist.Bind(wx.EVT_LIST_ITEM_SELECTED,
 self.OnItemSelected)
 @@ -1368,6 +1369,7 @@

          # load default epsg database file
          self.OnBrowseCodes(None)
 +        self.searchb.SetFocus()

          event.Skip()

 }}}

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/987#comment:2>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list