[GRASS-SVN] r39669 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Nov 2 16:15:13 EST 2009
Author: martinl
Date: 2009-11-02 16:15:12 -0500 (Mon, 02 Nov 2009)
New Revision: 39669
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py
Log:
multi-import dialog: add some options (-o/--o), see trac #799
(merge r39668 from trunk)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py 2009-11-02 21:11:31 UTC (rev 39668)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py 2009-11-02 21:15:12 UTC (rev 39669)
@@ -992,8 +992,18 @@
self.add.SetLabel(_("Add linked layers into layer tree"))
else:
self.add.SetLabel(_("Add imported layers into layer tree"))
+
+ if not link and self.inputType in ('gdal', 'ogr'):
+ self.overrideCheck = wx.CheckBox(parent=self.panel, id=wx.ID_ANY,
+ label=_("Override projection (use location's projection)"))
+ self.overrideCheck.SetValue(True)
+
self.add.SetValue(UserSettings.Get(group='cmd', key='addNewLayer', subkey='enabled'))
+ self.overwrite = wx.CheckBox(parent=self.panel, id=wx.ID_ANY,
+ label=_("Allow output files to overwrite existing files"))
+ self.overwrite.SetValue(UserSettings.Get(group='cmd', key='overwrite', subkey='enabled'))
+
#
# buttons
#
@@ -1052,6 +1062,13 @@
dialogSizer.Add(item=layerSizer, proportion=1,
flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=5)
+ if hasattr(self, "overrideCheck"):
+ dialogSizer.Add(item=self.overrideCheck, proportion=0,
+ flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=5)
+
+ dialogSizer.Add(item=self.overwrite, proportion=0,
+ flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=5)
+
dialogSizer.Add(item=self.add, proportion=0,
flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=5)
@@ -1078,7 +1095,7 @@
self.Layout()
# auto-layout seems not work here - FIXME
- self.SetMinSize((globalvar.DIALOG_GSELECT_SIZE[0] + 175, 300))
+ self.SetMinSize((globalvar.DIALOG_GSELECT_SIZE[0] + 175, 400))
width = self.GetSize()[0]
self.list.SetColumnWidth(col=1, width=width/2 - 50)
@@ -1112,14 +1129,20 @@
'output=%s' % output]
else: # gdal
if self.link:
- cmd = ['r.external', '-o', # override projection by default
+ cmd = ['r.external',
'input=%s' % (os.path.join(self.input.GetValue(), layer)),
'output=%s' % output]
else:
- cmd = ['r.in.gdal', '-o', # override projection by default
+ cmd = ['r.in.gdal',
'input=%s' % (os.path.join(self.input.GetValue(), layer)),
'output=%s' % output]
+
+ if self.overwrite.IsChecked():
+ cmd.append('--overwrite')
+ if hasattr(self, "overrideCheck") and self.overrideCheck.IsChecked():
+ cmd.append('-o')
+
if UserSettings.Get(group='cmd', key='overwrite', subkey='enabled'):
cmd.append('--overwrite')
More information about the grass-commit
mailing list