Browse Source

wxGUI/modeler: remove debug code

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41629 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 years ago
parent
commit
8acc3a274a
1 changed files with 26 additions and 40 deletions
  1. 26 40
      gui/wxpython/gui_modules/gmodeler.py

+ 26 - 40
gui/wxpython/gui_modules/gmodeler.py

@@ -46,8 +46,6 @@ from   gcmd import GMessage
 
 from grass.script import core as grass
 
-debug = True
-
 class ModelFrame(wx.Frame):
     def __init__(self, parent, id = wx.ID_ANY, title = _("Graphical modeler (under development)"), **kwargs):
         """!Graphical modeler main window
@@ -118,17 +116,12 @@ class ModelFrame(wx.Frame):
     def OnModelOpen(self, event):
         """!Load model from file"""
         filename = ''
-        global debug
-        if debug is False:
-            dlg = wx.FileDialog(parent = self, message=_("Choose model file"),
-                                defaultDir = os.getcwd(),
-                                wildcard=_("GRASS Model File (*.gxm)|*.gxm"))
-            if dlg.ShowModal() == wx.ID_OK:
-                filename = dlg.GetPath()
-        
-        else:
-            filename = '/home/martin/model1.gxm'
-            
+        dlg = wx.FileDialog(parent = self, message=_("Choose model file"),
+                            defaultDir = os.getcwd(),
+                            wildcard=_("GRASS Model File (*.gxm)|*.gxm"))
+        if dlg.ShowModal() == wx.ID_OK:
+            filename = dlg.GetPath()
+                    
         if not filename:
             return
         
@@ -162,19 +155,16 @@ class ModelFrame(wx.Frame):
         
     def OnModelSaveAs(self, event):
         """!Create model to file as"""
-        global debug
-        if debug is False:
-            dlg = wx.FileDialog(parent = self,
-                                message = _("Choose file to save current model"),
-                                defaultDir = os.getcwd(),
-                                wildcard=_("GRASS Model File (*.gxm)|*.gxm"),
-                                style=wx.FD_SAVE)
-            
-            filename = ''
-            if dlg.ShowModal() == wx.ID_OK:
-                filename = dlg.GetPath()
-        else:
-            filename = '/home/martin/model1.gxm'
+        filename = ''
+        dlg = wx.FileDialog(parent = self,
+                            message = _("Choose file to save current model"),
+                            defaultDir = os.getcwd(),
+                            wildcard=_("GRASS Model File (*.gxm)|*.gxm"),
+                            style=wx.FD_SAVE)
+        
+        
+        if dlg.ShowModal() == wx.ID_OK:
+            filename = dlg.GetPath()
         
         if not filename:
             return
@@ -215,22 +205,18 @@ class ModelFrame(wx.Frame):
 
     def OnAddAction(self, event):
         """!Add action to model"""
-        global debug
-        if debug == False:
-            if self.searchDialog is None:
-                self.searchDialog = ModelSearchDialog(self)
-                self.searchDialog.CentreOnParent()
-            else:
-                self.searchDialog.Reset()
-            
-            if self.searchDialog.ShowModal() == wx.ID_CANCEL:
-                self.searchDialog.Hide()
-                return
+        if self.searchDialog is None:
+            self.searchDialog = ModelSearchDialog(self)
+            self.searchDialog.CentreOnParent()
+        else:
+            self.searchDialog.Reset()
             
-            cmd = self.searchDialog.GetCmd()
+        if self.searchDialog.ShowModal() == wx.ID_CANCEL:
             self.searchDialog.Hide()
-        else:
-            cmd = ['r.buffer']
+            return
+            
+        cmd = self.searchDialog.GetCmd()
+        self.searchDialog.Hide()
         
         # add action to canvas
         width, height = self.canvas.GetSize()