[GRASS-SVN] r67336 - grass/trunk/gui/wxpython/lmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 23 03:14:36 PST 2015


Author: mlennert
Date: 2015-12-23 03:14:36 -0800 (Wed, 23 Dec 2015)
New Revision: 67336

Modified:
   grass/trunk/gui/wxpython/lmgr/layertree.py
Log:
add attribute export to vector layer context menu


Modified: grass/trunk/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/layertree.py	2015-12-23 01:47:48 UTC (rev 67335)
+++ grass/trunk/gui/wxpython/lmgr/layertree.py	2015-12-23 11:14:36 UTC (rev 67336)
@@ -406,7 +406,7 @@
                         'region', 'export', 'attr', 'edit', 'save_ws',
                         'bgmap', 'topo', 'meta', 'null', 'zoom1',
                         'color', 'colori', 'hist', 'univar', 'prof', 'properties', 'sql', 'copy',
-                        'report', 'export-pg', 'pack'):
+                        'report', 'export-pg', 'export-attr', 'pack'):
                 self.popupID[key] = wx.NewId()
         
         # get current mapset
@@ -490,6 +490,13 @@
             if 'v.out.postgis' not in globalvar.grassCmd:
                 self.popupMenu.Enable(self.popupID['export-pg'], False)
 
+            self.popupMenu.Append(self.popupID['export-attr'], text = _("Export attribute table"))
+            self.Bind(wx.EVT_MENU, lambda x: self.lmgr.OnMenuCmd(cmd = ['v.db.select',
+                                                                        'map=%s' % mapLayer.GetName()]),
+                      id = self.popupID['export-attr'])
+            if 'v.db.select' not in globalvar.grassCmd:
+                self.popupMenu.Enable(self.popupID['export-attr'], 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',



More information about the grass-commit mailing list