[GRASS-SVN] r50274 -
grass/branches/develbranch_6/gui/wxpython/gui_core
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jan 18 10:17:36 EST 2012
Author: martinl
Date: 2012-01-18 07:17:36 -0800 (Wed, 18 Jan 2012)
New Revision: 50274
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_core/dialogs.py
Log:
wxGUI/importer: don't close window
fix AddLayers on error
check by default when one layer available
Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/dialogs.py 2012-01-18 15:13:06 UTC (rev 50273)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/dialogs.py 2012-01-18 15:17:36 UTC (rev 50274)
@@ -1592,11 +1592,10 @@
def AddLayers(self, returncode, cmd = None):
"""!Add imported/linked layers into layer tree"""
- self.commandId += 1
-
if not self.add.IsChecked() or returncode != 0:
return
+ self.commandId += 1
maptree = self.parent.curr_page.maptree
layer, output = self.list.GetLayers()[self.commandId]
@@ -1678,11 +1677,9 @@
def OnRun(self, event):
"""!Import/Link data (each layes as separate vector map)"""
+ self.commandId = -1
data = self.list.GetLayers()
- # hide dialog
- self.Hide()
-
dsn = self.dsnInput.GetDsn()
ext = self.dsnInput.GetFormatExt()
@@ -1729,8 +1726,6 @@
self.parent.goutput.RunCmd(cmd, switchPage = True,
onDone = self.AddLayers)
- self.OnCancel()
-
def _getCommand(self):
"""!Get command"""
if self.link:
@@ -1872,9 +1867,11 @@
index = self.InsertStringItem(sys.maxint, str(id))
self.SetStringItem(index, 1, "%s" % str(name))
self.SetStringItem(index, 2, "%s" % str(grassName))
- # check by default
- ### self.CheckItem(index, True)
+ # check by default only on one item
+ if len(data) == 1:
+ self.CheckItem(index, True)
+
self.SetColumnWidth(col = 0, width = wx.LIST_AUTOSIZE_USEHEADER)
def OnPopupMenu(self, event):
More information about the grass-commit
mailing list