瀏覽代碼

wxGUI/forms: fix SignatureSelect for sig/sigset files

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54695 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 年之前
父節點
當前提交
d18614961c
共有 2 個文件被更改,包括 8 次插入7 次删除
  1. 5 5
      gui/wxpython/gui_core/forms.py
  2. 3 2
      gui/wxpython/gui_core/gselect.py

+ 5 - 5
gui/wxpython/gui_core/forms.py

@@ -32,7 +32,7 @@ pythonw on a Mac.
 @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 @@ class CmdPanel(wx.Panel):
 
                 # 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 @@ class CmdPanel(wx.Panel):
             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)

+ 3 - 2
gui/wxpython/gui_core/gselect.py

@@ -1987,10 +1987,11 @@ class CoordinatesSelect(wx.Panel):
 
 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 @@ class SignatureSelect(wx.ComboBox):
             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: