[GRASS-SVN] r42030 - grass-addons/gui/wxpython/data_catalog
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Apr 25 07:18:43 EDT 2010
Author: rashadkm
Date: 2010-04-25 07:18:42 -0400 (Sun, 25 Apr 2010)
New Revision: 42030
Modified:
grass-addons/gui/wxpython/data_catalog/LayerTree.py
grass-addons/gui/wxpython/data_catalog/catalog.py
Log:
added report and info
Modified: grass-addons/gui/wxpython/data_catalog/LayerTree.py
===================================================================
--- grass-addons/gui/wxpython/data_catalog/LayerTree.py 2010-04-25 10:45:29 UTC (rev 42029)
+++ grass-addons/gui/wxpython/data_catalog/LayerTree.py 2010-04-25 11:18:42 UTC (rev 42030)
@@ -78,6 +78,8 @@
self.ID_COPY = wx.NewId()
self.ID_DEL = wx.NewId()
self.ID_OSSIM = wx.NewId()
+ self.ID_INFO = wx.NewId()
+ self.ID_REPORT = wx.NewId()
acel = wx.AcceleratorTable([
(wx.ACCEL_CTRL, ord('R'), self.ID_REN ) ,
@@ -92,10 +94,9 @@
self.layer = []
self.maplayer = None
+
d = self.GetParent()
notebook = d.GetParent()
-
-
child=notebook.GetChildren()
for panel in child:
if panel.GetName() == "pg_panel":
@@ -115,10 +116,51 @@
self.Bind(wx.EVT_MENU,self.OnRename,id=self.ID_REN)
self.Bind(wx.EVT_MENU,self.OnDelete,id=self.ID_DEL)
self.Bind(wx.EVT_MENU,self.OnOssim,id=self.ID_OSSIM)
+ self.Bind(wx.EVT_MENU,self.OnInfo,id=self.ID_INFO)
+ self.Bind(wx.EVT_MENU,self.OnReport,id=self.ID_REPORT)
+
+ def OnInfo(self,event):
+ item = self.GetSelection()
+ parent = self.GetItemParent(item)
+ pText = self.GetItemText(parent)
+ leftpanel=self.GetParent()
+ notebook = leftpanel.GetParent()
+ frame = notebook.GetParent()
+ if not self.ItemHasChildren(item):
+ self.mapname = self.GetItemText(item) + "@" + frame.cmbMapset.GetValue()
+ if pText == "Raster Map" :
+ command = ["r.info", 'map=' + self.mapname]
+ frame.goutput.RunCmd(command)
+ if pText == "Vector Map" :
+ command = ["v.info", 'map=' + self.mapname]
+ frame.goutput.RunCmd(command)
+
+ def OnReport(self,event):
+
+ item = self.GetSelection()
+ parent = self.GetItemParent(item)
+ pText = self.GetItemText(parent)
+
+ leftpanel=self.GetParent()
+ notebook = leftpanel.GetParent()
+ frame = notebook.GetParent()
+
+ if not self.ItemHasChildren(item):
+ self.mapname = self.GetItemText(item) + "@" + frame.cmbMapset.GetValue()
+
+ if pText == "Raster Map" :
+ command = ["r.report", 'map=' + self.mapname]
+ frame.goutput.RunCmd(command)
+ if pText == "Vector Map" :
+ command = ["v.report", 'map=' + self.mapname]
+ frame.goutput.RunCmd(command)
+
+
+
def OnLayerChecked(self, event):
"""!Enable/disable data layer"""
@@ -268,6 +310,8 @@
mnuRename = self.popupmenu.Append(self.ID_REN,'&Rename\tCtrl-R')
mnuDel = self.popupmenu.Append(self.ID_DEL,'&Delete\tDEL')
mnuOssim = self.popupmenu.Append(self.ID_OSSIM,'&send to OssimPlanet')
+ mnuInfo = self.popupmenu.Append(self.ID_INFO,'&Info')
+ mnuReport = self.popupmenu.Append(self.ID_REPORT,'&Report')
self.PopupMenu(self.popupmenu)
Modified: grass-addons/gui/wxpython/data_catalog/catalog.py
===================================================================
--- grass-addons/gui/wxpython/data_catalog/catalog.py 2010-04-25 10:45:29 UTC (rev 42029)
+++ grass-addons/gui/wxpython/data_catalog/catalog.py 2010-04-25 11:18:42 UTC (rev 42030)
@@ -116,6 +116,7 @@
self.iconsize = (16, 16)
self.baseTitle = title
+ self.parent = parent
wx.Frame.__init__(self, parent, id, title, pos=pos, size=size)
@@ -217,8 +218,7 @@
self.current = self.notebook.GetCurrentPage()
- self.goutput = goutput.GMConsole(self, pageid=1)
- self.goutput.Hide()
+ #self.goutput.Redirect()
# self.ltree = LayerTree(self.pLeft,wx.ID_ANY,gisdbase=self.gisdbase,frame=self.pg_panel)
More information about the grass-commit
mailing list