Selaa lähdekoodia

wxGUI/import: move override check from import settings tab to the main tab (it's commonly used option)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68975 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 8 vuotta sitten
vanhempi
commit
cf12050abd
1 muutettua tiedostoa jossa 17 lisäystä ja 4 poistoa
  1. 17 4
      gui/wxpython/modules/import_export.py

+ 17 - 4
gui/wxpython/modules/import_export.py

@@ -11,7 +11,7 @@ List of classes:
  - :class:`DxfImportDialog`
  - :class:`ReprojectionDialog`
 
-(C) 2008-2015 by the GRASS Development Team
+(C) 2008-2016 by the GRASS Development Team
 
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -80,6 +80,10 @@ class ImportDialog(wx.Dialog):
         self.list = LayersList(parent=self.panel, columns=columns)
         self.list.LoadData()
 
+        self.override = wx.CheckBox(
+            parent=self.panel, id=wx.ID_ANY,
+            label=_("Override projection check (use current location's projection)"))
+
         self.overwrite = wx.CheckBox(
             parent=self.panel, id=wx.ID_ANY,
             label=_("Allow output files to overwrite existing files"))
@@ -167,6 +171,9 @@ class ImportDialog(wx.Dialog):
             flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND,
             border=5)
 
+        dialogSizer.Add(item=self.override, proportion=0,
+                        flag=wx.LEFT | wx.RIGHT | wx.BOTTOM, border=5)
+
         dialogSizer.Add(item=self.overwrite, proportion=0,
                         flag=wx.LEFT | wx.RIGHT | wx.BOTTOM, border=5)
 
@@ -313,7 +320,7 @@ class ImportDialog(wx.Dialog):
 
         layers = self.list.GetLayers()
 
-        if differentProjLayers and '-o' not in self.getSettingsPageCmd():
+        if differentProjLayers and not self.override.IsChecked(): # '-o' not in self.getSettingsPageCmd():
 
             dlg = ReprojectionDialog(
                 parent=self,
@@ -437,6 +444,9 @@ class GdalImportDialog(ImportDialog):
             cmd.append('input=%s' % idsn)
             cmd.append('output=%s' % output)
 
+            if self.override.IsChecked():
+                cmd.append('-o')
+
             if self.overwrite.IsChecked():
                 cmd.append('--overwrite')
 
@@ -474,7 +484,7 @@ class GdalImportDialog(ImportDialog):
 
     def _getBlackListedFlags(self):
         """Get flags which will not be showed in Settings page"""
-        return ['overwrite']
+        return ['overwrite', 'o']
 
 
 class OgrImportDialog(ImportDialog):
@@ -574,6 +584,9 @@ class OgrImportDialog(ImportDialog):
             cmd.append('layer=%s' % layer)
             cmd.append('output=%s' % output)
 
+            if self.override.IsChecked():
+                cmd.append('-o')
+
             if self.overwrite.IsChecked():
                 cmd.append('--overwrite')
 
@@ -615,7 +628,7 @@ class OgrImportDialog(ImportDialog):
 
     def _getBlackListedFlags(self):
         """Get flags which will not be showed in Settings page"""
-        return ['overwrite']
+        return ['overwrite', 'o']
 
 
 class GdalOutputDialog(wx.Dialog):