Skip to content
Permalink
Browse files

more cleanup in fTools menu creating code

  • Loading branch information
alexbruy committed Aug 15, 2012
1 parent cd1a885 commit 79b11896d28bbcc7dada43fcb4a5cd2df627f2ca
Showing with 17 additions and 98 deletions.
  1. +17 −98 python/plugins/fTools/fTools.py
@@ -185,55 +185,15 @@ def initGui(self):
self.dataManageMenu.addActions([self.define, self.spatJoin, self.splitVect, self.mergeShapes, self.spatialIndex])
self.updateThemeIcons("theme")

menuName = QCoreApplication.translate("fTools", "&Analysis Tools")
self.iface.addPluginToVectorMenu(menuName, self.distMatrix)
self.iface.addPluginToVectorMenu(menuName, self.sumLines)
self.iface.addPluginToVectorMenu(menuName, self.pointsPoly)
self.iface.addPluginToVectorMenu(menuName, self.listUnique)
self.iface.addPluginToVectorMenu(menuName, self.compStats)
self.iface.addPluginToVectorMenu(menuName, self.nearestNeigh)
self.iface.addPluginToVectorMenu(menuName, self.meanCoords)
self.iface.addPluginToVectorMenu(menuName, self.intLines)

menuName = QCoreApplication.translate("fTools", "&Research Tools")
self.iface.addPluginToVectorMenu(menuName, self.randSel)
self.iface.addPluginToVectorMenu(menuName, self.randSub)
self.iface.addPluginToVectorMenu(menuName, self.randPoints)
self.iface.addPluginToVectorMenu(menuName, self.regPoints)
self.iface.addPluginToVectorMenu(menuName, self.vectGrid)
self.iface.addPluginToVectorMenu(menuName, self.selectLocation)
self.iface.addPluginToVectorMenu(menuName, self.layerExtent)

menuName = QCoreApplication.translate("fTools", "&Geoprocessing Tools")
self.iface.addPluginToVectorMenu(menuName, self.minConvex)
self.iface.addPluginToVectorMenu(menuName, self.dynaBuffer)
self.iface.addPluginToVectorMenu(menuName, self.intersect)
self.iface.addPluginToVectorMenu(menuName, self.union)
self.iface.addPluginToVectorMenu(menuName, self.symDifference)
self.iface.addPluginToVectorMenu(menuName, self.clip)
self.iface.addPluginToVectorMenu(menuName, self.erase)
self.iface.addPluginToVectorMenu(menuName, self.dissolve)

menuName = QCoreApplication.translate("fTools", "G&eometry Tools")
self.iface.addPluginToVectorMenu(menuName, self.checkGeom)
self.iface.addPluginToVectorMenu(menuName, self.compGeo)
self.iface.addPluginToVectorMenu(menuName, self.centroids)
self.iface.addPluginToVectorMenu(menuName, self.delaunay)
self.iface.addPluginToVectorMenu(menuName, self.voronoi)
self.iface.addPluginToVectorMenu(menuName, self.simplify)
self.iface.addPluginToVectorMenu(menuName, self.densify)
self.iface.addPluginToVectorMenu(menuName, self.multiToSingle)
self.iface.addPluginToVectorMenu(menuName, self.singleToMulti)
self.iface.addPluginToVectorMenu(menuName, self.polysToLines)
self.iface.addPluginToVectorMenu(menuName, self.linesToPolys)
self.iface.addPluginToVectorMenu(menuName, self.extNodes)

menuName = QCoreApplication.translate("fTools", "&Data Management Tools")
self.iface.addPluginToVectorMenu(menuName, self.define)
self.iface.addPluginToVectorMenu(menuName, self.spatJoin)
self.iface.addPluginToVectorMenu(menuName, self.splitVect)
self.iface.addPluginToVectorMenu(menuName, self.mergeShapes)
self.iface.addPluginToVectorMenu(menuName, self.spatialIndex)
self.tmpAct = QAction( self.iface.mainWindow() )
self.iface.addPluginToVectorMenu( "tmp", self.tmpAct )
self.menu = self.iface.vectorMenu()
self.menu.addMenu( self.analysisMenu )
self.menu.addMenu( self.researchMenu )
self.menu.addMenu( self.geoMenu )
self.menu.addMenu( self.conversionMenu )
self.menu.addMenu( self.dataManageMenu )
self.iface.removePluginVectorMenu( "tmp", self.tmpAct )

