[GRASS-SVN] r62755 - in grass/branches/releasebranch_7_0: . gui/wxpython/lmgr
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Nov 16 02:33:17 PST 2014
Author: martinl
Date: 2014-11-16 02:33:17 -0800 (Sun, 16 Nov 2014)
New Revision: 62755
Modified:
grass/branches/releasebranch_7_0/
grass/branches/releasebranch_7_0/gui/wxpython/lmgr/frame.py
grass/branches/releasebranch_7_0/gui/wxpython/lmgr/layertree.py
Log:
wxGUI: add r|v.pack a r|v.unpack to layer manager's contextual menu
(merge r62750 from trunk)
Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
- /grass/trunk:60817,61096,61141,62179-62180,62182,62403,62422,62424,62437,62466,62469,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62570,62573,62575,62585,62588,62597,62603,62606,62608-62609,62614,62618,62628,62632,62638,62642,62648-62649,62652,62654-62657,62666,62723,62730,62739,62741,62743,62746,62752
+ /grass/trunk:60817,61096,61141,62179-62180,62182,62403,62422,62424,62437,62466,62469,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62570,62573,62575,62585,62588,62597,62603,62606,62608-62609,62614,62618,62628,62632,62638,62642,62648-62649,62652,62654-62657,62666,62723,62730,62739,62741,62743,62746,62750,62752
Modified: grass/branches/releasebranch_7_0/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/lmgr/frame.py 2014-11-16 03:08:22 UTC (rev 62754)
+++ grass/branches/releasebranch_7_0/gui/wxpython/lmgr/frame.py 2014-11-16 10:33:17 UTC (rev 62755)
@@ -1097,10 +1097,12 @@
"""
self._popupMenu((('rastImport', self.OnImportGdalLayers),
('rastLink', self.OnLinkGdalLayers),
+ ('rastUnpack', self.OnUnpackRaster),
('rastOut', self.OnRasterOutputFormat),
(None, None),
('vectImport', self.OnImportOgrLayers),
('vectLink', self.OnLinkOgrLayers),
+ ('vectUnpack', self.OnUnpackVector),
('vectOut', self.OnVectorOutputFormat)))
def OnWorkspaceNew(self, event = None):
@@ -1614,7 +1616,15 @@
dlg = GdalOutputDialog(parent = self, ogr = True)
dlg.CentreOnScreen()
dlg.Show()
-
+
+ def OnUnpackRaster(self, event):
+ """Unpack raster map handler"""
+ self.OnMenuCmd(cmd = ['r.unpack'])
+
+ def OnUnpackVector(self, event):
+ """Unpack vector map handler"""
+ self.OnMenuCmd(cmd = ['v.unpack'])
+
def OnImportDxfFile(self, event, cmd = None):
"""Convert multiple DXF layers to GRASS vector map layers"""
dlg = DxfImportDialog(parent = self, giface = self._giface)
Modified: grass/branches/releasebranch_7_0/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/lmgr/layertree.py 2014-11-16 03:08:22 UTC (rev 62754)
+++ grass/branches/releasebranch_7_0/gui/wxpython/lmgr/layertree.py 2014-11-16 10:33:17 UTC (rev 62755)
@@ -6,7 +6,7 @@
Classes:
- layertree::LayerTree
-(C) 2007-2013 by the GRASS Development Team
+(C) 2007-2014 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.
@@ -56,12 +56,16 @@
label = _('Import raster data')),
'rastLink' : MetaIcon(img = 'layer-import',
label = _('Link external raster data')),
+ 'rastUnpack' : MetaIcon(img = 'layer-import',
+ label = _('Unpack raster map')),
'rastOut' : MetaIcon(img = 'layer-export',
label = _('Set raster output format')),
'vectImport' : MetaIcon(img = 'layer-import',
label = _('Import vector data')),
'vectLink' : MetaIcon(img = 'layer-import',
label = _('Link external vector data')),
+ 'vectUnpack' : MetaIcon(img = 'layer-import',
+ label = _('Unpack vector map')),
'vectOut' : MetaIcon(img = 'layer-export',
label = _('Set vector output format')),
'wmsImport' : MetaIcon(img = 'layer-wms-add',
@@ -401,7 +405,7 @@
'region', 'export', 'attr', 'edit', 'save_ws',
'bgmap', 'topo', 'meta', 'null', 'zoom1', 'region1',
'color', 'hist', 'univar', 'prof', 'properties', 'sql', 'copy',
- 'report', 'export-pg'):
+ 'report', 'export-pg', 'pack'):
self.popupID[key] = wx.NewId()
# get current mapset
@@ -484,6 +488,12 @@
id = self.popupID['export-pg'])
if 'v.out.postgis' not in globalvar.grassCmd:
self.popupMenu.Enable(self.popupID['export-pg'], False)
+
+ item = wx.MenuItem(self.popupMenu, id = self.popupID['pack'], text = _("Create pack"))
+ self.popupMenu.AppendItem(item)
+ self.Bind(wx.EVT_MENU, lambda x: self.lmgr.OnMenuCmd(cmd = ['v.pack',
+ 'input=%s' % mapLayer.GetName()]),
+ id = self.popupID['pack'])
lmapset = self.GetLayerInfo(self.layer_selected, key = 'maplayer').GetMapset()
if lmapset != currentMapset:
@@ -579,6 +589,12 @@
'input=%s' % mapLayer.GetName()]),
id = self.popupID['export'])
+ item = wx.MenuItem(self.popupMenu, id = self.popupID['pack'], text = _("Create pack"))
+ self.popupMenu.AppendItem(item)
+ self.Bind(wx.EVT_MENU, lambda x: self.lmgr.OnMenuCmd(cmd = ['r.pack',
+ 'input=%s' % mapLayer.GetName()]),
+ id = self.popupID['pack'])
+
lmapset = self.GetLayerInfo(self.layer_selected, key = 'maplayer').GetMapset()
if lmapset != currentMapset:
self.popupMenu.Append(self.popupID['copy'], text = _("Make a copy in the current mapset"))
More information about the grass-commit
mailing list