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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 18 02:58:55 PST 2013


Author: martinl
Date: 2013-01-18 02:58:55 -0800 (Fri, 18 Jan 2013)
New Revision: 54695

Modified:
   grass/trunk/gui/wxpython/gui_core/forms.py
   grass/trunk/gui/wxpython/gui_core/gselect.py
Log:
wxGUI/forms: fix SignatureSelect for sig/sigset files


Modified: grass/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py	2013-01-18 10:56:07 UTC (rev 54694)
+++ grass/trunk/gui/wxpython/gui_core/forms.py	2013-01-18 10:58:55 UTC (rev 54695)
@@ -32,7 +32,7 @@
 @todo
  - verify option value types
 
-Copyright(C) 2000-2012 by the GRASS Development Team
+Copyright(C) 2000-2013 by the GRASS Development Team
 
 This program is free software under the GPL(>=v2) Read the file
 COPYING coming with GRASS for details.
@@ -1260,7 +1260,7 @@
 
                 # sigrature file
                 elif prompt == 'sigfile':
-                    selection = gselect.SignatureSelect(parent = which_panel)
+                    selection = gselect.SignatureSelect(parent = which_panel, element = p.get('element', 'sig'))
                     p['wxId'] = [ selection.GetId() ]
                     selection.Bind(wx.EVT_TEXT, self.OnSetValue)
                     which_sizer.Add(item = selection, proportion = 0,
@@ -1574,12 +1574,12 @@
             if p.get('gisprompt', False) == False:
                 continue
             
-            prompt = p.get('element', '')
-            if prompt in ('cell', 'vector'):
+            prompt = p.get('prompt', '')
+            if prompt in ('raster', 'vector'):
                 name = p.get('name', '')
                 if name in ('map', 'input'):
                     pMap = p
-            elif prompt == 'layer':
+            elif prompt in ('layer', 'layer_all'):
                 pLayer.append(p)
             elif prompt == 'dbcolumn':
                 pColumn.append(p)

Modified: grass/trunk/gui/wxpython/gui_core/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/gselect.py	2013-01-18 10:56:07 UTC (rev 54694)
+++ grass/trunk/gui/wxpython/gui_core/gselect.py	2013-01-18 10:58:55 UTC (rev 54695)
@@ -1987,10 +1987,11 @@
 
 class SignatureSelect(wx.ComboBox):
     """!Widget for selecting signatures"""
-    def __init__(self, parent, id = wx.ID_ANY, size = globalvar.DIALOG_GSELECT_SIZE, 
+    def __init__(self, parent, element, id = wx.ID_ANY, size = globalvar.DIALOG_GSELECT_SIZE, 
                  **kwargs):
         super(SignatureSelect, self).__init__(parent, id, size = size, 
                                               **kwargs)
+        self.element = element
         self.SetName("SignatureSelect")
 
     def Insert(self, group, subgroup = None):
@@ -2015,7 +2016,7 @@
             path = os.path.join(path, 'subgroup', subgroup)
         try:
             items = list()
-            for element in os.listdir(os.path.join(path, 'sig')):
+            for element in os.listdir(os.path.join(path, self.element)):
                 items.append(element)
             self.SetItems(items)
         except OSError:



More information about the grass-commit mailing list