QObject.connect(self.distMatrix, SIGNAL("triggered()"), self.dodistMatrix)
QObject.connect(self.sumLines, SIGNAL("triggered()"), self.dosumLines)
@@ -281,55 +241,14 @@ def initGui(self):
QObject.connect(self.spatialIndex, SIGNAL("triggered()"), self.doSpatIndex)

def unload(self):
menuName = QCoreApplication.translate("fTools", "&Analysis Tools")
self.iface.removePluginVectorMenu(menuName, self.distMatrix)
self.iface.removePluginVectorMenu(menuName, self.sumLines)
self.iface.removePluginVectorMenu(menuName, self.pointsPoly)
self.iface.removePluginVectorMenu(menuName, self.listUnique)
self.iface.removePluginVectorMenu(menuName, self.compStats)
self.iface.removePluginVectorMenu(menuName, self.nearestNeigh)
self.iface.removePluginVectorMenu(menuName, self.meanCoords)
self.iface.removePluginVectorMenu(menuName, self.intLines)

menuName = QCoreApplication.translate("fTools", "&Research Tools")
self.iface.removePluginVectorMenu(menuName, self.randSel)
self.iface.removePluginVectorMenu(menuName, self.randSub)
self.iface.removePluginVectorMenu(menuName, self.randPoints)
self.iface.removePluginVectorMenu(menuName, self.regPoints)
self.iface.removePluginVectorMenu(menuName, self.vectGrid)
self.iface.removePluginVectorMenu(menuName, self.selectLocation)
self.iface.removePluginVectorMenu(menuName, self.layerExtent)

menuName = QCoreApplication.translate("fTools", "&Geoprocessing Tools")
self.iface.removePluginVectorMenu(menuName, self.minConvex)
self.iface.removePluginVectorMenu(menuName, self.dynaBuffer)
self.iface.removePluginVectorMenu(menuName, self.intersect)
self.iface.removePluginVectorMenu(menuName, self.union)
self.iface.removePluginVectorMenu(menuName, self.symDifference)
self.iface.removePluginVectorMenu(menuName, self.clip)
self.iface.removePluginVectorMenu(menuName, self.erase)
self.iface.removePluginVectorMenu(menuName, self.dissolve)

menuName = QCoreApplication.translate("fTools", "G&eometry Tools")
self.iface.removePluginVectorMenu(menuName, self.checkGeom)
self.iface.removePluginVectorMenu(menuName, self.compGeo)
self.iface.removePluginVectorMenu(menuName, self.centroids)
self.iface.removePluginVectorMenu(menuName, self.delaunay)
self.iface.removePluginVectorMenu(menuName, self.voronoi)
self.iface.removePluginVectorMenu(menuName, self.simplify)
self.iface.removePluginVectorMenu(menuName, self.densify)
self.iface.removePluginVectorMenu(menuName, self.multiToSingle)
self.iface.removePluginVectorMenu(menuName, self.singleToMulti)
self.iface.removePluginVectorMenu(menuName, self.polysToLines)
self.iface.removePluginVectorMenu(menuName, self.linesToPolys)
self.iface.removePluginVectorMenu(menuName, self.extNodes)

menuName = QCoreApplication.translate("fTools", "&Data Management Tools")
self.iface.removePluginVectorMenu(menuName, self.define)
self.iface.removePluginVectorMenu(menuName, self.spatJoin)
self.iface.removePluginVectorMenu(menuName, self.splitVect)
self.iface.removePluginVectorMenu(menuName, self.mergeShapes)
self.iface.removePluginVectorMenu(menuName, self.spatialIndex)
self.iface.addPluginToVectorMenu( "tmp", self.tmpAct )
self.menu.removeAction( self.analysisMenu.menuAction() )
self.menu.removeAction( self.researchMenu.menuAction() )
self.menu.removeAction( self.geoMenu.menuAction() )
self.menu.removeAction( self.conversionMenu.menuAction() )
self.menu.removeAction( self.dataManageMenu.menuAction() )
self.iface.removePluginVectorMenu( "tmp", self.tmpAct )


def doSimplify(self):
d = doSimplify.Dialog(self.iface, 1)

0 comments on commit 79b1189

Please sign in to comment.
You can’t perform that action at this time.