Forráskód Böngészése

wxGUI: fix menuform dialog (map tree)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44000 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 éve
szülő
commit
a22f0c529f
1 módosított fájl, 8 hozzáadás és 2 törlés
  1. 8 2
      gui/wxpython/gui_modules/goutput.py

+ 8 - 2
gui/wxpython/gui_modules/goutput.py

@@ -737,13 +737,19 @@ class GMConsole(wx.SplitterWindow):
                 dialog.btn_run.Enable(True)
             
             if event.returncode == 0 and not event.aborted:
-                winName = self.parent.parent.parent.GetName()
+                try:
+                    winName = self.parent.parent.parent.GetName()
+                except AttributeError:
+                    winName = ''
+                
                 if winName == 'LayerManager':
                     mapTree = self.parent.parent.parent.GetLayerTree()
                 elif winName == 'LayerTree':
                     mapTree = self.parent.parent.parent
-                else: # GMConsole
+                elif winName: # GMConsole
                     mapTree = self.parent.parent.parent.parent.GetLayerTree()
+                else:
+                    mapTree = None
                 
                 cmd = dialog.notebookpanel.createCmd(ignoreErrors = True)
                 if hasattr(dialog, "addbox") and dialog.addbox.IsChecked():