[GRASS-SVN] r52683 - grass-addons/grass7/gui/wxpython/wx.vnet/vnet

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 16 05:11:11 PDT 2012


Author: turek
Date: 2012-08-16 05:11:11 -0700 (Thu, 16 Aug 2012)
New Revision: 52683

Modified:
   grass-addons/grass7/gui/wxpython/wx.vnet/vnet/dialogs.py
Log:
vnet: Bugs fixing

Modified: grass-addons/grass7/gui/wxpython/wx.vnet/vnet/dialogs.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.vnet/vnet/dialogs.py	2012-08-16 11:23:29 UTC (rev 52682)
+++ grass-addons/grass7/gui/wxpython/wx.vnet/vnet/dialogs.py	2012-08-16 12:11:11 UTC (rev 52683)
@@ -431,23 +431,22 @@
 
         self.inpDbMgrData = {}
         self.inpDbMgrData['dbMgr'] = DbMgrBase()
-        
+ 
+        selMapName = None       
         # if selected vector map in layer tree then set it
         if self.mapWin.tree and self.mapWin.tree.layer_selected:
             selMapData = self.mapWin.tree.GetPyData(self.mapWin.tree.layer_selected)[0]
             if selMapData['type'] == 'vector': # wrap somehow in LayerTree
                 selMapName = selMapData['maplayer'].name
-            else:
-                selMapName = None
 
-            self.inpDbMgrData['browse'] = self.inpDbMgrData['dbMgr'].CreateDbMgrPage(parent = self.notebook,
-                                                                                     pageName = 'browse')
-            self.inpDbMgrData['browse'].SetTabAreaColour(globalvar.FNPageColor)
+        self.inpDbMgrData['browse'] = self.inpDbMgrData['dbMgr'].CreateDbMgrPage(parent = self.notebook,
+                                                                                 pageName = 'browse')
+        self.inpDbMgrData['browse'].SetTabAreaColour(globalvar.FNPageColor)
 
-            self.inpDbMgrData['input'] = None
-            if selMapName:
-                self.inputData['input'].SetValue(selMapName)
-                self.OnVectSel(None)
+        self.inpDbMgrData['input'] = None
+        if selMapName:
+            self.inputData['input'].SetValue(selMapName)
+            self.OnVectSel(None)
 
     def _updateInputDbMgrPage(self, show):
 
@@ -573,7 +572,8 @@
         if itemsLen < 1:
             if self.mapWin.tree:
                 self.addToTreeBtn.Disable()
-            self._updateInputDbMgrPage(show = False)
+            if hasattr(self, 'inpDbMgrData'):
+                self._updateInputDbMgrPage(show = False)
             self.inputData['alayer'].SetValue("")
             self.inputData['nlayer'].SetValue("")
             for sel in ['afcolumn', 'abcolumn', 'ncolumn']:
@@ -806,16 +806,18 @@
         res = max(self.mapWin.Map.region['nsres'], self.mapWin.Map.region['ewres'])
         snapTreshDist = snapTreshPix * res
 
-        inpMapExists = grass.find_file(name = self.inputData['input'].GetValue(), 
+        vectorMap = self.inputData['input'].GetValue()
+        vectMapName, mapSet = self._parseMapStr(vectorMap)
+        inpMapExists = grass.find_file(name = vectMapName, 
                                        element = 'vector', 
-                                       mapset = grass.gisenv()['MAPSET'])
+                                       mapset = mapSet)
         if not inpMapExists['name']:
             return False
 
         openedMap = pointer(vectlib.Map_info())
         ret = vectlib.Vect_open_old2(openedMap, 
-                                     c_char_p(self.inputData['input'].GetValue()),
-                                     c_char_p(grass.gisenv()['MAPSET']),
+                                     c_char_p(vectMapName),
+                                     c_char_p(mapSet),
                                      c_char_p(self.inputData['alayer'].GetValue()))
         if ret == 1:
             vectlib.Vect_close(openedMap)



More information about the grass-commit mailing list