浏览代码

wxGUI/gmodeler: fix ModelDataDialog

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67783 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 9 年之前
父节点
当前提交
78e07263c9
共有 3 个文件被更改,包括 9 次插入6 次删除
  1. 1 0
      gui/wxpython/gmodeler/dialogs.py
  2. 5 4
      gui/wxpython/gmodeler/frame.py
  3. 3 2
      gui/wxpython/gui_core/gselect.py

+ 1 - 0
gui/wxpython/gmodeler/dialogs.py

@@ -53,6 +53,7 @@ class ModelDataDialog(SimpleDialog):
         SimpleDialog.__init__(self, parent, title)
         SimpleDialog.__init__(self, parent, title)
                 
                 
         self.element = Select(parent = self.panel,
         self.element = Select(parent = self.panel,
+                              type = self.shape.GetPrompt(),
                               validator = SimpleValidator(callback = self.ValidatorCallback))
                               validator = SimpleValidator(callback = self.ValidatorCallback))
         self.element.SetValue(shape.GetValue())
         self.element.SetValue(shape.GetValue())
         
         

+ 5 - 4
gui/wxpython/gmodeler/frame.py

@@ -1189,10 +1189,11 @@ class ModelEvtHandler(ogl.ShapeEvtHandler):
                                  completed = (self.frame.GetOptData, shape, shape.GetParams()))
                                  completed = (self.frame.GetOptData, shape, shape.GetParams()))
         
         
         elif isinstance(shape, ModelData):
         elif isinstance(shape, ModelData):
-            dlg = ModelDataDialog(parent = self.frame, shape = shape)
-            shape.SetPropDialog(dlg)
-            dlg.CentreOnParent()
-            dlg.Show()
+            if shape.GetPrompt() in ('raster', 'vector', 'raster_3d'):
+                dlg = ModelDataDialog(parent = self.frame, shape = shape)
+                shape.SetPropDialog(dlg)
+                dlg.CentreOnParent()
+                dlg.Show()
         
         
         elif isinstance(shape, ModelLoop):
         elif isinstance(shape, ModelLoop):
             dlg = ModelLoopDialog(parent = self.frame, shape = shape)
             dlg = ModelLoopDialog(parent = self.frame, shape = shape)

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

@@ -250,8 +250,9 @@ class ListCtrlComboPopup(wx.combo.ComboPopup):
         if inputText:
         if inputText:
             root = self.seltree.GetRootItem()
             root = self.seltree.GetRootItem()
             match = self.FindItem(root, inputText, startLetters = True)
             match = self.FindItem(root, inputText, startLetters = True)
-            self.seltree.EnsureVisible(match)
-            self.seltree.SelectItem(match)
+            if match.IsOk():
+                self.seltree.EnsureVisible(match)
+                self.seltree.SelectItem(match)
 
 
     def GetAdjustedSize(self, minWidth, prefHeight, maxHeight):
     def GetAdjustedSize(self, minWidth, prefHeight, maxHeight):
         """Reads UserSettings to get height (which was 200 in old implementation).
         """Reads UserSettings to get height (which was 200 in old implementation).