diff --git a/menu_from_project/menu_from_project.py b/menu_from_project/menu_from_project.py index e87d6be..88ce112 100644 --- a/menu_from_project/menu_from_project.py +++ b/menu_from_project/menu_from_project.py @@ -326,7 +326,7 @@ def addMenuItem(self, filename, node, menu, domdoc, mapLayersDict): def addMenu(self, name, filename, domdoc): # main project menu - menuBar = self.iface.editMenu().parentWidget() + menuBar = self.iface.addLayerMenu() projectMenu = QMenu('&'+name, menuBar) projectMenu.setToolTipsVisible(self.optionTooltip) @@ -379,7 +379,7 @@ def getQgsDoc(self, uri): return (doc, project_path) def initMenus(self): - menuBar = self.iface.editMenu().parentWidget() + menuBar = self.iface.addLayerMenu() for action in self.menubarActions: menuBar.removeAction(action) del action @@ -417,7 +417,7 @@ def initGui(self): self.initMenus() def unload(self): - menuBar = self.iface.editMenu().parentWidget() + menuBar = self.iface.addLayerMenu() for action in self.menubarActions: menuBar.removeAction(action)