diff options
author | gm10 <[email protected]> | 2019-03-06 09:59:24 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-03-11 08:56:28 +0100 |
commit | cc744aa07ddae0e6a1df7ad4963b09b27c08931f (patch) | |
tree | 825484173c0c80476512c2e4c4200173c714f1ff /Mozo | |
parent | 7c0383231b91a90f9cf193983e7860526a5cd3df (diff) | |
download | mozo-cc744aa07ddae0e6a1df7ad4963b09b27c08931f.tar.bz2 mozo-cc744aa07ddae0e6a1df7ad4963b09b27c08931f.tar.xz |
Fix drag & drop of menus
Diffstat (limited to 'Mozo')
-rw-r--r-- | Mozo/MenuEditor.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Mozo/MenuEditor.py b/Mozo/MenuEditor.py index 0bc7cc4..43bd818 100644 --- a/Mozo/MenuEditor.py +++ b/Mozo/MenuEditor.py @@ -374,11 +374,9 @@ class MenuEditor: 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 @@ class MenuEditor: 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: |