Browse Source

wxGUI/importer: don't close window
fix AddLayers on error


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

Martin Landa 13 years ago
parent
commit
ee1be35a40
1 changed files with 2 additions and 7 deletions
  1. 2 7
      gui/wxpython/gui_core/dialogs.py

+ 2 - 7
gui/wxpython/gui_core/dialogs.py

@@ -1654,11 +1654,10 @@ class ImportDialog(wx.Dialog):
     
     
     def AddLayers(self, returncode, cmd = None):
     def AddLayers(self, returncode, cmd = None):
         """!Add imported/linked layers into layer tree"""
         """!Add imported/linked layers into layer tree"""
-        self.commandId += 1
-        
         if not self.add.IsChecked() or returncode != 0:
         if not self.add.IsChecked() or returncode != 0:
             return
             return
         
         
+        self.commandId += 1
         maptree = self.parent.curr_page.maptree
         maptree = self.parent.curr_page.maptree
         
         
         layer, output = self.list.GetLayers()[self.commandId]
         layer, output = self.list.GetLayers()[self.commandId]
@@ -1745,11 +1744,9 @@ class GdalImportDialog(ImportDialog):
 
 
     def OnRun(self, event):
     def OnRun(self, event):
         """!Import/Link data (each layes as separate vector map)"""
         """!Import/Link data (each layes as separate vector map)"""
+        self.commandId = -1
         data = self.list.GetLayers()
         data = self.list.GetLayers()
         
         
-        # hide dialog
-        self.Hide()
-        
         dsn = self.dsnInput.GetDsn()
         dsn = self.dsnInput.GetDsn()
         ext = self.dsnInput.GetFormatExt()
         ext = self.dsnInput.GetFormatExt()
             
             
@@ -1796,8 +1793,6 @@ class GdalImportDialog(ImportDialog):
             self.parent.goutput.RunCmd(cmd, switchPage = True,
             self.parent.goutput.RunCmd(cmd, switchPage = True,
                                        onDone = self.AddLayers)
                                        onDone = self.AddLayers)
         
         
-        self.OnCancel()
-
     def _getCommand(self):
     def _getCommand(self):
         """!Get command"""
         """!Get command"""
         if self.link:
         if self.link: