<div dir="ltr">Hi,<div><br></div><div>nice work, can I do some changes (mostly style) or you don't want me to mess it now to avoid conflicts?</div><div><br></div><div>Anna<br><div class="gmail_extra"><br><br><div class="gmail_quote">
On Sat, Jun 28, 2014 at 12:46 PM, <span dir="ltr"><<a href="mailto:svn_grass@osgeo.org" target="_blank">svn_grass@osgeo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: martinl<br>
Date: 2014-06-28 09:46:15 -0700 (Sat, 28 Jun 2014)<br>
New Revision: 61032<br>
<br>
Added:<br>
grass/trunk/gui/wxpython/lmgr/datacatalog.py<br>
Modified:<br>
grass/trunk/gui/wxpython/lmgr/__init__.py<br>
grass/trunk/gui/wxpython/lmgr/frame.py<br>
Log:<br>
wxGUI: first experimental prototype of Data Catalog in Layer Manager (author: Tereza Fiedlerova)<br>
<br>
Modified: grass/trunk/gui/wxpython/lmgr/__init__.py<br>
===================================================================<br>
--- grass/trunk/gui/wxpython/lmgr/__init__.py 2014-06-28 16:26:15 UTC (rev 61031)<br>
+++ grass/trunk/gui/wxpython/lmgr/__init__.py 2014-06-28 16:46:15 UTC (rev 61032)<br>
@@ -5,4 +5,5 @@<br>
'pyshell',<br>
'frame',<br>
'giface',<br>
+ 'datacatalog'<br>
]<br>
<br>
Added: grass/trunk/gui/wxpython/lmgr/datacatalog.py<br>
===================================================================<br>
--- grass/trunk/gui/wxpython/lmgr/datacatalog.py (rev 0)<br>
+++ grass/trunk/gui/wxpython/lmgr/datacatalog.py 2014-06-28 16:46:15 UTC (rev 61032)<br>
@@ -0,0 +1,477 @@<br>
+"""<br>
+@package lmgr::datacatalog<br>
+<br>
+@brief Data catalog<br>
+<br>
+Classes:<br>
+ - datacatalog::DataCatalog<br>
+ - datacatalog::DataCatalogTree<br>
+<br>
+(C) 2014 by Tereza Fiedlerova, and the GRASS Development Team<br>
+<br>
+This program is free software under the GNU General Public<br>
+License (>=v2). Read the file COPYING that comes with GRASS<br>
+for details.<br>
+<br>
+@author Tereza Fiedlerova<br>
+"""<br>
+<br>
+import os<br>
+import sys<br>
+<br>
+import wx<br>
+<br>
+from core.gcmd import RunCommand, GError, GMessage<br>
+from core.utils import GetListOfLocations<br>
+from core.gthread import gThread<br>
+from core.debug import Debug<br>
+from gui_core.dialogs import TextEntryDialog<br>
+<br>
+from grass.pydispatch.signal import Signal<br>
+<br>
+import grass.script as grass<br>
+<br>
+class DataCatalog(wx.Panel):<br>
+ """Data catalog panel"""<br>
+ def __init__(self, parent, giface=None, id = wx.ID_ANY, title=_("Data catalog"),<br>
+ name='catalog', **kwargs):<br>
+ """Panel constructor """<br>
+ self.showNotification = Signal('DataCatalog.showNotification')<br>
+ self.parent = parent<br>
+ self.baseTitle = title<br>
+ wx.Panel.__init__(self, parent = parent, id = id, **kwargs)<br>
+ self.SetName("DataCatalog")<br>
+<br>
+ Debug.msg(1, "DataCatalog.__init__()")<br>
+<br>
+ # tree with layers<br>
+ self.tree = DataCatalogTree(self)<br>
+ self.thread = gThread()<br>
+ self._loaded = False<br>
+ self.tree.showNotification.connect(self.showNotification)<br>
+<br>
+ # some layout<br>
+ self._layout()<br>
+<br>
+ def _layout(self):<br>
+ """Do layout"""<br>
+ sizer = wx.BoxSizer(wx.VERTICAL)<br>
+<br>
+ sizer.Add(item = self.tree.GetControl(), proportion = 1,<br>
+ flag = wx.EXPAND)<br>
+<br>
+ self.SetAutoLayout(True)<br>
+ self.SetSizer(sizer)<br>
+<br>
+ self.Layout()<br>
+<br>
+ def LoadItems(self):<br>
+ if self._loaded:<br>
+ return<br>
+<br>
+ self.thread.Run(callable=self.tree.InitTreeItems,<br>
+ ondone=lambda event: self.LoadItemsDone())<br>
+<br>
+ def LoadItemsDone(self):<br>
+ self._loaded = True<br>
+<br>
+class DataCatalogTree(wx.TreeCtrl):<br>
+ def __init__(self, parent):<br>
+ """Tree constructor."""<br>
+ super(DataCatalogTree, self).__init__(parent, id=wx.ID_ANY, style = wx.TR_HIDE_ROOT | wx.TR_EDIT_LABELS |<br>
+ wx.TR_HAS_BUTTONS | wx.TR_FULL_ROW_HIGHLIGHT | wx.TR_COLUMN_LINES | wx.TR_SINGLE)<br>
+ self.showNotification = Signal('Tree.showNotification')<br>
+ self.parent = parent<br>
+ self.root = self.AddRoot('Catalog') # will not be displayed when we use TR_HIDE_ROOT flag<br>
+<br>
+ self._initVariables()<br>
+ self.MakeBackup()<br>
+<br>
+ wx.EVT_TREE_ITEM_RIGHT_CLICK(self, wx.ID_ANY, self.OnRightClick)<br>
+ wx.EVT_TREE_BEGIN_DRAG(self, wx.ID_ANY, self.OnBeginDrag)<br>
+ wx.EVT_TREE_END_DRAG(self, wx.ID_ANY, self.OnEndDrag)<br>
+<br>
+ self.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)<br>
+ self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)<br>
+ self.Bind(wx.EVT_KEY_UP, self.OnKeyUp)<br>
+<br>
+ wx.EVT_TREE_END_LABEL_EDIT(self, wx.ID_ANY, self.OnEditLabel)<br>
+ wx.EVT_TREE_BEGIN_LABEL_EDIT(self, wx.ID_ANY, self.OnStartEditLabel)<br>
+<br>
+ def _initVariables(self):<br>
+ """Init variables."""<br>
+ self.selected_layer = None<br>
+ self.selected_type = None<br>
+ self.selected_mapset = None<br>
+ self.selected_location = None<br>
+ self.copy_layer = None<br>
+ self.copy_type = None<br>
+ self.copy_mapset = None<br>
+ self.copy_location = None<br>
+ self.gisdbase = grass.gisenv()['GISDBASE']<br>
+ self.ctrldown = False<br>
+<br>
+ def GetControl(self):<br>
+ """Returns control itself."""<br>
+ return self<br>
+<br>
+ def DefineItems(self, item0):<br>
+ """Set selected items."""<br>
+ self.selected_layer = None<br>
+ self.selected_type = None<br>
+ self.selected_mapset = None<br>
+ self.selected_location = None<br>
+ items = []<br>
+ item = item0<br>
+ while (self.GetItemParent(item)):<br>
+ items.insert(0,item)<br>
+ item = self.GetItemParent(item)<br>
+<br>
+ self.selected_location = items[0]<br>
+ length = len(items)<br>
+ if (length > 1):<br>
+ self.selected_mapset = items[1]<br>
+ if (length > 2):<br>
+ self.selected_type = items[2]<br>
+ if (length > 3):<br>
+ self.selected_layer = items[3]<br>
+<br>
+ def InitTreeItems(self):<br>
+ """Add locations, mapsets and layers to the tree."""<br>
+ locations = GetListOfLocations(self.gisdbase)<br>
+ first = True<br>
+ for loc in locations:<br>
+ location = loc<br>
+ if first:<br>
+ self.ChangeEnvironment(location, 'PERMANENT')<br>
+ first = False<br>
+ else:<br>
+ self.ChangeEnvironment(location)<br>
+ varloc = self.AppendItem(self.root, loc)<br>
+ #get list of all maps in location<br>
+ maplist = RunCommand('g.mlist', flags='mt', type='rast,rast3d,vect', mapset='*', quiet=True, read=True)<br>
+ maplist = maplist.splitlines()<br>
+ for ml in maplist:<br>
+ # parse<br>
+ parts1 = ml.split('/')<br>
+ parts2 = parts1[1].split('@')<br>
+ mapset = parts2[1]<br>
+ mlayer = parts2[0]<br>
+ ltype = parts1[0]<br>
+ if self.itemExists(mapset, varloc) == False:<br>
+ varmapset = self.AppendItem(varloc, mapset)<br>
+ if (self.GetItemText(varmapset) == mapset):<br>
+ if (self.itemExists(ltype, varmapset) == False):<br>
+ vartype = self.AppendItem(varmapset, ltype)<br>
+ else:<br>
+ varmapset = self.getItemByName(mapset, varloc)<br>
+ if (self.itemExists(ltype, varmapset) == False):<br>
+ vartype = self.AppendItem(varmapset, ltype)<br>
+ self.AppendItem(vartype, mlayer)<br>
+ self.RestoreBackup()<br>
+ Debug.msg(1, "Tree filled")<br>
+<br>
+ def getItemByName(self, match, root):<br>
+ """Return match item from the root."""<br>
+ item, cookie = self.GetFirstChild(root)<br>
+ while item.IsOk():<br>
+ if self.GetItemText(item) == match:<br>
+ return item<br>
+ item, cookie = self.GetNextChild(root, cookie)<br>
+ return None<br>
+<br>
+ def itemExists(self, match, root):<br>
+ """Return true if match item exists in the root item."""<br>
+ item, cookie = self.GetFirstChild(root)<br>
+ while item.IsOk():<br>
+ if self.GetItemText(item) == match:<br>
+ return True<br>
+ item, cookie = self.GetNextChild(root, cookie)<br>
+ return False<br>
+<br>
+ def UpdateTree(self):<br>
+ """Update whole tree."""<br>
+ self.DeleteAllItems()<br>
+ self.root = self.AddRoot('Tree')<br>
+ self.AddTreeItems()<br>
+ label = "Tree updated."<br>
+ self.showNotification.emit(message=label)<br>
+<br>
+ def OnSelChanged(self, event):<br>
+ self.selected_layer = None<br>
+<br>
+ def OnRightClick(self, event):<br>
+ """Display popup menu."""<br>
+ self.DefineItems(event.GetItem())<br>
+ if(self.selected_layer):<br>
+ self._popupMenuLayer()<br>
+ elif(self.selected_mapset and self.selected_type==None):<br>
+ self._popupMenuMapset()<br>
+<br>
+ def OnDoubleClick(self, event):<br>
+ """Rename layer"""<br>
+ Debug.msg(1, "Double CLICK")<br>
+<br>
+ def OnCopy(self, event):<br>
+ """Copy layer or mapset (just save it temporarily, copying is done by paste)"""<br>
+ self.copy_layer = self.selected_layer<br>
+ self.copy_type = self.selected_type<br>
+ self.copy_mapset = self.selected_mapset<br>
+ self.copy_location = self.selected_location<br>
+ label = "Layer "+self.GetItemText(self.copy_layer)+" copied to clipboard. You can paste it to selected mapset."<br>
+ self.showNotification.emit(message=label)<br>
+<br>
+ def OnRename(self, event):<br>
+ """Rename levent with dialog"""<br>
+ if (self.selected_layer):<br>
+ self.old_name = self.GetItemText(self.selected_layer)<br>
+ self._textDialog(_('New name'), _('Rename map'), self.old_name)<br>
+ self.rename()<br>
+<br>
+ def OnStartEditLabel(self, event):<br>
+ """Start label editing"""<br>
+ item = event.GetItem()<br>
+ self.DefineItems(item)<br>
+ Debug.msg(1, "Start label edit "+self.GetItemText(item))<br>
+ label = _("Editing") + " " + self.GetItemText(item)<br>
+ self.showNotification.emit(message=label)<br>
+ if (self.selected_layer == None):<br>
+ event.Veto()<br>
+<br>
+ def OnEditLabel(self, event):<br>
+ """End label editing"""<br>
+ if (self.selected_layer):<br>
+ item = event.GetItem()<br>
+ self.old_name = self.GetItemText(item)<br>
+ Debug.msg(1, "End label edit "+self.old_name)<br>
+ wx.CallAfter(self.afterEdit, self, item)<br>
+<br>
+ def afterEdit(pro, self, item):<br>
+ self.new_name = self.GetItemText(item)<br>
+ self.rename()<br>
+<br>
+ def rename(self):<br>
+ """Rename layer"""<br>
+ if (self.selected_layer):<br>
+ string = self.old_name+','+self.new_name<br>
+ self.ChangeEnvironment(self.GetItemText(self.selected_location), self.GetItemText(self.selected_mapset))<br>
+ renamed = 0<br>
+ label = _("Renaming") + " " + string + " ..."<br>
+ self.showNotification.emit(message=label)<br>
+ if (self.GetItemText(self.selected_type)=='vect'):<br>
+ renamed = RunCommand('g.rename', vect=string)<br>
+ elif (self.GetItemText(self.selected_type)=='rast'):<br>
+ renamed = RunCommand('g.rename', rast=string)<br>
+ else:<br>
+ renamed = RunCommand('g.rename', rast3d=string)<br>
+ if (renamed==0):<br>
+ self.SetItemText(self.selected_layer,self.new_name)<br>
+ label = "g.rename "+self.GetItemText(self.selected_type)+"="+string+" -- completed"<br>
+ self.showNotification.emit(message=label)<br>
+ Debug.msg(1,"LAYER RENAMED TO: "+self.new_name)<br>
+ self.RestoreBackup()<br>
+<br>
+ def OnPaste(self, event):<br>
+ """Paste layer or mapset"""<br>
+ # copying between mapsets of one location<br>
+ if (self.copy_layer == None):<br>
+ return<br>
+ if (self.selected_location == self.copy_location and self.selected_mapset):<br>
+ if (self.selected_type != None):<br>
+ if (self.GetItemText(self.copy_type) != self.GetItemText(self.selected_type)): # copy raster to vector or vice versa<br>
+ GError(_("Failed to copy layer: invalid type."), parent = self)<br>
+ return<br>
+ self._textDialog(_('New name'), _('Copy map'), self.GetItemText(self.copy_layer)+'_copy')<br>
+ if (self.GetItemText(self.copy_layer) == self.new_name):<br>
+ GMessage(_("Layer was not copied: new layer has the same name"), parent=self)<br>
+ return<br>
+ string = self.GetItemText(self.copy_layer)+'@'+self.GetItemText(self.copy_mapset)+','+self.new_name<br>
+ self.ChangeEnvironment(self.GetItemText(self.selected_location), self.GetItemText(self.selected_mapset))<br>
+ pasted = 0<br>
+ type = None<br>
+ label = _("Copying") + " " + string + " ..."<br>
+ self.showNotification.emit(message=label)<br>
+ if (self.GetItemText(self.copy_type)=='vect'):<br>
+ pasted = RunCommand('g.copy', vect=string)<br>
+ node = 'vect'<br>
+ elif (self.GetItemText(self.copy_type)=='rast'):<br>
+ pasted = RunCommand('g.copy', rast=string)<br>
+ node = 'rast'<br>
+ else:<br>
+ pasted = RunCommand('g.copy', rast3d=string)<br>
+ node = 'rast3d'<br>
+ if (pasted==0):<br>
+ if (self.selected_type == None):<br>
+ self.selected_type = self.getItemByName(node, self.selected_mapset)<br>
+ self.AppendItem(self.selected_type,self.new_name)<br>
+ self.SortChildren(self.selected_type)<br>
+ Debug.msg(1,"COPIED TO: "+self.new_name)<br>
+ label = "g.copy "+self.GetItemText(self.copy_type)+"="+string+" -- completed" # generate this message (command) automatically?<br>
+ self.showNotification.emit(message=label)<br>
+ else:<br>
+ GError(_("Failed to copy layer: action is allowed only within the same location."),<br>
+ parent=self)<br>
+<br>
+ self.RestoreBackup()<br>
+<br>
+<br>
+ def OnDelete(self, event):<br>
+ """Delete layer or mapset"""<br>
+ if (self.selected_layer):<br>
+ string = self.GetItemText(self.selected_layer)<br>
+ self.ChangeEnvironment(self.GetItemText(self.selected_location), self.GetItemText(self.selected_mapset))<br>
+ removed = 0<br>
+ if (self._confirmDialog(_('Do you really want to delete layer') +string+'?', _('Delete map')) == wx.ID_YES):<br>
+ label = _("Deleting") + " " + string + " ..."<br>
+ self.showNotification.emit(message=label)<br>
+ if (self.GetItemText(self.selected_type)=='vect'):<br>
+ removed = RunCommand('g.remove', vect=string)<br>
+ elif (self.GetItemText(self.selected_type)=='rast'):<br>
+ removed = RunCommand('g.remove', rast=string)<br>
+ else:<br>
+ removed = RunCommand('g.remove', rast3d=string)<br>
+ if (removed==0):<br>
+ self.Delete(self.selected_layer)<br>
+ Debug.msg(1,"LAYER "+string+" DELETED")<br>
+ label = "g.remove "+self.GetItemText(self.selected_type)+"="+string+" -- completed" # generate this message (command) automatically?<br>
+ self.showNotification.emit(message=label)<br>
+ self.RestoreBackup()<br>
+<br>
+ def OnDisplayLayer(self, event):<br>
+ """Display layer in current graphics view"""<br>
+ layerName = []<br>
+ if (self.GetItemText(self.selected_location) == self.glocation and self.selected_mapset):<br>
+ string = self.GetItemText(self.selected_layer)+'@'+self.GetItemText(self.selected_mapset)<br>
+ layerName.append(string)<br>
+ label = _("Displaying") + " " + string + " ..."<br>
+ self.showNotification.emit(message=label)<br>
+ label = "d."+self.GetItemText(self.selected_type)+" --q map="+string+" -- completed. Go to Map layers for further operations."<br>
+ if (self.GetItemText(self.selected_type)=='vect'):<br>
+ self.parent.parent.AddMaps(layerName, 'vect', True)<br>
+ elif (self.GetItemText(self.selected_type)=='rast'):<br>
+ self.parent.parent.AddMaps(layerName, 'rast', True)<br>
+ else:<br>
+ self.parent.parent.AddMaps(layerName, 'rast3d', True)<br>
+ label = "d.rast --q map="+string+" -- completed. Go to 'Map layers' for further operations." # generate this message (command) automatically?<br>
+ self.showNotification.emit(message=label)<br>
+ Debug.msg(1,"LAYER "+self.GetItemText(self.selected_layer)+" DISPLAYED")<br>
+ else:<br>
+ GError(_("Failed to display layer: not in current mapset or invalid layer"),<br>
+ parent = self)<br>
+<br>
+ def OnBeginDrag(self, event):<br>
+ """Just copy necessary data"""<br>
+ if (self.ctrldown):<br>
+ #cursor = wx.StockCursor(wx.CURSOR_HAND)<br>
+ #self.SetCursor(cursor)<br>
+ event.Allow()<br>
+ self.DefineItems(event.GetItem())<br>
+ self.OnCopy(event)<br>
+ Debug.msg(1,"DRAG")<br>
+ else:<br>
+ event.Veto()<br>
+ Debug.msg(1,"DRAGGING without ctrl key does nothing")<br>
+<br>
+ def OnEndDrag(self, event):<br>
+ """Copy layer into target"""<br>
+ #cursor = wx.StockCursor(wx.CURSOR_ARROW)<br>
+ #self.SetCursor(cursor)<br>
+ if (event.GetItem()):<br>
+ self.DefineItems(event.GetItem())<br>
+ if (self.selected_location == self.copy_location and self.selected_mapset):<br>
+ event.Allow()<br>
+ self.OnPaste(event)<br>
+ self.ctrldown = False<br>
+ #cursor = wx.StockCursor(wx.CURSOR_DEFAULT)<br>
+ #self.SetCursor(cursor) # TODO: change cursor while dragging and then back, this is not working<br>
+ Debug.msg(1,"DROP DONE")<br>
+ else:<br>
+ event.Veto()<br>
+<br>
+ def OnKeyDown(self, event):<br>
+ """Set key event and check if control key is down"""<br>
+ keycode = event.GetKeyCode()<br>
+ if keycode == wx.WXK_CONTROL:<br>
+ self.ctrldown = True<br>
+ Debug.msg(1,"CONTROL ON")<br>
+<br>
+ def OnKeyUp(self, event):<br>
+ """Check if control key is up"""<br>
+ keycode = event.GetKeyCode()<br>
+ if keycode == wx.WXK_CONTROL:<br>
+ self.ctrldown = False<br>
+ Debug.msg(1,"CONTROL OFF")<br>
+<br>
+ def _textDialog(self, message, title, value):<br>
+ """Dialog for simple text entry"""<br>
+ dlg = TextEntryDialog(self, message, title)<br>
+ dlg.SetValue(value)<br>
+ res = dlg.ShowModal()<br>
+ self.new_name = dlg.GetValue()<br>
+ dlg.Destroy()<br>
+<br>
+ def _confirmDialog(self, question, title):<br>
+ """Confirm dialog"""<br>
+ dlg = wx.MessageDialog(self, question, title, wx.YES_NO)<br>
+ res = dlg.ShowModal()<br>
+ dlg.Destroy()<br>
+ return res<br>
+<br>
+ def _popupMenuLayer(self):<br>
+ """Create popup menu for layers"""<br>
+ menu = wx.Menu()<br>
+<br>
+ item = wx.MenuItem(menu, wx.NewId(), _("&Copy"))<br>
+ menu.AppendItem(item)<br>
+ self.Bind(wx.EVT_MENU, self.OnCopy, item)<br>
+<br>
+ item = wx.MenuItem(menu, wx.NewId(), _("&Paste"))<br>
+ menu.AppendItem(item)<br>
+ self.Bind(wx.EVT_MENU, self.OnPaste, item)<br>
+<br>
+ item = wx.MenuItem(menu, wx.NewId(), _("&Delete"))<br>
+ menu.AppendItem(item)<br>
+ self.Bind(wx.EVT_MENU, self.OnDelete, item)<br>
+<br>
+ item = wx.MenuItem(menu, wx.NewId(), _("&Rename"))<br>
+ menu.AppendItem(item)<br>
+ self.Bind(wx.EVT_MENU, self.OnRename, item)<br>
+<br>
+ item = wx.MenuItem(menu, wx.NewId(), _("&Display layer"))<br>
+ menu.AppendItem(item)<br>
+ self.Bind(wx.EVT_MENU, self.OnDisplayLayer, item)<br>
+<br>
+ self.PopupMenu(menu)<br>
+ menu.Destroy()<br>
+<br>
+ def _popupMenuMapset(self):<br>
+ """Create popup menu for mapsets"""<br>
+ menu = wx.Menu()<br>
+<br>
+ item = wx.MenuItem(menu, wx.NewId(), _("&Paste"))<br>
+ menu.AppendItem(item)<br>
+ self.Bind(wx.EVT_MENU, self.OnPaste, item)<br>
+<br>
+ self.PopupMenu(menu)<br>
+ menu.Destroy()<br>
+<br>
+ def MakeBackup(self):<br>
+ """Make backup for case of change"""<br>
+ self.glocation = grass.gisenv()['LOCATION_NAME']<br>
+ self.gmapset = grass.gisenv()['MAPSET']<br>
+<br>
+ def RestoreBackup(self):<br>
+ """Restore backup"""<br>
+ stringl = 'LOCATION_NAME='+self.glocation<br>
+ RunCommand('g.gisenv', set=stringl)<br>
+ stringm = 'MAPSET='+self.gmapset<br>
+ RunCommand('g.gisenv', set=stringm)<br>
+<br>
+ def ChangeEnvironment(self, location, mapset=None):<br>
+ """Change gisenv variables -> location, mapset"""<br>
+ stringl = 'LOCATION_NAME='+location<br>
+ RunCommand('g.gisenv', set=stringl)<br>
+ if mapset:<br>
+ stringm = 'MAPSET='+mapset<br>
+ RunCommand('g.gisenv', set=stringm)<br>
+<br>
<br>
<br>
Property changes on: grass/trunk/gui/wxpython/lmgr/datacatalog.py<br>
___________________________________________________________________<br>
Added: svn:mime-type<br>
+ text/x-python<br>
Added: svn:eol-style<br>
+ native<br>
<br>
Modified: grass/trunk/gui/wxpython/lmgr/frame.py<br>
===================================================================<br>
--- grass/trunk/gui/wxpython/lmgr/frame.py 2014-06-28 16:26:15 UTC (rev 61031)<br>
+++ grass/trunk/gui/wxpython/lmgr/frame.py 2014-06-28 16:46:15 UTC (rev 61032)<br>
@@ -70,6 +70,7 @@<br>
from lmgr.toolbars import LMMiscToolbar, LMVectorToolbar, LMNvizToolbar<br>
from lmgr.pyshell import PyShellWindow<br>
from lmgr.giface import LayerManagerGrassInterface<br>
+from lmgr.datacatalog import DataCatalog<br>
from gui_core.forms import GUI<br>
from gcp.manager import GCPWizard<br>
from nviz.main import haveNviz<br>
@@ -317,6 +318,11 @@<br>
else:<br>
self.search = None<br>
<br>
+ # create 'data catalog' notebook page<br>
+ self.datacatalog = DataCatalog(parent = self, giface = self._giface)<br>
+ self.datacatalog.showNotification.connect(lambda message: self.SetStatusText(message))<br>
+ self.notebook.AddPage(page = self.datacatalog, text = _("Data catalog"), name = 'catalog')<br>
+<br>
# create 'python shell' notebook page<br>
if not UserSettings.Get(group = 'manager', key = 'hideTabs', subkey = 'pyshell'):<br>
self.pyshell = PyShellWindow(parent = self)<br>
@@ -544,6 +550,8 @@<br>
page = event.GetSelection()<br>
if page == self.notebook.GetPageIndexByName('output'):<br>
wx.CallAfter(self.goutput.ResetFocus)<br>
+ elif page == self.notebook.GetPageIndexByName('catalog'):<br>
+ wx.CallAfter(self.datacatalog.LoadItems)<br>
self.SetStatusText('', 0)<br>
<br>
event.Skip()<br>
<br>
_______________________________________________<br>
grass-commit mailing list<br>
<a href="mailto:grass-commit@lists.osgeo.org">grass-commit@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-commit" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-commit</a><br>
</blockquote></div><br></div></div></div>