[GRASS-SVN] r68979 - in grass/branches/releasebranch_7_2/gui/wxpython: lmgr modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 15 07:54:04 PDT 2016


Author: martinl
Date: 2016-07-15 07:54:04 -0700 (Fri, 15 Jul 2016)
New Revision: 68979

Modified:
   grass/branches/releasebranch_7_2/gui/wxpython/lmgr/frame.py
   grass/branches/releasebranch_7_2/gui/wxpython/lmgr/layertree.py
   grass/branches/releasebranch_7_2/gui/wxpython/modules/import_export.py
Log:
wxGUI/import: do not use ReprojectionDialog for linked data
              reorder items in import menu
              blacklist -l/-f flags
              move override check from import settings tab to the main tab (it's commonly used option)
              (merge r68975:r68978 from trunk)


Modified: grass/branches/releasebranch_7_2/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/lmgr/frame.py	2016-07-15 14:46:29 UTC (rev 68978)
+++ grass/branches/releasebranch_7_2/gui/wxpython/lmgr/frame.py	2016-07-15 14:54:04 UTC (rev 68979)
@@ -1264,13 +1264,14 @@
         """Import maps menu (import, link)
         """
         self._popupMenu((('rastImport', self.OnImportGdalLayers),
-                         ('rastLink', self.OnLinkGdalLayers),
+                         ('vectImport', self.OnImportOgrLayers),
+                         (None, None),
                          ('rastUnpack', self.OnUnpackRaster),
-                         ('rastOut', self.OnRasterOutputFormat),
+                         ('vectUnpack', self.OnUnpackVector),
                          (None, None),
-                         ('vectImport', self.OnImportOgrLayers),
+                         ('rastLink', self.OnLinkGdalLayers),
                          ('vectLink', self.OnLinkOgrLayers),
-                         ('vectUnpack', self.OnUnpackVector),
+                         ('rastOut', self.OnRasterOutputFormat),
                          ('vectOut', self.OnVectorOutputFormat)))
 
     def OnWorkspaceNew(self, event=None):

Modified: grass/branches/releasebranch_7_2/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/lmgr/layertree.py	2016-07-15 14:46:29 UTC (rev 68978)
+++ grass/branches/releasebranch_7_2/gui/wxpython/lmgr/layertree.py	2016-07-15 14:54:04 UTC (rev 68979)
@@ -57,7 +57,7 @@
     'rastLink': MetaIcon(img='layer-import',
                          label=_('Link external raster data')),
     'rastUnpack': MetaIcon(img='layer-import',
-                           label=_('Unpack raster map')),
+                           label=_('Unpack GRASS raster map')),
     'rastOut': MetaIcon(img='layer-export',
                         label=_('Set raster output format')),
     'vectImport': MetaIcon(img='layer-import',
@@ -65,7 +65,7 @@
     'vectLink': MetaIcon(img='layer-import',
                          label=_('Link external vector data')),
     'vectUnpack': MetaIcon(img='layer-import',
-                           label=_('Unpack vector map')),
+                           label=_('Unpack GRASS vector map')),
     'vectOut': MetaIcon(img='layer-export',
                         label=_('Set vector output format')),
     'wmsImport': MetaIcon(img='layer-wms-add',

Modified: grass/branches/releasebranch_7_2/gui/wxpython/modules/import_export.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/modules/import_export.py	2016-07-15 14:46:29 UTC (rev 68978)
+++ grass/branches/releasebranch_7_2/gui/wxpython/modules/import_export.py	2016-07-15 14:54:04 UTC (rev 68979)
@@ -11,7 +11,7 @@
  - :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 @@
         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 @@
             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,9 @@
 
         layers = self.list.GetLayers()
 
-        if differentProjLayers and '-o' not in self.getSettingsPageCmd():
+        if not self.link and \
+           differentProjLayers and \
+           not self.override.IsChecked(): # '-o' not in self.getSettingsPageCmd():
 
             dlg = ReprojectionDialog(
                 parent=self,
@@ -437,6 +446,9 @@
             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 +486,7 @@
 
     def _getBlackListedFlags(self):
         """Get flags which will not be showed in Settings page"""
-        return ['overwrite']
+        return ['overwrite', 'o']
 
 
 class OgrImportDialog(ImportDialog):
@@ -574,6 +586,9 @@
             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 +630,7 @@
 
     def _getBlackListedFlags(self):
         """Get flags which will not be showed in Settings page"""
-        return ['overwrite']
+        return ['overwrite', 'o', 'l', 'f']
 
 
 class GdalOutputDialog(wx.Dialog):



More information about the grass-commit mailing list