Browse Source

wxGUI/modeler: fix OnModelNew()
(merge https://trac.osgeo.org/grass/changeset/48698 from devbr6)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@48699 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 13 years ago
parent
commit
9594adf56f
1 changed files with 7 additions and 0 deletions
  1. 7 0
      gui/wxpython/gui_modules/gmodeler.py

+ 7 - 0
gui/wxpython/gui_modules/gmodeler.py

@@ -926,6 +926,8 @@ class ModelFrame(wx.Frame):
         self.canvas.GetDiagram().DeleteAllShapes()
         self.canvas.GetDiagram().DeleteAllShapes()
         self.model.Reset()
         self.model.Reset()
         self.canvas.Refresh()
         self.canvas.Refresh()
+        self.itemPanel.Update()
+        self.variablePanel.Reset()
         
         
         # no model file loaded
         # no model file loaded
         self.modelFile = None
         self.modelFile = None
@@ -3905,6 +3907,11 @@ class VariablePanel(wx.Panel):
         """!Reload list of variables"""
         """!Reload list of variables"""
         self.list.OnReload(None)
         self.list.OnReload(None)
         
         
+    def Reset(self):
+        """!Remove all variables"""
+        self.list.DeleteAllItems()
+        self.parent.GetModel().SetVariables([])
+        
 class VariableListCtrl(ModelListCtrl):
 class VariableListCtrl(ModelListCtrl):
     def __init__(self, parent, columns, **kwargs):
     def __init__(self, parent, columns, **kwargs):
         """!List of model variables"""
         """!List of model variables"""