Skip to content
Permalink
Browse files

Fix drag & drop of menus

  • Loading branch information...
gm10 authored and raveit65 committed Mar 6, 2019
1 parent 7c03832 commit cc744aa07ddae0e6a1df7ad4963b09b27c08931f
Showing with 5 additions and 5 deletions.
  1. +5 −5 Mozo/MenuEditor.py
@@ -374,11 +374,9 @@ def moveMenu(self, menu, new_parent, before=None, after=None):
if menu.get_parent() != new_parent:
dom = self.__getMenu(menu).dom
path = self.__getPath(menu)
root_path = path[0]
xml_root = self.__getXmlMenu(root_path, dom.documentElement, dom)
old_path = path[1:]
new_path = self.__getPath(new_parent)[1:] + [menu.get_menu_id()]
self.__addXmlMove(xml_root, '/'.join(old_path), '/'.join(new_path), dom)
xml_root = self.__getXmlMenu(path[0], dom.documentElement, dom)
new_path = self.__getPath(new_parent) + [menu.get_menu_id()]
self.__addXmlMove(xml_root, '/'.join(path), '/'.join(new_path), dom)
self.__positionItem(new_parent, menu, before, after)
self.__addUndo([self.__getMenu(new_parent),])
self.save()
@@ -521,6 +519,8 @@ def __getXmlMenuPart(self, element, name):
return None

def __getXmlMenu(self, path, element, dom):
if isinstance(path, str):
return element
for name in path:
found = self.__getXmlMenuPart(element, name)
if found is not None:

0 comments on commit cc744aa

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