[GRASS-SVN] r52432 - grass-addons/grass7/gui/wxpython/wx.vnet/vnet
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jul 20 19:18:04 PDT 2012
Author: turek
Date: 2012-07-20 19:18:03 -0700 (Fri, 20 Jul 2012)
New Revision: 52432
Modified:
grass-addons/grass7/gui/wxpython/wx.vnet/vnet/dialogs.py
grass-addons/grass7/gui/wxpython/wx.vnet/vnet/toolbars.py
grass-addons/grass7/gui/wxpython/wx.vnet/vnet/widgets.py
Log:
Structure changes in code, bugs fixing
Modified: grass-addons/grass7/gui/wxpython/wx.vnet/vnet/dialogs.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.vnet/vnet/dialogs.py 2012-07-20 22:20:28 UTC (rev 52431)
+++ grass-addons/grass7/gui/wxpython/wx.vnet/vnet/dialogs.py 2012-07-21 02:18:03 UTC (rev 52432)
@@ -7,7 +7,8 @@
- dialogs::VNETDialog
- dialogs::PtsList
- dialogs::SettingsDialog
- - dialogs::AddLayerDialog
+ - dialogs::VnetTmpVectMaps
+ - dialogs::VnetTmpVectMap
(C) 2012 by the GRASS Development Team
@@ -44,6 +45,9 @@
from vnet.widgets import PointsList
from vnet.toolbars import MainToolbar, PointListToolbar
+#TODOs:
+# itemdada mam - not direct access
+
class VNETDialog(wx.Dialog):
def __init__(self, parent,
id = wx.ID_ANY, title = _("Vector network analysis"),
@@ -58,7 +62,7 @@
self.cmdParams = {}
self.tmp_result = "vnet_tmp_result"
- self.tmpMaps = {}
+ self.tmpMaps = VnetTmpVectMaps(parent = self)
self.firstAnalysis = True
self.hiddenTypeCol = None
@@ -135,18 +139,19 @@
def __del__(self):
"""!Removes temp layer with analysis result, unregisters handlers and graphics"""
+ update = self.tmpMaps.RemoveAllTmpMaps()
+
self.mapWin.UnregisterGraphicsToDraw(self.pointsToDraw)
- for tmpMap in self.tmpMaps.iterkeys():
- RunCommand('g.remove', vect = tmpMap)
-
- if self.tmpResultLayer:
- self.mapWin.UpdateMap(render=True, renderVector=True)
-
if self.handlerRegistered:
self.mapWin.UnregisterMouseEventHandler(wx.EVT_LEFT_DOWN,
self.OnMapClickHandler)
+ if update:
+ self.mapWin.UpdateMap(render=True, renderVector=True)
+ else:
+ self.mapWin.UpdateMap(render=False, renderVector=False)
+
def _addPanes(self):
self._mgr.AddPane(self.toolbars['mainToolbar'],
@@ -400,7 +405,7 @@
def SetPointStatus(self, item, itemIndex):
"""!Before point is drawn, decides properties of drawing style"""
key = self.list.GetItemData(itemIndex)
- point = self.list.itemDataMap[key]
+ point = self.list.itemDataMap[key] #TODO public method in list?
cats = self.vnetParams[self.currAnModule]["cmdParams"]["cats"]
@@ -430,6 +435,8 @@
self.handlerRegistered = False
return
+ self.notebook.SetSelectionByName("points")
+
if not self.list.itemDataMap:
self.list.AddItem(None)
@@ -507,18 +514,18 @@
return
if self.firstAnalysis:
- self.tmp_result = self.TmpMap(self.tmp_result)
+ self.tmp_result = self.tmpMaps.AddTmpVectMap(self.tmp_result)
if not self.tmp_result:
- return
+ return
self.firstAnalysis = False
else:
- if not self.VectLayerState(mapName = self.tmp_result, layer = 1):
+ if not self.tmp_result.VectLayerState(layer = 1):
return
# Creates part of cmd fro analysis
cmdParams = [self.currAnModule]
cmdParams.extend(self._getInputParams())
- cmdParams.append("output=" + self.tmp_result)
+ cmdParams.append("output=" + self.tmp_result.GetVectMapName())
catPts = self._getPtByCat()
@@ -551,7 +558,7 @@
inpPoints = str(resId) + " " + str(cmdPts[0][0]) + " " + str(cmdPts[0][1]) + \
" " + str(cmdPts[1][0]) + " " + str(cmdPts[1][1])
- self.coordsTmpFile = grass.tempfile()#TODO stdin
+ self.coordsTmpFile = grass.tempfile()
coordsTmpFileOpened = open(self.coordsTmpFile, 'w')
coordsTmpFileOpened.write(inpPoints)
coordsTmpFileOpened.close()
@@ -572,10 +579,13 @@
def _vnetPathRunAnDone(self, cmd, returncode):
+
grass.try_remove(self.coordsTmpFile)
- self.SaveVectLayerState(mapName = self.tmp_result, layer = 1)
- self._addTempLayer()
+ self.tmp_result.SaveVectLayerState(layer = 1)
+ self.tmp_result.AddRenderLayer()
+ self.mapWin.UpdateMap(render=True, renderVector=True)
+
def _runAn(self, cmdParams, catPts):
# TODO how to get output in ondone function
@@ -608,33 +618,31 @@
tmpPtsAsciiFileOpened.write(pt_ascii)
tmpPtsAsciiFileOpened.close()
- self.tmpInPts = self.TmpMap("vnet_tmp_in_pts")
+ self.tmpInPts = self.tmpMaps.AddTmpVectMap("vnet_tmp_in_pts")
if not self.tmpInPts:
return
- self.tmpInPtsConnected = self.TmpMap("vnet_tmp_in_pts_connected")
+ self.tmpInPtsConnected = self.tmpMaps.AddTmpVectMap("vnet_tmp_in_pts_connected")
if not self.tmpInPtsConnected:
return
#dmax = int(UserSettings.Get(group = 'vnet',
# key ='analysis_settings',
# subkey ='maxDist'))
- cmdParams.append("input=" + self.tmpInPtsConnected)
+ cmdParams.append("input=" + self.tmpInPtsConnected.GetVectMapName())
cmdParams.append("--overwrite")
- if self.currAnModule == "v.net.distance": #TODO ugly hack
+ if self.currAnModule == "v.net.distance":
cmdParams.append("from_layer=1")
cmdParams.append("to_layer=1")
elif self.currAnModule == "v.net.flow":#TODO
- self.vnetFlowTmpCut = self.TmpMap("vnet_tmp_flow_cut")
+ self.vnetFlowTmpCut = self.tmpMaps.AddTmpVectMap("vnet_tmp_flow_cut")
if not self.vnetFlowTmpCut:
return
- cmdParams.append("cut=" + self.vnetFlowTmpCut)
-
+ cmdParams.append("cut=" + self.vnetFlowTmpCut.GetVectMapName())
elif self.currAnModule == "v.net.iso":
costs = self.anSettings["iso_lines"].GetValue()
cmdParams.append("costs=" + costs)
-
for catName, catNum in catsNums.iteritems():
if catNum[0] == catNum[1]:
cmdParams.append(catName + "=" + str(catNum[0]))
@@ -643,10 +651,10 @@
cmdVEdit = [
"v.edit",
- "map=" + self.tmpInPts,
+ "map=" + self.tmpInPts.GetVectMapName(),
"input=" + self.tmpPtsAsciiFile,
"tool=create",
- "--overwrite", #TODO warning
+ "--overwrite",
"-n"
]
self._prepareCmd(cmdVEdit)
@@ -654,36 +662,35 @@
cmdVNet = [
"v.net",
- "points=" + self.tmpInPts,
+ "points=" + self.tmpInPts.GetVectMapName(),
"input=" + self.inputData["input"].GetValue(),
- "output=" + self.tmpInPtsConnected,
+ "output=" + self.tmpInPtsConnected.GetVectMapName(),
"alayer=" + self.inputData["alayer"].GetValue().strip(),
"nlayer=" + self.inputData["nlayer"].GetValue().strip(),
"operation=connect",
"thresh=" + str(self.anSettings["max_dist"].GetValue()),
- "--overwrite" #TODO warning
+ "--overwrite"
]
self._prepareCmd(cmdVNet)
self.goutput.RunCmd(command = cmdVNet)
self._prepareCmd(cmdParams)
- self.goutput.RunCmd(command = cmdParams, onDone = self.__runAnDone)
+ self.goutput.RunCmd(command = cmdParams, onDone = self._runAnDone)
- def __runAnDone(self, cmd, returncode):
+ def _runAnDone(self, cmd, returncode):
- self.RemoveTmpMap(self.tmpInPts) # remove earlier (ondone lambda?)
- self.RemoveTmpMap(self.tmpInPtsConnected)
- self.RemoveTmpMap(self.tmpInPtsConnected)
+ self.tmpMaps.RemoveTmpMap(self.tmpInPts) # remove earlier (ondone lambda?)
+ self.tmpMaps.RemoveTmpMap(self.tmpInPtsConnected)
try:
- self.RemoveTmpMap(self.vnetFlowTmpCut)
+ self.tmpMaps.RemoveTmpMap(self.vnetFlowTmpCut)
except AttributeError:
pass
grass.try_remove(self.tmpPtsAsciiFile)
- self.SaveVectLayerState(mapName = self.tmp_result, layer = 1)
+ self.tmp_result.SaveVectLayerState(layer = 1)
+ self.tmp_result.AddRenderLayer()
+ self.mapWin.UpdateMap(render=True, renderVector=True)
- self._addTempLayer()
-
def _getInputParams(self):
inParams = []
@@ -696,7 +703,7 @@
inParams.append(col + '=' + self.inputData[colInptF].GetValue())
- for layer in ['alayer', 'nlayer']: #TODO input
+ for layer in ['alayer', 'nlayer']:
inParams.append(layer + "=" + self.inputData[layer].GetValue().strip())
return inParams
@@ -740,7 +747,7 @@
def _prepareCmd(self, cmd):
- for c in cmd[:]:#TODO
+ for c in cmd[:]:
if c.find("=") == -1:
continue
v = c.split("=")
@@ -749,21 +756,6 @@
elif not v[1].strip():
cmd.remove(c)
- def _addTempLayer(self):
-
- cmd = self.GetLayerStyle()
- cmd.append('map=%s' % self.tmp_result)
-
- if self.tmpResultLayer:
- self.mapWin.Map.DeleteLayer(self.tmpResultLayer)
-
- self.tmpResultLayer = self.mapWin.Map.AddLayer(type = "vector", command = cmd,
- l_active=True, name = self.tmp_result,
- l_hidden = False, l_opacity = 1.0,
- l_render = True, pos = 1)
-
- self.mapWin.UpdateMap(render=True, renderVector=True)
-
def GetLayerStyle(self):
resStyle = self.vnetParams[self.currAnModule]["resultStyle"]
@@ -781,7 +773,7 @@
if "attrColColor" in resStyle:
self.layerStyleVnetColors = [
"v.colors",
- "map=" + self.tmp_result,
+ "map=" + self.tmp_result.GetVectMapName(),
"color=byr",#TODO
"column=" + resStyle["attrColColor"],
]
@@ -792,101 +784,18 @@
return layerStyleCmd
- def SaveVectLayerState(self, mapName, layer):
-
- self.tmpMaps[mapName] = {"stateHash" : self.GetLayerHash(mapName = mapName,
- layer = layer)}
-
- def VectLayerState(self, mapName, layer):
+ def OnShowResult(self, event):
+ mainToolbar = self.toolbars['mainToolbar']
+ id = vars(mainToolbar)['showResult']
+ toggleState = mainToolbar.GetToolState(id)
- if self.tmpMaps[mapName]["stateHash"] != self.GetLayerHash(mapName = mapName,
- layer = layer):
- dlg = wx.MessageDialog(parent = self,
- message = _("Layer %d in map %s was changed outside " +
- "of vector network analysis tool. " +
- "Do you want to continue in analysis and " +
- "overwrite it?") % (layer, mapName),
- caption = _("Overwrite map layer"),
- style = wx.YES_NO | wx.NO_DEFAULT |
- wx.ICON_QUESTION | wx.CENTRE)
- ret = dlg.ShowModal()
- dlg.Destroy()
-
- if ret == wx.ID_NO:
- return False
-
- return True
-
- def GetLayerHash(self, mapName, layer):
- info = RunCommand("v.info",
- map = mapName,
- layer = layer,
- read = True)
-
- if hasHashlib:
- m = md5()
+ if toggleState:
+ self.tmp_result.AddRenderLayer()
else:
- m = md5.new()
- m.update(info)
+ self.tmp_result.DeleteRenderLayer()
- return m.digest()
+ self.mapWin.UpdateMap(render=True, renderVector=True)
- def TmpMap(self, mapName):
-
- currMapSet = grass.gisenv()['MAPSET']
- tmpMap = grass.find_file(name = mapName, element = 'vector',
- mapset = currMapSet)
- fullMapName = tmpMap["fullname"]
- if fullMapName:
- dlg = wx.MessageDialog(parent = self,
- message = _("Temporary map %s already exists." +
- "Do you want to continue in analysis and "
- "overwrite it?") % fullMapName,
- caption = _("Overwrite map layer"),
- style = wx.YES_NO | wx.NO_DEFAULT |
- wx.ICON_QUESTION | wx.CENTRE)
-
- ret = dlg.ShowModal()
- dlg.Destroy()
-
- if ret == wx.ID_NO:
- return None
- else:
- fullMapName = mapName + "@" + currMapSet
-
- self.tmpMaps[fullMapName] = {"stateHash" : None}
-
- return fullMapName
-
- def RemoveTmpMap(self, mapName):
-
- RunCommand('g.remove', vect = mapName)
- try:
- del self.tmpMaps[mapName]
- except KeyError:
- pass
-
- def _adaptPointsList(self):
-
- prevParamsCats = self.vnetParams[self.prevAnModule]["cmdParams"]["cats"]
- currParamsCats = self.vnetParams[self.currAnModule]["cmdParams"]["cats"]
-
-
- for key in range(len(self.list.itemDataMap)):
- iCat = 0
- for ptCat in prevParamsCats:
- if self.list.itemDataMap[key][1] == ptCat[1]:
- self.list.EditCellKey(key, 1, currParamsCats[iCat][1])
- iCat += 1
-
- colValues = [""]
- for ptCat in currParamsCats:
- colValues.append(ptCat[1])
-
- self.list.ChangeColType(1, colValues)
-
- self.prevAnModule = self.currAnModule
-
def OnInsertPoint(self, event):
if self.handlerRegistered == False:
self.mapWin.RegisterMouseEventHandler(wx.EVT_LEFT_DOWN,
@@ -900,20 +809,35 @@
def OnSaveTmpLayer(self, event):
- dlg = AddLayerDialog(parent = self)
+ dlg = AddLayerDialog(parent = self)#TODO impot location check?
if dlg.ShowModal() == wx.ID_OK:
- ret, std, msg = RunCommand("g.rename",
- overwrite = dlg.overwrite.GetValue(),
- vect = [self.tmp_result, dlg.vectSel.GetValue()])
+ addedMap = dlg.vectSel.GetValue()
+ existsMap = grass.find_file(name = addedMap,
+ element = 'vector',
+ mapset = grass.gisenv()['MAPSET'])
- if self.mapWin.tree.FindItemByData(key = 'name', value = dlg.vectSel.GetValue()) is None:
+ if existsMap["name"] and not dlg.overwrite.GetValue():
+ GMessage(parent = self,
+ message = _("Map already exists. Result will not be added."))
+ return
+
+ RunCommand("g.copy",
+ overwrite = True,
+ vect = [self.tmp_result.GetVectMapName(), addedMap])
+
+ cmd = self.GetLayerStyle()
+ cmd.append('map=%s' % addedMap)
+ if self.mapWin.tree.FindItemByData(key = 'name', value = addedMap) is None: #TODO check if has tree
self.mapWin.tree.AddLayer(ltype = "vector",
- lname = dlg.vectSel.GetValue(),
- lcmd = self.layerStyleCmd,
+ lname =addedMap,
+ lcmd = cmd,
lchecked = True)
+ self.mapWin.UpdateMap(render=True, renderVector=True)
+
+
def OnSettings(self, event):
"""!Displays vnet settings dialog"""
dlg = SettingsDialog(parent=self, id=wx.ID_ANY, title=_('Settings'))
@@ -968,7 +892,13 @@
if self.hiddenTypeCol:
self.list.InsertColumnItem(1, self.hiddenTypeCol)
self.list.ResizeColumns()
- self._adaptPointsList()
+
+ prevParamsCats = self.vnetParams[self.prev2catsAnModule]["cmdParams"]["cats"]
+ currParamsCats = self.vnetParams[self.currAnModule]["cmdParams"]["cats"]
+
+ self.list._adaptPointsList(currParamsCats, prevParamsCats)
+ self.prev2catsAnModule = self.currAnModule
+
self.hiddenTypeCol = None
else:
if self.hiddenTypeCol is None:
@@ -1103,7 +1033,7 @@
"v.net.steiner"
] # order in the choice of analysis
self.currAnModule = self.vnetModulesOrder[0]
- self.prevAnModule = self.vnetModulesOrder[0]
+ self.prev2catsAnModule = self.vnetModulesOrder[0]
def _initSettings(self):
@@ -1199,16 +1129,32 @@
PointsList.OnItemSelected(self, event)
self.dialog.mapWin.UpdateMap(render=False, renderVector=False)
- self.dialog._getPtByCat()
event.Skip()
+ def _adaptPointsList(self, currParamsCats, prevParamsCats):
+
+ for item in enumerate(self.itemDataMap):
+ iCat = 0
+ for ptCat in prevParamsCats:
+ if self.itemDataMap[item[0]][1] == ptCat[1]:
+ self.EditCellKey(item[0], 1, currParamsCats[iCat][1])
+ iCat += 1
+ if not item[1][1]:
+ self.CheckItem(item[0], False)
+
+ colValues = [""]
+ for ptCat in currParamsCats:
+ colValues.append(ptCat[1])
+
+ self.ChangeColType(1, colValues)
+
def OnCheckItem(self, index, flag):
"""!Item is checked/unchecked"""
key = self.GetItemData(index)
checkedVal = self.itemDataMap[key][1]
- currModule = self.dialog.currAnModule
+ currModule = self.dialog.currAnModule #TODO public func
cats = self.dialog.vnetParams[currModule]["cmdParams"]["cats"]
if len(cats) <= 1:
@@ -1384,10 +1330,9 @@
self.parent.SetPointDrawSettings()
- if self.parent.tmpResultLayer:
- cmd = self.parent.GetLayerStyle()
- cmd.append('map=%s' % self.parent.tmp_result)
- self.parent.tmpResultLayer.SetCmd(cmd)
+ renderLayer = self.parent.tmp_result.GetRenderLayer()
+ if renderLayer:
+ self.parent.tmp_result.AddRenderLayer()
self.parent.mapWin.UpdateMap(render=True, renderVector=True)#TODO optimization
else:
self.parent.mapWin.UpdateMap(render=False, renderVector=False)
@@ -1467,8 +1412,153 @@
self.panel.SetSizer(sizer)
sizer.Fit(self)
+class VnetTmpVectMaps:
+ def __init__(self, parent):
+
+ self.tmpMaps = []
+ self.parent = parent
+ self.mapWin = self.parent.mapWin
+
+ def AddTmpVectMap(self, mapName):
+
+ currMapSet = grass.gisenv()['MAPSET']
+ tmpMap = grass.find_file(name = mapName,
+ element = 'vector',
+ mapset = currMapSet)
+
+ fullName = tmpMap["fullname"]
+ if fullName:
+ dlg = wx.MessageDialog(parent = self.parent,
+ message = _("Temporary map %s already exists." +
+ "Do you want to continue in analysis and "
+ "overwrite it?") % fullName,
+ caption = _("Overwrite map layer"),
+ style = wx.YES_NO | wx.NO_DEFAULT |
+ wx.ICON_QUESTION | wx.CENTRE)
+
+ ret = dlg.ShowModal()
+ dlg.Destroy()
+
+ if ret == wx.ID_NO:
+ return None
+ else:
+ fullName = mapName + "@" + currMapSet
+
+ newVectMap = VnetTmpVectMap(self, fullName)
+ self.tmpMaps.append(newVectMap)
+
+ return newVectMap
+
+ def RemoveTmpMap(self, vectMap):
+
+ RunCommand('g.remove',
+ vect = vectMap.GetVectMapName())
+ try:
+ self.tmpMaps.remove(vectMap)
+ return True
+ except ValueError:
+ return False
+
+ def RemoveAllTmpMaps(self):
+
+ update = False
+ for tmpMap in self.tmpMaps:
+ RunCommand('g.remove',
+ vect = tmpMap.GetVectMapName())
+ if tmpMap.DeleteRenderLayer():
+ update = True
+ return update
+
+class VnetTmpVectMap:
+
+ def __init__(self, parent, fullName):
+
+ self.fullName = fullName
+ self.parent = parent
+ self.renderLayer = None
+ self.layersHash = {}
+
+ def __del__(self):
+
+ self.DeleteRenderLayer()
+
+ def AddRenderLayer(self):
+
+ existsMap = grass.find_file(name = self.fullName,
+ element = 'vector',
+ mapset = grass.gisenv()['MAPSET'])
+
+ if not existsMap["name"]:
+ self.DeleteRenderLayer()
+ return False
+
+ cmd = self.parent.parent.GetLayerStyle()
+ cmd.append('map=%s' % self.fullName)
+
+ if self.renderLayer:
+ self.DeleteRenderLayer()
+
+ self.renderLayer = self.parent.mapWin.Map.AddLayer(type = "vector", command = cmd,
+ l_active=True, name = self.fullName,
+ l_hidden = True, l_opacity = 1.0,
+ l_render = True, pos = -1)
+ return True
+
+ def DeleteRenderLayer(self):
+ if self.renderLayer:
+ self.parent.mapWin.Map.DeleteLayer(self.renderLayer)
+ self.renderLayer = None
+ return True
+ return False
+
+ def GetRenderLayer(self):
+ return self.renderLayer
+
+ def GetVectMapName(self):
+ return self.fullName
+
+ def SaveVectLayerState(self, layer):
+
+ self.layersHash[layer] = self._getLayerHash(layer = layer)
+
+ def VectLayerState(self, layer):
+
+ if self.layersHash[layer] != self._getLayerHash(layer = layer):
+ dlg = wx.MessageDialog(parent = self.parent.parent,
+ message = _("Layer %d in map %s was changed outside " +
+ "of vector network analysis tool. " +
+ "Do you want to continue in analysis and " +
+ "overwrite it?") % (layer, self.fullName),
+ caption = _("Overwrite map layer"),
+ style = wx.YES_NO | wx.NO_DEFAULT |
+ wx.ICON_QUESTION | wx.CENTRE)
+ ret = dlg.ShowModal()
+ dlg.Destroy()
+
+ if ret == wx.ID_NO:
+ del self.parent.tmpMaps[self.fullName]
+ return False
+
+ return True
+
+ def _getLayerHash(self, layer):
+ info = RunCommand("v.info",
+ map = self.fullName,
+ layer = layer,
+ read = True)
+
+ if hasHashlib:
+ m = md5()
+ else:
+ m = md5.new()
+ m.update(info)
+
+ return m.digest()
+
#TODO ugly hack - just for GMConsole to be satisfied
class CmdPanelHack:
def createCmd(self, ignoreErrors = False, ignoreRequired = False):
pass
+
+
Modified: grass-addons/grass7/gui/wxpython/wx.vnet/vnet/toolbars.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.vnet/vnet/toolbars.py 2012-07-20 22:20:28 UTC (rev 52431)
+++ grass-addons/grass7/gui/wxpython/wx.vnet/vnet/toolbars.py 2012-07-21 02:18:03 UTC (rev 52432)
@@ -46,7 +46,7 @@
}
return self._getToolbarData((('insertPoint', icons['insertPoint'],
- self.list.dialog.OnInsertPoint,#TODO
+ self.list.dialog.OnInsertPoint,#TODO self.list.dialog
wx.ITEM_CHECK),
('pointAdd', icons["pointAdd"],
self.list.AddItem),
@@ -88,6 +88,8 @@
icons = {
'run' : MetaIcon(img = 'execute',
label = _('Execute analysis')),
+ 'showResult' : MetaIcon(img = 'layer-add',
+ label = _("Show analysis result")),
'saveTempLayer' : MetaIcon(img = 'map-export',
label = _('Add temporary result of analysis into layer tree')),
'settings' : BaseIcons['settings'].SetLabel( _('Vector network analysis settings'))
@@ -96,8 +98,10 @@
return self._getToolbarData((
("run", icons['run'],
self.parent.OnAnalyze),
- #("saveTempLayer", icons['saveTempLayer'],#TODO
- # self.parent.OnSaveTmpLayer),
+ #("showResult", icons['showResult'], TODO
+ #self.parent.OnShowResult, wx.ITEM_CHECK),
+ ("saveTempLayer", icons['saveTempLayer'],
+ self.parent.OnSaveTmpLayer),
('settings', icons["settings"],
self.parent.OnSettings),
("quit", BaseIcons['quit'],
Modified: grass-addons/grass7/gui/wxpython/wx.vnet/vnet/widgets.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.vnet/vnet/widgets.py 2012-07-20 22:20:28 UTC (rev 52431)
+++ grass-addons/grass7/gui/wxpython/wx.vnet/vnet/widgets.py 2012-07-21 02:18:03 UTC (rev 52432)
@@ -271,6 +271,8 @@
self.GetItem(index, i).GetText(), #cell value
self.cols_data["colsEditable"][i]]) #convert function for type check
+ if not data:
+ return
dlg = self.CreateEditDialog(data = data, pointNo = key)
if dlg.ShowModal() == wx.ID_OK:
More information about the grass-commit
mailing list