Browse Source

wxGUI/gmodeler: fix ModelDataDialog

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67783 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 9 years ago
parent
commit
78e07263c9

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

@@ -53,6 +53,7 @@ class ModelDataDialog(SimpleDialog):
         SimpleDialog.__init__(self, parent, title)
                 
         self.element = Select(parent = self.panel,
+                              type = self.shape.GetPrompt(),
                               validator = SimpleValidator(callback = self.ValidatorCallback))
         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()))
         
         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):
             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:
             root = self.seltree.GetRootItem()
             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):
         """Reads UserSettings to get height (which was 200 in old implementation).