Quellcode durchsuchen

wxGUI: add 'PostGIS export' to vector contextual menu

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@58231 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa vor 11 Jahren
Ursprung
Commit
02940a8ceb
1 geänderte Dateien mit 6 neuen und 2 gelöschten Zeilen
  1. 6 2
      gui/wxpython/lmgr/layertree.py

+ 6 - 2
gui/wxpython/lmgr/layertree.py

@@ -406,7 +406,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
                         'region', 'export', 'attr', 'edit0', 'edit1', 'save_ws',
                         'bgmap', 'topo', 'meta', 'null', 'zoom1', 'region1',
                         'color', 'hist', 'univar', 'prof', 'properties', 'sql', 'copy',
-                        'report'):
+                        'report', 'export-pg'):
                 self.popupID[key] = wx.NewId()
         
         # get current mapset
@@ -463,10 +463,14 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         # vector layers (specific items)
         if mltype and mltype == "vector" and numSelected == 1:
             self.popupMenu.AppendSeparator()
-            self.popupMenu.Append(self.popupID['export'], text = _("Export"))
+            self.popupMenu.Append(self.popupID['export'], text = _("Export common formats"))
             self.Bind(wx.EVT_MENU, lambda x: self.lmgr.OnMenuCmd(cmd = ['v.out.ogr',
                                                                         'input=%s' % mapLayer.GetName()]),
                       id = self.popupID['export'])
+            self.popupMenu.Append(self.popupID['export-pg'], text = _("Export PostGIS"))
+            self.Bind(wx.EVT_MENU, lambda x: self.lmgr.OnMenuCmd(cmd = ['v.out.postgis',
+                                                                        'input=%s' % mapLayer.GetName()]),
+                      id = self.popupID['export-pg'])
             
             lmapset = self.GetLayerInfo(self.layer_selected, key = 'maplayer').GetMapset()
             if lmapset != currentMapset: