r18533 by craig - First part of MenuManager rewrite. Start storing string based, not on custom classes so much. Fixes some inherent issues in the code shown by Qt5.

scribus-commit scribus-commit at lists.scribus.net
Tue Oct 8 22:11:51 UTC 2013


Author: craig
Date: Tue Oct  8 22:11:51 2013
New Revision: 18533

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18533
Log:
First part of MenuManager rewrite. Start storing string based, not on custom classes so much. Fixes some inherent issues in the code shown by Qt5.

Modified:
    trunk/Scribus/scribus/menumanager.cpp
    trunk/Scribus/scribus/menumanager.h
    trunk/Scribus/scribus/pluginmanager.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/scmenu.cpp

Modified: trunk/Scribus/scribus/menumanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18533&path=/trunk/Scribus/scribus/menumanager.cpp
==============================================================================
--- trunk/Scribus/scribus/menumanager.cpp (original)
+++ trunk/Scribus/scribus/menumanager.cpp Tue Oct  8 22:11:51 2013
@@ -19,7 +19,6 @@
  *                                                                         *
  ***************************************************************************/
 #include <QMenuBar>
-#include <QMenu>
 #include "scribus.h"
 #include "menumanager.h"
 #include "ui/scmenu.h"
@@ -31,6 +30,10 @@
 {
 	scribusMenuBar=mb;
 	menuList.clear();
+	menuStrings.clear();
+	recentFileMenu=NULL;
+	editPasteRecentMenu=NULL;
+	windowsMenu=NULL;
 }
 
 MenuManager::~MenuManager()
@@ -40,7 +43,9 @@
 bool MenuManager::createMenu(const QString &menuName, const QString &menuText, const QString parent, bool checkable)
 {
 	bool retVal=false;
-		
+	QList<QString> menuEntries;
+	menuStrings.insert(menuName, menuEntries);
+	menuStringTexts.insert(menuName, menuText);
 	ScrPopupMenu *newMenu = new ScrPopupMenu(NULL, menuName, menuText, parent);
 	if (newMenu)
 	{
@@ -76,6 +81,8 @@
 		menuList[menuName]->clear();
 		retVal=true;
 	}
+	if (menuBarMenus.contains(menuName))
+		menuBarMenus[menuName]->clear();
 	return retVal;
 }
 
@@ -138,6 +145,125 @@
 		}
 	}
 	return retVal;
+}
+
+bool MenuManager::addMenuStringToMenuBar(const QString &menuName)
+{
+	bool retVal=false;
+	if (menuStrings.contains(menuName))
+	{
+		QMenu *m=scribusMenuBar->addMenu(menuStringTexts[menuName]);
+		menuBarMenus.insert(menuName, m);
+		if (menuName=="Windows" && m!=NULL)
+		{
+			windowsMenu=m;
+		}
+		retVal=true;
+	}
+	return retVal;
+}
+
+void MenuManager::addMenuItemStringstoMenuBar(const QString &menuName, const QMap<QString, QPointer<ScrAction> > &menuActions)
+{
+	if (menuStrings.contains(menuName) && menuBarMenus.contains(menuName))
+	{
+		for (int i=0; i<menuStrings[menuName].count();++i)
+		{
+			//Add Separators
+			if (menuStrings[menuName].at(i)=="SEPARATOR")
+				menuBarMenus[menuName]->addSeparator();
+			else
+			{
+				//Add Menu Items
+				if (menuActions.contains(menuStrings[menuName].at(i)))
+				{
+					menuBarMenus[menuName]->addAction(menuActions[menuStrings[menuName].at(i)]);
+				}
+				else
+				//Add Sub Menus
+				{
+					if (menuStrings.contains(menuStrings[menuName].at(i)))
+					{
+						QMenu *subMenu=menuBarMenus[menuName]->addMenu(menuStringTexts[menuStrings[menuName].at(i)]);
+						if (menuStrings[menuName].at(i)=="FileOpenRecent")
+						{
+							recentFileMenu=subMenu;
+						}
+						else if (menuStrings[menuName].at(i)=="EditPasteRecent")
+						{
+							editPasteRecentMenu=subMenu;
+						}
+						else if (menuStrings[menuName].at(i)=="ItemLayer")
+						{
+							itemLayerMenu=subMenu;
+						}
+						else if (menuStrings[menuName].at(i)=="itemSendToScrapbook")
+						{
+							itemSendtoScrapbookMenu=subMenu;
+						}
+						addMenuItemStringstoMenu(menuStrings[menuName].at(i), subMenu, menuActions);
+					}
+				}
+			}
+		}
+	}
+}
+
+
+void MenuManager::addMenuItemStringstoMenu(const QString &menuName, QMenu *menuToAddTo, const QMap<QString, QPointer<ScrAction> > &menuActions)
+{
+	if (menuStrings.contains(menuName))
+	{
+		for (int i=0; i<menuStrings[menuName].count();++i)
+		{
+			//Add Separators
+			if (menuStrings[menuName].at(i)=="SEPARATOR")
+				menuToAddTo->addSeparator();
+			else
+			{
+				//Add Menu Items
+				if (menuActions.contains(menuStrings[menuName].at(i)))
+					menuToAddTo->addAction(menuActions[menuStrings[menuName].at(i)]);
+				else
+				//Add Sub Menus
+				{
+					if (menuStrings.contains(menuStrings[menuName].at(i)))
+					{
+						QMenu *subMenu=menuToAddTo->addMenu(menuStringTexts[menuStrings[menuName].at(i)]);
+						if (subMenu)
+							addMenuItemStringstoMenu(menuStrings[menuName].at(i), subMenu, menuActions);
+					}
+				}
+			}
+		}
+	}
+}
+
+
+void MenuManager::addMenuItemStringstoSpecialMenu(const QString &menuName, const QMap<QString, QPointer<ScrAction> > &menuActions)
+{
+	if (menuName=="FileOpenRecent" && recentFileMenu!=NULL)
+	{
+		for( QMap<QString, QPointer<ScrAction> >::ConstIterator it = menuActions.begin(); it!=menuActions.end(); ++it )
+			recentFileMenu->addAction(*it);
+	}
+	else if (menuName=="Windows" && windowsMenu!=NULL)
+	{
+		for( QMap<QString, QPointer<ScrAction> >::ConstIterator it = menuActions.begin(); it!=menuActions.end(); ++it )
+			windowsMenu->addAction(*it);
+	}
+}
+
+void MenuManager::clearMenuStrings(const QString &menuName)
+{
+	if (menuName=="FileOpenRecent" && recentFileMenu!=NULL)
+	{
+		recentFileMenu->clear();
+	}
+	else if (menuName=="Windows" && windowsMenu!=NULL)
+	{
+		windowsMenu->clear();
+	}
 }
 
 bool MenuManager::addMenuToMenuBarBefore(const QString &menuName, const QString &afterMenuName)
@@ -205,6 +331,22 @@
 			menuAction->setEnabled(enabled);
 	}
 	return retVal;
+}
+
+void MenuManager::addMenuItemString(const QString& s, const QString &parent)
+{
+	if (menuStrings.contains(parent))
+		menuStrings[parent].append(s);
+}
+
+
+void MenuManager::addMenuItemStringAfter(const QString& s, const QString& after, const QString &parent)
+{
+	if (menuStrings.contains(parent))
+	{
+		int i=menuStrings[parent].indexOf(after);
+		menuStrings[parent].insert(i+1, s);
+	}
 }
 
 /* Qt4
@@ -318,3 +460,17 @@
 {
 	return menuList.contains(menuName);
 }
+
+void MenuManager::dumpMenuStrings()
+{
+	QMapIterator<QString, QList<QString> > i(menuStrings);
+	while (i.hasNext()) {
+		i.next();
+		qDebug() << "Menu name:"<<i.key();// << ": " << i.value() << endl;
+
+		QListIterator<QString> li (i.value());
+		while (li.hasNext()) {
+			qDebug() << "Menu entry:"<<li.next();
+		}
+	}
+}

Modified: trunk/Scribus/scribus/menumanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18533&path=/trunk/Scribus/scribus/menumanager.h
==============================================================================
--- trunk/Scribus/scribus/menumanager.h (original)
+++ trunk/Scribus/scribus/menumanager.h Tue Oct  8 22:11:51 2013
@@ -25,10 +25,15 @@
 #include <QObject>
 #include <QPoint>
 #include <QMenu>
+#include <QList>
+#include <QMap>
+#include <QPointer>
+#include <QString>
 
 class QMenuBar;
 
 #include "scribusapi.h"
+#include "actionmanager.h"
 class ScrAction;
 class ScrPopupMenu;
 class ScribusMainWindow;
@@ -54,6 +59,7 @@
 		QMenu *getLocalPopupMenu(const QString &menuName);
 		void setMenuEnabled(const QString &menuName, const bool enabled);
 		bool addMenuToMenuBar(const QString &menuName);
+		bool addMenuStringToMenuBar(const QString &menuName);
 		bool addMenuToMenuBarBefore(const QString &, const QString &);
 		bool removeMenuFromMenuBar(const QString &menuName);
 		bool addMenuToWidgetOfAction(const QString &menuName, ScrAction *action);
@@ -69,13 +75,28 @@
 		void generateKeyManList(QStringList *actionNames);
 		bool empty();
 		bool menuExists(const QString &menuName);
-
+		void dumpMenuStrings();
+		void addMenuItemString(const QString& s, const QString &parent);
+		void addMenuItemStringstoMenuBar(const QString &menuName, const QMap<QString, QPointer<ScrAction> > &menuActions);
+		void addMenuItemStringstoMenu(const QString &menuName, QMenu *menuToAddTo, const QMap<QString, QPointer<ScrAction> > &menuActions);
+		void addMenuItemStringstoSpecialMenu(const QString &menuName, const QMap<QString, QPointer<ScrAction> > &menuActions);
+		void clearMenuStrings(const QString &menuName);
+		void addMenuItemStringAfter(const QString &s, const QString &after, const QString &parent);
 	public slots:
 		void languageChange() {};
 
 private:
 	QMenuBar *scribusMenuBar;
 	QMap<QString, ScrPopupMenu *> menuList;
+
+	QMap<QString, QList<QString> > menuStrings;
+	QMap<QString, QString> menuStringTexts;
+	QMap<QString, QMenu*> menuBarMenus;
+	QMenu *recentFileMenu;
+	QMenu *editPasteRecentMenu;
+	QMenu *itemLayerMenu;
+	QMenu *itemSendtoScrapbookMenu;
+	QMenu *windowsMenu;
 };
 
 #endif

Modified: trunk/Scribus/scribus/pluginmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18533&path=/trunk/Scribus/scribus/pluginmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/pluginmanager.cpp (original)
+++ trunk/Scribus/scribus/pluginmanager.cpp Tue Oct  8 22:11:51 2013
@@ -306,7 +306,8 @@
 			// Connect action's activated signal with the plugin's run method
 			it.value().enabled = connect( mw->scrActions[ai.name], SIGNAL(triggeredData(ScribusDoc*)),
 							plugin, SLOT(run(ScribusDoc*)) );
-			//Get the menu manager to add the DLL's menu item to the right menu, after the chosen existing item
+
+			 //Get the menu manager to add the DLL's menu item to the right menu, after the chosen existing item
 			if ( ai.menuAfterName.isEmpty() )
 			{
 				if (!ai.menu.isEmpty())
@@ -318,7 +319,8 @@
 							mw->scrMenuMgr->createMenu(ai.menu, ai.subMenuName, ai.parentMenu);
 						}
 					}
-					mw->scrMenuMgr->addMenuItem(mw->scrActions[ai.name], ai.menu, true);
+//					mw->scrMenuMgr->addMenuItem(mw->scrActions[ai.name], ai.menu, true);
+					mw->scrMenuMgr->addMenuItemString(ai.name, ai.menu);
 				}
 			}
 			else
@@ -333,7 +335,9 @@
 					if (!mw->scrMenuMgr->menuExists(ai.menu))
 						mw->scrMenuMgr->createMenu(ai.menu, ai.subMenuName, ai.parentMenu);
 				}
-				mw->scrMenuMgr->addMenuItemAfter(mw->scrActions[ai.name], ai.menu, true, afterAction);
+				mw->scrMenuMgr->addMenuItemStringAfter(ai.name, ai.menuAfterName, ai.menu);
+//				mw->scrMenuMgr->addMenuItemAfter(mw->scrActions[ai.name], ai.menu, true, afterAction);
+//				mw->scrMenuMgr->addMenuItem(mw->scrActions[ai.name], ai.menu, true);
 			}
 			if (!ai.toolbar.isEmpty())
 			{
@@ -358,6 +362,12 @@
 		}
 
 	}
+	mw->scrMenuMgr->clearMenu("File");
+	mw->scrMenuMgr->addMenuItemStringstoMenuBar("File", mw->scrActions);
+	mw->scrMenuMgr->clearMenu("Item");
+	mw->scrMenuMgr->addMenuItemStringstoMenuBar("Item", mw->scrActions);
+	mw->scrMenuMgr->clearMenu("Extras");
+	mw->scrMenuMgr->addMenuItemStringstoMenuBar("Extras", mw->scrActions);
 	return true;
 }
 

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18533&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Tue Oct  8 22:11:51 2013
@@ -336,7 +336,8 @@
 	scrWindowsActions.clear();
 	scrLayersActions.clear();
 	scrScrapActions.clear();
-	scrMenuMgr = new ScMWMenuManager(menuBar());
+	actionManager = new ActionManager(this);
+	scrMenuMgr = new ScMWMenuManager(menuBar(), actionManager);
 	prefsManager = PrefsManager::instance();
 	formatsManager = FormatsManager::instance();
 	objectSpecificUndo = false;
@@ -353,7 +354,7 @@
 
 	qApp->processEvents();
 
-	actionManager = new ActionManager(this);
+
 	actionManager->init(this);
 //	if (primaryMainWindow)
 //		ScCore->setSplashStatus( tr("Applying User Shortcuts") );
@@ -723,393 +724,449 @@
 {
 	RecentDocs.clear();
 	scrMenuMgr->createMenu("File", ActionManager::defaultMenuNameEntryTranslated("File"));
-	scrMenuMgr->addMenuItem(scrActions["fileNew"], "File", true);
-	scrMenuMgr->addMenuItem(scrActions["fileNewFromTemplate"], "File", true);
-	scrMenuMgr->addMenuItem(scrActions["fileOpen"], "File", true);
+	scrMenuMgr->addMenuItemString("fileNew", "File");
+	scrMenuMgr->addMenuItemString("fileNewFromTemplate", "File");
+	scrMenuMgr->addMenuItemString("fileOpen", "File");
+	scrMenuMgr->addMenuItemString("FileOpenRecent", "File");
 	scrMenuMgr->createMenu("FileOpenRecent", tr("Open &Recent"), "File");
-	scrMenuMgr->addMenuSeparator("File");
-	scrMenuMgr->addMenuItem(scrActions["fileClose"], "File", false);
-	scrMenuMgr->addMenuItem(scrActions["fileSave"], "File", false);
-	scrMenuMgr->addMenuItem(scrActions["fileSaveAs"], "File", false);
-	scrMenuMgr->addMenuItem(scrActions["fileRevert"], "File", false);
-	scrMenuMgr->addMenuItem(scrActions["fileCollect"], "File", false);
-	scrMenuMgr->addMenuSeparator("File");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "File");
+	scrMenuMgr->addMenuItemString("fileClose", "File");
+	scrMenuMgr->addMenuItemString("fileSave", "File");
+	scrMenuMgr->addMenuItemString("fileSaveAs", "File");
+	scrMenuMgr->addMenuItemString("fileRevert", "File");
+	scrMenuMgr->addMenuItemString("fileCollect", "File");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "File");
 	scrMenuMgr->createMenu("FileImport", tr("&Import"), "File");
-	scrMenuMgr->addMenuItem(scrActions["fileImportText"], "FileImport", false);
-// 	scrMenuMgr->addMenuItem(scrActions["fileImportText2"], "FileImport", false);
-	scrMenuMgr->addMenuItem(scrActions["fileImportAppendText"], "FileImport", false);
-	scrMenuMgr->addMenuItem(scrActions["fileImportImage"], "FileImport", false);
-	scrMenuMgr->addMenuItem(scrActions["fileImportVector"], "FileImport", true);
-
+	scrMenuMgr->addMenuItemString("FileImport", "File");
+	scrMenuMgr->addMenuItemString("fileImportText", "FileImport");
+	scrMenuMgr->addMenuItemString("fileImportAppendText", "FileImport");
+	scrMenuMgr->addMenuItemString("fileImportImage", "FileImport");
+	scrMenuMgr->addMenuItemString("fileImportVector", "FileImport");
+	scrMenuMgr->addMenuItemString("FileExport", "File");
 	scrMenuMgr->createMenu("FileExport", tr("&Export"), "File");
-	scrMenuMgr->addMenuItem(scrActions["fileExportText"], "FileExport", false);
-	scrMenuMgr->addMenuItem(scrActions["fileExportAsEPS"], "FileExport", false);
-	scrMenuMgr->addMenuItem(scrActions["fileExportAsPDF"], "FileExport", false);
-	scrMenuMgr->addMenuSeparator("File");
-//	scrMenuMgr->addMenuItem(scrActions["fileDocSetup"], "File", false);
-	scrMenuMgr->addMenuItem(scrActions["fileDocSetup150"], "File", false);
-//	scrMenuMgr->addMenuItem(scrActions["filePreferences"], "File", true);
-	scrMenuMgr->addMenuItem(scrActions["filePreferences150"], "File", true);
-	scrMenuMgr->addMenuSeparator("File");
-	scrMenuMgr->addMenuItem(scrActions["filePrint"], "File", false);
-	scrMenuMgr->addMenuItem(scrActions["PrintPreview"], "File", false);
-	scrMenuMgr->addMenuSeparator("File");
-	scrMenuMgr->addMenuItem(scrActions["fileQuit"], "File", true);
+	scrMenuMgr->addMenuItemString("fileExportText", "FileExport");
+	scrMenuMgr->addMenuItemString("fileExportAsEPS", "FileExport");
+	scrMenuMgr->addMenuItemString("fileExportAsPDF", "FileExport");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "File");
+	scrMenuMgr->addMenuItemString("fileDocSetup150", "File");
+	scrMenuMgr->addMenuItemString("filePreferences150", "File");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "File");
+	scrMenuMgr->addMenuItemString("filePrint", "File");
+	scrMenuMgr->addMenuItemString("PrintPreview", "File");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "File");
+	scrMenuMgr->addMenuItemString("fileQuit", "File");
 
 	scrMenuMgr->setMenuEnabled("FileImport", false);
 	scrMenuMgr->setMenuEnabled("FileExport", false);
 
 	scrMenuMgr->createMenu("Edit", ActionManager::defaultMenuNameEntryTranslated("Edit"));
-	scrMenuMgr->addMenuItem(scrActions["editUndoAction"], "Edit", false);
-	scrMenuMgr->addMenuItem(scrActions["editRedoAction"], "Edit", false);
-	scrMenuMgr->addMenuItem(scrActions["editActionMode"], "Edit", true);
-	scrMenuMgr->addMenuSeparator("Edit");
-	scrMenuMgr->addMenuItem(scrActions["editCut"], "Edit", false);
-	scrMenuMgr->addMenuItem(scrActions["editCopy"], "Edit", false);
-	scrMenuMgr->addMenuItem(scrActions["editPaste"], "Edit", false);
+	scrMenuMgr->addMenuItemString("editUndoAction", "Edit");
+	scrMenuMgr->addMenuItemString("editRedoAction", "Edit");
+	scrMenuMgr->addMenuItemString("editActionMode", "Edit");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Edit");
+	scrMenuMgr->addMenuItemString("editCut", "Edit");
+	scrMenuMgr->addMenuItemString("editCopy", "Edit");
+	scrMenuMgr->addMenuItemString("editPaste", "Edit");
 	scrMenuMgr->createMenu("EditPasteRecent", tr("Paste Recent"), "Edit");
 	scrMenuMgr->createMenu("EditContents", tr("Contents"), "Edit");
-	scrMenuMgr->addMenuItem(scrActions["editCopyContents"], "EditContents", false);
-	scrMenuMgr->addMenuItem(scrActions["editPasteContents"], "EditContents", false);
-	scrMenuMgr->addMenuItem(scrActions["editPasteContentsAbs"], "EditContents", false);
-	scrMenuMgr->addMenuItem(scrActions["editClearContents"], "EditContents", false);
-	scrMenuMgr->addMenuItem(scrActions["itemDelete"], "Edit", false);
-	scrMenuMgr->addMenuSeparator("Edit");
-	scrMenuMgr->addMenuItem(scrActions["editSelectAll"], "Edit", false);
-	scrMenuMgr->addMenuItem(scrActions["editSelectAllOnLayer"], "Edit", false);
-	scrMenuMgr->addMenuItem(scrActions["editDeselectAll"], "Edit", false);
-	scrMenuMgr->addMenuSeparator("Edit");
-	scrMenuMgr->addMenuItem(scrActions["editSearchReplace"], "Edit" , false);
-	scrMenuMgr->addMenuItem(scrActions["toolsEditWithStoryEditor"], "Edit", false);
-	scrMenuMgr->addMenuItem(scrActions["editEditWithImageEditor"], "Edit", false);
-	scrMenuMgr->addMenuItem(scrActions["editEditRenderSource"], "Edit", false);
-	scrMenuMgr->addMenuSeparator("Edit");
-	scrMenuMgr->addMenuItem(scrActions["editColors"], "Edit", true);
-	scrMenuMgr->addMenuItem(scrActions["editReplaceColors"], "Edit", false);
-	scrMenuMgr->addMenuItem(scrActions["editStyles"], "Edit", false);
-	scrMenuMgr->addMenuItem(scrActions["editMarks"], "Edit", false);
-	scrMenuMgr->addMenuItem(scrActions["editNotesStyles"], "Edit", false);
-	scrMenuMgr->addMenuItem(scrActions["editMasterPages"], "Edit", false);
-	scrMenuMgr->addMenuItem(scrActions["editJavascripts"], "Edit", false);
+	scrMenuMgr->addMenuItemString("editCopyContents", "EditContents");
+	scrMenuMgr->addMenuItemString("editPasteContents", "EditContents");
+	scrMenuMgr->addMenuItemString("editPasteContentsAbs", "EditContents");
+	scrMenuMgr->addMenuItemString("editClearContents", "EditContents");
+	scrMenuMgr->addMenuItemString("itemDelete", "Edit");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Edit");
+	scrMenuMgr->addMenuItemString("editSelectAll", "Edit");
+	scrMenuMgr->addMenuItemString("editSelectAllOnLayer", "Edit");
+	scrMenuMgr->addMenuItemString("editDeselectAll", "Edit");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Edit");
+	scrMenuMgr->addMenuItemString("editSearchReplace", "Edit");
+	scrMenuMgr->addMenuItemString("toolsEditWithStoryEditor", "Edit");
+	scrMenuMgr->addMenuItemString("editEditWithImageEditor", "Edit");
+	scrMenuMgr->addMenuItemString("editEditRenderSource", "Edit");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Edit");
+	scrMenuMgr->addMenuItemString("editColors", "Edit");
+	scrMenuMgr->addMenuItemString("editReplaceColors", "Edit");
+	scrMenuMgr->addMenuItemString("editStyles", "Edit");
+	scrMenuMgr->addMenuItemString("editMarks", "Edit");
+	scrMenuMgr->addMenuItemString("editNotesStyles", "Edit");
+	scrMenuMgr->addMenuItemString("editMasterPages", "Edit");
+	scrMenuMgr->addMenuItemString("editJavascripts", "Edit");
 	scrMenuMgr->setMenuEnabled("EditPasteRecent", false);
 	scrMenuMgr->setMenuEnabled("EditContents", false);
 
 	//Item Menu
 	scrMenuMgr->createMenu("Item", ActionManager::defaultMenuNameEntryTranslated("Item"));
 	scrMenuMgr->createMenu("DuplicateTransform", tr("Duplicate/Transform"), "Item");
-	scrMenuMgr->addMenuItem(scrActions["itemDuplicate"], "DuplicateTransform", false);
-	scrMenuMgr->addMenuItem(scrActions["itemMulDuplicate"], "DuplicateTransform", false);
-	scrMenuMgr->addMenuItem(scrActions["itemTransform"], "DuplicateTransform", false);
+	scrMenuMgr->addMenuItemString("DuplicateTransform", "Item");
+	scrMenuMgr->addMenuItemString("itemDuplicate", "DuplicateTransform");
+	scrMenuMgr->addMenuItemString("itemMulDuplicate", "DuplicateTransform");
+	scrMenuMgr->addMenuItemString("itemTransform", "DuplicateTransform");
 	scrMenuMgr->createMenu("Grouping", tr("Grouping"), "Item");
-	scrMenuMgr->addMenuItem(scrActions["itemGroup"], "Grouping", false);
-	scrMenuMgr->addMenuItem(scrActions["itemUngroup"], "Grouping", false);
-	scrMenuMgr->addMenuItem(scrActions["itemGroupAdjust"], "Grouping", false);
+	scrMenuMgr->addMenuItemString("Grouping", "Item");
+	scrMenuMgr->addMenuItemString("itemGroup", "Grouping");
+	scrMenuMgr->addMenuItemString("itemUngroup", "Grouping");
+	scrMenuMgr->addMenuItemString("itemGroupAdjust", "Grouping");
 	scrMenuMgr->createMenu("Locking", tr("Locking"), "Item");
-	scrMenuMgr->addMenuItem(scrActions["itemLock"], "Locking", false);
-	scrMenuMgr->addMenuItem(scrActions["itemLockSize"], "Locking", false);
+	scrMenuMgr->addMenuItemString("Locking", "Item");
+	scrMenuMgr->addMenuItemString("itemLock", "Locking");
+	scrMenuMgr->addMenuItemString("itemLockSize", "Locking");
 	scrMenuMgr->createMenu("ItemLevel", tr("Level"), "Item");
-	scrMenuMgr->addMenuItem(scrActions["itemRaise"], "ItemLevel", false);
-	scrMenuMgr->addMenuItem(scrActions["itemLower"], "ItemLevel", false);
-	scrMenuMgr->addMenuItem(scrActions["itemRaiseToTop"], "ItemLevel", false);
-	scrMenuMgr->addMenuItem(scrActions["itemLowerToBottom"], "ItemLevel", false);
+	scrMenuMgr->addMenuItemString("ItemLevel", "Item");
+	scrMenuMgr->addMenuItemString("itemRaise", "Locking");
+	scrMenuMgr->addMenuItemString("itemLower", "Locking");
+	scrMenuMgr->addMenuItemString("itemRaiseToTop", "Locking");
+	scrMenuMgr->addMenuItemString("itemLowerToBottom", "Locking");
 	scrMenuMgr->createMenu("ItemLayer", tr("Send to La&yer"));
+	scrMenuMgr->addMenuItemString("ItemLayer", "Item");
 	scrMenuMgr->addMenuToMenu("ItemLayer", "Item");
 	scrMenuMgr->createMenu("SendTo", tr("Send to"), "Item");
+	scrMenuMgr->addMenuItemString("SendTo", "Item");
 	scrMenuMgr->createMenu("itemSendToScrapbook", tr("Scrapbook"));
+	scrMenuMgr->addMenuItemString("itemSendToScrapbook", "SendTo");
 	scrMenuMgr->addMenuToMenu("itemSendToScrapbook", "SendTo");
-	scrMenuMgr->addMenuItem(scrActions["itemSendToPattern"], "SendTo", false);
-	scrMenuMgr->addMenuItem(scrActions["itemSendToInline"], "SendTo", false);
+	scrMenuMgr->addMenuItemString("itemSendToPattern", "SendTo");
+	scrMenuMgr->addMenuItemString("itemSendToInline", "SendTo");
 	scrMenuMgr->createMenu("Adjust", tr("Adjust"), "Item");
-	scrMenuMgr->addMenuItem(scrActions["itemAdjustFrameHeightToText"], "Adjust", false);
-	scrMenuMgr->addMenuItem(scrActions["itemAdjustFrameToImage"], "Adjust", false);
-	scrMenuMgr->addMenuItem(scrActions["itemAdjustImageToFrame"], "Adjust", false);
+	scrMenuMgr->addMenuItemString("Adjust", "Item");
+	scrMenuMgr->addMenuItemString("itemAdjustFrameHeightToText", "Adjust");
+	scrMenuMgr->addMenuItemString("itemAdjustFrameToImage", "Adjust");
+	scrMenuMgr->addMenuItemString("itemAdjustImageToFrame", "Adjust");
 	scrMenuMgr->createMenu("Image", tr("Image"), "Item");
-	scrMenuMgr->addMenuItem(scrActions["itemUpdateImage"], "Image", false);
-	scrMenuMgr->addMenuItem(scrActions["styleImageEffects"], "Image", false);
-	scrMenuMgr->addMenuItem(scrActions["itemExtendedImageProperties"], "Image", false);
-	scrMenuMgr->addMenuItem(scrActions["itemToggleInlineImage"], "Image", false);
+	scrMenuMgr->addMenuItemString("Image", "Item");
+	scrMenuMgr->addMenuItemString("itemUpdateImage", "Image");
+	scrMenuMgr->addMenuItemString("styleImageEffects", "Image");
+	scrMenuMgr->addMenuItemString("itemExtendedImageProperties", "Image");
+	scrMenuMgr->addMenuItemString("itemToggleInlineImage", "Image");
 	scrMenuMgr->createMenu("ItemPreviewSettings", tr("Preview Settings"), "Image");
-	scrMenuMgr->addMenuItem(scrActions["itemImageIsVisible"], "ItemPreviewSettings", false);
-	scrMenuMgr->addMenuSeparator("ItemPreviewSettings");
-	scrMenuMgr->addMenuItem(scrActions["itemPreviewLow"], "ItemPreviewSettings", false);
-	scrMenuMgr->addMenuItem(scrActions["itemPreviewNormal"], "ItemPreviewSettings", false);
-	scrMenuMgr->addMenuItem(scrActions["itemPreviewFull"], "ItemPreviewSettings", false);
-	scrMenuMgr->addMenuItem(scrActions["itemAttributes"], "Item", false);
+	scrMenuMgr->addMenuItemString("ItemPreviewSettings", "Image");
+	scrMenuMgr->addMenuItemString("itemImageIsVisible", "ItemPreviewSettings");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "ItemPreviewSettings");
+	scrMenuMgr->addMenuItemString("itemPreviewLow", "ItemPreviewSettings");
+	scrMenuMgr->addMenuItemString("itemPreviewNormal", "ItemPreviewSettings");
+	scrMenuMgr->addMenuItemString("itemPreviewFull", "ItemPreviewSettings");
 	scrMenuMgr->createMenu("ItemPDFOptions", tr("&PDF Options"));
 	scrMenuMgr->addMenuToMenu("ItemPDFOptions", "Item");
-	scrMenuMgr->addMenuItem(scrActions["itemPDFIsAnnotation"], "ItemPDFOptions", false);
-	scrMenuMgr->addMenuItem(scrActions["itemPDFIsBookmark"], "ItemPDFOptions", false);
-	scrMenuMgr->addMenuItem(scrActions["itemPDFAnnotationProps"], "ItemPDFOptions", false);
-	scrMenuMgr->addMenuItem(scrActions["itemPDFFieldProps"], "ItemPDFOptions", false);
+	scrMenuMgr->addMenuItemString("ItemPDFOptions", "Item");
+	scrMenuMgr->addMenuItemString("itemPDFIsAnnotation", "ItemPDFOptions");
+	scrMenuMgr->addMenuItemString("itemPDFIsBookmark", "ItemPDFOptions");
+	scrMenuMgr->addMenuItemString("itemPDFAnnotationProps", "ItemPDFOptions");
+	scrMenuMgr->addMenuItemString("itemPDFFieldProps", "ItemPDFOptions");
 	scrMenuMgr->createMenu("ItemConvertTo", tr("C&onvert To"), "Item");
-	scrMenuMgr->addMenuItem(scrActions["itemConvertToBezierCurve"], "ItemConvertTo", false);
-	scrMenuMgr->addMenuItem(scrActions["itemConvertToImageFrame"], "ItemConvertTo", false);
-	scrMenuMgr->addMenuItem(scrActions["itemConvertToOutlines"], "ItemConvertTo", false);
-	scrMenuMgr->addMenuItem(scrActions["itemConvertToPolygon"], "ItemConvertTo", false);
-	scrMenuMgr->addMenuItem(scrActions["itemConvertToTextFrame"], "ItemConvertTo", false);
-	scrMenuMgr->addMenuItem(scrActions["itemConvertToSymbolFrame"], "ItemConvertTo", false);
+	scrMenuMgr->addMenuItemString("ItemConvertTo", "Item");
+	scrMenuMgr->addMenuItemString("itemConvertToBezierCurve", "ItemConvertTo");
+	scrMenuMgr->addMenuItemString("itemConvertToImageFrame", "ItemConvertTo");
+	scrMenuMgr->addMenuItemString("itemConvertToOutlines", "ItemConvertTo");
+	scrMenuMgr->addMenuItemString("itemConvertToPolygon", "ItemConvertTo");
+	scrMenuMgr->addMenuItemString("itemConvertToTextFrame", "ItemConvertTo");
+	scrMenuMgr->addMenuItemString("itemConvertToSymbolFrame", "ItemConvertTo");
 	scrMenuMgr->createMenu("TextLinking", tr("Text Frame Links"), "Item");
-	scrMenuMgr->addMenuItem(scrActions["toolsLinkTextFrame"], "TextLinking", false);
-	scrMenuMgr->addMenuItem(scrActions["toolsUnlinkTextFrame"], "TextLinking", false);
-	scrMenuMgr->addMenuItem(scrActions["toolsUnlinkTextFrameWithTextCopy"], "TextLinking", false);
-	scrMenuMgr->addMenuItem(scrActions["toolsUnlinkTextFrameWithTextCut"], "TextLinking", false);
+	scrMenuMgr->addMenuItemString("TextLinking", "Item");
+	scrMenuMgr->addMenuItemString("toolsLinkTextFrame", "TextLinking");
+	scrMenuMgr->addMenuItemString("toolsUnlinkTextFrame", "TextLinking");
+	scrMenuMgr->addMenuItemString("toolsUnlinkTextFrameWithTextCopy", "TextLinking");
+	scrMenuMgr->addMenuItemString("toolsUnlinkTextFrameWithTextCut", "TextLinking");
 	scrMenuMgr->createMenu("ItemPathOps", tr("Path Tools"), "Item");
-	scrMenuMgr->addMenuItem(scrActions["itemCombinePolygons"], "ItemPathOps", false);
-	scrMenuMgr->addMenuItem(scrActions["itemSplitPolygons"], "ItemPathOps", false);
-	scrMenuMgr->addMenuItem(scrActions["itemAttachTextToPath"], "ItemPathOps", false);
-	scrMenuMgr->addMenuItem(scrActions["itemDetachTextFromPath"], "ItemPathOps", false);
+	scrMenuMgr->addMenuItemString("ItemPathOps", "Item");
+	scrMenuMgr->addMenuItemString("itemCombinePolygons", "ItemPathOps");
+	scrMenuMgr->addMenuItemString("itemSplitPolygons", "ItemPathOps");
+	scrMenuMgr->addMenuItemString("itemAttachTextToPath", "ItemPathOps");
+	scrMenuMgr->addMenuItemString("itemDetachTextFromPath", "ItemPathOps");
 
 	scrActions["itemPrintingEnabled"]->setEnabled(false);
 	scrMenuMgr->setMenuEnabled("ItemConvertTo", false);
 
 	scrMenuMgr->createMenu("Weld", tr("Welding"), "Item");
-	scrMenuMgr->addMenuItem(scrActions["itemsUnWeld"], "Weld", false);
-	scrMenuMgr->addMenuItem(scrActions["itemWeld"], "Weld", false);
-	scrMenuMgr->addMenuItem(scrActions["itemEditWeld"], "Weld", false);
+	scrMenuMgr->addMenuItemString("Weld", "Item");
+	scrMenuMgr->addMenuItemString("itemsUnWeld", "Weld");
+	scrMenuMgr->addMenuItemString("itemWeld", "Weld");
+	scrMenuMgr->addMenuItemString("itemEditWeld", "Weld");
 
 	scrMenuMgr->addMenuItem(scrActions["editMark"], "Item", false);
+	scrMenuMgr->addMenuItemString("editMark", "Item");
 
 	//Insert menu
 	scrMenuMgr->createMenu("Insert", ActionManager::defaultMenuNameEntryTranslated("Insert"));
-	scrMenuMgr->addMenuItem(scrActions["insertFrame"], "Insert", false);
+	scrMenuMgr->addMenuItemString("insertFrame", "Insert");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Insert");
+	scrMenuMgr->addMenuItemString("toolsInsertTextFrame", "Insert");
+	scrMenuMgr->addMenuItemString("toolsInsertImageFrame", "Insert");
+	scrMenuMgr->addMenuItemString("toolsInsertRenderFrame", "Insert");
+	scrMenuMgr->addMenuItemString("toolsInsertTable", "Insert");
+	scrMenuMgr->addMenuItemString("toolsInsertShape", "Insert");
+	scrMenuMgr->addMenuItemString("toolsInsertPolygon", "Insert");
+	scrMenuMgr->addMenuItemString("toolsInsertArc", "Insert");
+	scrMenuMgr->addMenuItemString("toolsInsertSpiral", "Insert");
+	scrMenuMgr->addMenuItemString("toolsInsertLine", "Insert");
+	scrMenuMgr->addMenuItemString("toolsInsertBezier", "Insert");
+	scrMenuMgr->addMenuItemString("toolsInsertFreehandLine", "Insert");
+	scrMenuMgr->addMenuItemString("toolsInsertCalligraphicLine", "Insert");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Insert");
+	scrMenuMgr->addMenuItemString("stickyTools", "Insert");
 	scrMenuMgr->addMenuSeparator("Insert");
-	scrMenuMgr->addMenuItem(scrActions["toolsInsertTextFrame"], "Insert", false);
-	scrMenuMgr->addMenuItem(scrActions["toolsInsertImageFrame"], "Insert", false);
-	scrMenuMgr->addMenuItem(scrActions["toolsInsertRenderFrame"], "Insert", false);
-	scrMenuMgr->addMenuItem(scrActions["toolsInsertTable"], "Insert", false);
-	scrMenuMgr->addMenuItem(scrActions["toolsInsertShape"], "Insert", false);
-	scrMenuMgr->addMenuItem(scrActions["toolsInsertPolygon"], "Insert", false);
-	scrMenuMgr->addMenuItem(scrActions["toolsInsertArc"], "Insert", false);
-	scrMenuMgr->addMenuItem(scrActions["toolsInsertSpiral"], "Insert", false);
-	scrMenuMgr->addMenuItem(scrActions["toolsInsertLine"], "Insert", false);
-	scrMenuMgr->addMenuItem(scrActions["toolsInsertBezier"], "Insert", false);
-	scrMenuMgr->addMenuItem(scrActions["toolsInsertFreehandLine"], "Insert", false);
-	scrMenuMgr->addMenuItem(scrActions["toolsInsertCalligraphicLine"], "Insert", false);
-	scrMenuMgr->addMenuSeparator("Insert");
-	scrMenuMgr->addMenuItem(scrActions["stickyTools"], "Insert", true);
-	scrMenuMgr->addMenuSeparator("Insert");
-	scrMenuMgr->addMenuItem(scrActions["insertGlyph"], "Insert", false);
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Insert");
+	scrMenuMgr->addMenuItemString("insertGlyph", "Insert");
 
 	scrMenuMgr->createMenu("InsertChar", tr("&Character"), "Insert");
-	scrMenuMgr->addMenuItem(scrActions["unicodePageNumber"], "InsertChar", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodePageCount"], "InsertChar", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeSoftHyphen"], "InsertChar", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeNonBreakingHyphen"], "InsertChar", false);
-	scrMenuMgr->addMenuSeparator("InsertChar");
-	scrMenuMgr->addMenuItem(scrActions["unicodeCopyRight"], "InsertChar", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeRegdTM"], "InsertChar", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeTM"], "InsertChar", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeSolidus"], "InsertChar", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeBullet"], "InsertChar", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeMidpoint"], "InsertChar", false);
-	scrMenuMgr->addMenuSeparator("InsertChar");
-	scrMenuMgr->addMenuItem(scrActions["unicodeDashEm"], "InsertChar", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeDashEn"], "InsertChar", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeDashFigure"], "InsertChar", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeDashQuotation"], "InsertChar", false);
+	scrMenuMgr->addMenuItemString("InsertChar", "Insert");
+	scrMenuMgr->addMenuItemString("unicodePageNumber", "InsertChar");
+	scrMenuMgr->addMenuItemString("unicodePageCount", "InsertChar");
+	scrMenuMgr->addMenuItemString("unicodeSoftHyphen", "InsertChar");
+	scrMenuMgr->addMenuItemString("unicodeNonBreakingHyphen", "InsertChar");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "InsertChar");
+	scrMenuMgr->addMenuItemString("unicodeCopyRight", "InsertChar");
+	scrMenuMgr->addMenuItemString("unicodeRegdTM", "InsertChar");
+	scrMenuMgr->addMenuItemString("unicodeTM", "InsertChar");
+	scrMenuMgr->addMenuItemString("unicodeSolidus", "InsertChar");
+	scrMenuMgr->addMenuItemString("unicodeBullet", "InsertChar");
+	scrMenuMgr->addMenuItemString("unicodeMidpoint", "InsertChar");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "InsertChar");
+	scrMenuMgr->addMenuItemString("unicodeDashEm", "InsertChar");
+	scrMenuMgr->addMenuItemString("unicodeDashEn", "InsertChar");
+	scrMenuMgr->addMenuItemString("unicodeDashFigure", "InsertChar");
+	scrMenuMgr->addMenuItemString("unicodeDashQuotation", "InsertChar");
 
 	scrMenuMgr->createMenu("InsertQuote", tr("&Quote"), "Insert");
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteApostrophe"], "InsertQuote", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteStraight"], "InsertQuote", false);
-	scrMenuMgr->addMenuSeparator("InsertQuote");
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteSingleLeft"], "InsertQuote", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteSingleRight"], "InsertQuote", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteDoubleLeft"], "InsertQuote", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteDoubleRight"], "InsertQuote", false);
-	scrMenuMgr->addMenuSeparator("InsertQuote");
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteSingleReversed"], "InsertQuote", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteDoubleReversed"], "InsertQuote", false);
-	scrMenuMgr->addMenuSeparator("InsertQuote");
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteLowSingleComma"], "InsertQuote", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteLowDoubleComma"], "InsertQuote", false);
-	scrMenuMgr->addMenuSeparator("InsertQuote");
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteSingleLeftGuillemet"], "InsertQuote", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteSingleRightGuillemet"], "InsertQuote", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteDoubleLeftGuillemet"], "InsertQuote", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteDoubleRightGuillemet"], "InsertQuote", false);
-	scrMenuMgr->addMenuSeparator("InsertQuote");
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteCJKSingleLeft"], "InsertQuote", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteCJKSingleRight"], "InsertQuote", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteCJKDoubleLeft"], "InsertQuote", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeQuoteCJKDoubleRight"], "InsertQuote", false);
+	scrMenuMgr->addMenuItemString("InsertQuote", "Insert");
+	scrMenuMgr->addMenuItemString("unicodeQuoteApostrophe", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteStraight", "InsertQuote");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteSingleLeft", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteSingleRight", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteDoubleLeft", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteDoubleRight", "InsertQuote");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteSingleReversed", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteDoubleReversed", "InsertQuote");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteLowSingleComma", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteLowDoubleComma", "InsertQuote");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteSingleLeftGuillemet", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteSingleRightGuillemet", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteDoubleLeftGuillemet", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteDoubleRightGuillemet", "InsertQuote");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteCJKSingleLeft", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteCJKSingleRight", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteCJKDoubleLeft", "InsertQuote");
+	scrMenuMgr->addMenuItemString("unicodeQuoteCJKDoubleRight", "InsertQuote");
 
 	scrMenuMgr->createMenu("InsertSpace", tr("S&paces && Breaks"), "Insert");
-	scrMenuMgr->addMenuItem(scrActions["unicodeNonBreakingSpace"], "InsertSpace", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeSpaceEN"], "InsertSpace", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeSpaceEM"], "InsertSpace", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeSpaceThin"], "InsertSpace", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeSpaceThick"], "InsertSpace", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeSpaceMid"], "InsertSpace", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeSpaceHair"], "InsertSpace", false);
-	scrMenuMgr->addMenuSeparator("InsertSpace");
-	scrMenuMgr->addMenuItem(scrActions["unicodeNewLine"], "InsertSpace", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeFrameBreak"], "InsertSpace", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeColumnBreak"], "InsertSpace", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeZerowidthSpace"], "InsertSpace", false);
+	scrMenuMgr->addMenuItemString("InsertSpace", "Insert");
+	scrMenuMgr->addMenuItemString("unicodeNonBreakingSpace", "InsertSpace");
+	scrMenuMgr->addMenuItemString("unicodeSpaceEN", "InsertSpace");
+	scrMenuMgr->addMenuItemString("unicodeSpaceEM", "InsertSpace");
+	scrMenuMgr->addMenuItemString("unicodeSpaceThin", "InsertSpace");
+	scrMenuMgr->addMenuItemString("unicodeSpaceThick", "InsertSpace");
+	scrMenuMgr->addMenuItemString("unicodeSpaceMid", "InsertSpace");
+	scrMenuMgr->addMenuItemString("unicodeSpaceHair", "InsertSpace");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "InsertSpace");
+	scrMenuMgr->addMenuItemString("unicodeNewLine", "InsertSpace");
+	scrMenuMgr->addMenuItemString("unicodeFrameBreak", "InsertSpace");
+	scrMenuMgr->addMenuItemString("unicodeColumnBreak", "InsertSpace");
+	scrMenuMgr->addMenuItemString("unicodeZerowidthSpace", "InsertSpace");
 
 	scrMenuMgr->createMenu("InsertLigature", tr("Liga&ture"), "Insert");
-	scrMenuMgr->addMenuItem(scrActions["unicodeLigature_ff"], "InsertLigature", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeLigature_fi"], "InsertLigature", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeLigature_fl"], "InsertLigature", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeLigature_ffi"], "InsertLigature", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeLigature_ffl"], "InsertLigature", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeLigature_ft"], "InsertLigature", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeLigature_st"], "InsertLigature", false);
-
-	scrMenuMgr->addMenuSeparator("Insert");
-	scrMenuMgr->addMenuItem(scrActions["insertSampleText"], "Insert", false);
-	scrMenuMgr->addMenuSeparator("Insert");
+	scrMenuMgr->addMenuItemString("InsertLigature", "Insert");
+	scrMenuMgr->addMenuItemString("unicodeLigature_ff", "InsertLigature");
+	scrMenuMgr->addMenuItemString("unicodeLigature_fi", "InsertLigature");
+	scrMenuMgr->addMenuItemString("unicodeLigature_fl", "InsertLigature");
+	scrMenuMgr->addMenuItemString("unicodeLigature_ffi", "InsertLigature");
+	scrMenuMgr->addMenuItemString("unicodeLigature_ffl", "InsertLigature");
+	scrMenuMgr->addMenuItemString("unicodeLigature_ft", "InsertLigature");
+	scrMenuMgr->addMenuItemString("unicodeLigature_st", "InsertLigature");
+
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Insert");
+	scrMenuMgr->addMenuItemString("insertSampleText", "Insert");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Insert");
 	scrMenuMgr->createMenu("InsertMark", tr("Marks"), "Insert");
-	scrMenuMgr->addMenuItem(scrActions["insertMarkAnchor"], "InsertMark", false);
-	scrMenuMgr->addMenuItem(scrActions["insertMarkVariableText"], "InsertMark", false);
-	scrMenuMgr->addMenuItem(scrActions["insertMarkItem"], "InsertMark", false);
-	scrMenuMgr->addMenuItem(scrActions["insertMark2Mark"], "InsertMark", false);
-	scrMenuMgr->addMenuItem(scrActions["insertMarkNote"], "InsertMark", false);
-//	scrMenuMgr->addMenuItem(scrActions["insertMarkIndex"], "InsertMark", false);
+	scrMenuMgr->addMenuItemString("InsertMark", "Insert");
+	scrMenuMgr->addMenuItemString("insertMarkAnchor", "InsertMark");
+	scrMenuMgr->addMenuItemString("insertMarkVariableText", "InsertMark");
+	scrMenuMgr->addMenuItemString("insertMarkItem", "InsertMark");
+	scrMenuMgr->addMenuItemString("insertMark2Mark", "InsertMark");
+	scrMenuMgr->addMenuItemString("insertMarkNote", "InsertMark");
 
 	//Page menu
 	scrMenuMgr->createMenu("Page", ActionManager::defaultMenuNameEntryTranslated("Page"));
-	scrMenuMgr->addMenuItem(scrActions["pageInsert"], "Page", false);
-	scrMenuMgr->addMenuItem(scrActions["pageImport"], "Page", false);
-	scrMenuMgr->addMenuItem(scrActions["pageDelete"], "Page", false);
-	scrMenuMgr->addMenuItem(scrActions["pageCopy"], "Page", false);
-	scrMenuMgr->addMenuItem(scrActions["pageMove"], "Page", false);
-	scrMenuMgr->addMenuSeparator("Page");
-	scrMenuMgr->addMenuItem(scrActions["pageApplyMasterPage"], "Page", false);
-	scrMenuMgr->addMenuItem(scrActions["pageCopyToMasterPage"], "Page", false);
-	scrMenuMgr->addMenuItem(scrActions["pageManageGuides"], "Page", false);
-	scrMenuMgr->addMenuItem(scrActions["pageManageMargins"], "Page", false);
-	scrMenuMgr->addMenuSeparator("Page");
-	scrMenuMgr->addMenuItem(scrActions["viewSnapToGrid"], "Page", true);
-	scrMenuMgr->addMenuItem(scrActions["viewSnapToGuides"], "Page", true);
-	scrMenuMgr->addMenuItem(scrActions["viewSnapToElements"], "Page", true);
+	scrMenuMgr->addMenuItemString("pageInsert", "Page");
+	scrMenuMgr->addMenuItemString("pageImport", "Page");
+	scrMenuMgr->addMenuItemString("pageDelete", "Page");
+	scrMenuMgr->addMenuItemString("pageCopy", "Page");
+	scrMenuMgr->addMenuItemString("pageMove", "Page");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Page");
+	scrMenuMgr->addMenuItemString("pageApplyMasterPage", "Page");
+	scrMenuMgr->addMenuItemString("pageCopyToMasterPage", "Page");
+	scrMenuMgr->addMenuItemString("pageManageGuides", "Page");
+	scrMenuMgr->addMenuItemString("pageManageMargins", "Page");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Page");
+	scrMenuMgr->addMenuItemString("viewSnapToGrid", "Page");
+	scrMenuMgr->addMenuItemString("viewSnapToGuides", "Page");
+	scrMenuMgr->addMenuItemString("viewSnapToElements", "Page");
 
 	//View menu
 	scrMenuMgr->createMenu("View", ActionManager::defaultMenuNameEntryTranslated("View"));
 	scrMenuMgr->createMenu("ViewZoom", tr("Zoom"), "View");
-	scrMenuMgr->addMenuItem(scrActions["viewFitInWindow"], "ViewZoom", false);
-	scrMenuMgr->addMenuItem(scrActions["viewFitWidth"], "ViewZoom", false);
-	scrMenuMgr->addMenuItem(scrActions["viewFit50"], "ViewZoom", false);
-	scrMenuMgr->addMenuItem(scrActions["viewFit75"], "ViewZoom", false);
-	scrMenuMgr->addMenuItem(scrActions["viewFit100"], "ViewZoom", false);
-	scrMenuMgr->addMenuItem(scrActions["viewFit200"], "ViewZoom", false);
-	scrMenuMgr->addMenuItem(scrActions["viewFit400"], "ViewZoom", false);
+	scrMenuMgr->addMenuItemString("ViewZoom", "View");
+	scrMenuMgr->addMenuItemString("viewFitInWindow", "ViewZoom");
+	scrMenuMgr->addMenuItemString("viewFitWidth", "ViewZoom");
+	scrMenuMgr->addMenuItemString("viewFit50", "ViewZoom");
+	scrMenuMgr->addMenuItemString("viewFit75", "ViewZoom");
+	scrMenuMgr->addMenuItemString("viewFit100", "ViewZoom");
+	scrMenuMgr->addMenuItemString("viewFit200", "ViewZoom");
+	scrMenuMgr->addMenuItemString("viewFit400", "ViewZoom");
 	scrMenuMgr->createMenu("ViewPreview", tr("Preview"), "View");
-	scrMenuMgr->addMenuItem(scrActions["viewPreviewMode"], "ViewPreview", true);
+	scrMenuMgr->addMenuItemString("ViewPreview", "View");
+	scrMenuMgr->addMenuItemString("viewPreviewMode", "ViewPreview");
 	scrMenuMgr->createMenu("ViewMeasuring", tr("Measures"), "View");
-	scrMenuMgr->addMenuItem(scrActions["viewShowRulers"], "ViewMeasuring", false);
-	scrMenuMgr->addMenuItem(scrActions["viewRulerMode"], "ViewMeasuring", true);
-	scrMenuMgr->addMenuItem(scrActions["showMouseCoordinates"], "ViewMeasuring", true);
+	scrMenuMgr->addMenuItemString("ViewMeasuring", "View");
+	scrMenuMgr->addMenuItemString("viewShowRulers", "ViewMeasuring");
+	scrMenuMgr->addMenuItemString("viewRulerMode", "ViewMeasuring");
+	scrMenuMgr->addMenuItemString("showMouseCoordinates", "ViewMeasuring");
 	scrMenuMgr->createMenu("ViewTextFrames", tr("Text Frames"), "View");
-	scrMenuMgr->addMenuItem(scrActions["viewShowBaseline"], "ViewTextFrames", true);
-	scrMenuMgr->addMenuItem(scrActions["viewShowColumnBorders"], "ViewTextFrames", true);
-	scrMenuMgr->addMenuItem(scrActions["viewShowTextChain"], "ViewTextFrames", true);
-	scrMenuMgr->addMenuItem(scrActions["viewShowTextControls"], "ViewTextFrames", true);
+	scrMenuMgr->addMenuItemString("ViewTextFrames", "View");
+	scrMenuMgr->addMenuItemString("viewShowBaseline", "ViewTextFrames");
+	scrMenuMgr->addMenuItemString("viewShowColumnBorders", "ViewTextFrames");
+	scrMenuMgr->addMenuItemString("viewShowTextChain", "ViewTextFrames");
+	scrMenuMgr->addMenuItemString("viewShowTextControls", "ViewTextFrames");
 	scrMenuMgr->createMenu("ViewImageFrames", tr("Image Frames"), "View");
-	scrMenuMgr->addMenuItem(scrActions["viewShowImages"], "ViewImageFrames", true);
+	scrMenuMgr->addMenuItemString("ViewImageFrames", "View");
+	scrMenuMgr->addMenuItemString("viewShowImages", "ViewImageFrames");
 	scrMenuMgr->createMenu("ViewDocument", tr("Document"), "View");
-	scrMenuMgr->addMenuItem(scrActions["viewShowMargins"], "ViewDocument", true);
-	scrMenuMgr->addMenuItem(scrActions["viewShowBleeds"], "ViewDocument", true);
-	scrMenuMgr->addMenuItem(scrActions["viewShowFrames"], "ViewDocument", true);
-	scrMenuMgr->addMenuItem(scrActions["viewShowLayerMarkers"], "ViewDocument", true);
+	scrMenuMgr->addMenuItemString("ViewDocument", "View");
+	scrMenuMgr->addMenuItemString("viewShowMargins", "ViewDocument");
+	scrMenuMgr->addMenuItemString("viewShowBleeds", "ViewDocument");
+	scrMenuMgr->addMenuItemString("viewShowFrames", "ViewDocument");
+	scrMenuMgr->addMenuItemString("viewShowLayerMarkers", "ViewDocument");
 	scrMenuMgr->createMenu("ViewGrids", tr("Grids and Guides"), "View");
-	scrMenuMgr->addMenuItem(scrActions["viewShowGrid"], "ViewGrids", true);
-	scrMenuMgr->addMenuItem(scrActions["viewShowGuides"], "ViewGrids", true);
+	scrMenuMgr->addMenuItemString("ViewGrids", "View");
+	scrMenuMgr->addMenuItemString("viewShowGrid", "ViewDocument");
+	scrMenuMgr->addMenuItemString("viewShowGuides", "ViewDocument");
 
 	//CB If this is viewNewView imeplemented, it should be on the windows menu
 //	scrMenuMgr->addMenuItem(scrActions["viewNewView"], "View");
 
 	// Table menu.
 	scrMenuMgr->createMenu("ItemTable", ActionManager::defaultMenuNameEntryTranslated("Table"));
-	scrMenuMgr->addMenuItem(scrActions["tableInsertRows"], "ItemTable", false);
-	scrMenuMgr->addMenuItem(scrActions["tableInsertColumns"], "ItemTable", false);
-	scrMenuMgr->addMenuItem(scrActions["tableDeleteRows"], "ItemTable", false);
-	scrMenuMgr->addMenuItem(scrActions["tableDeleteColumns"], "ItemTable", false);
+	scrMenuMgr->addMenuItemString("tableInsertRows", "ItemTable");
+	scrMenuMgr->addMenuItemString("tableInsertColumns", "ItemTable");
+	scrMenuMgr->addMenuItemString("tableDeleteRows", "ItemTable");
+	scrMenuMgr->addMenuItemString("tableDeleteColumns", "ItemTable");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "ItemTable");
+	scrMenuMgr->addMenuItemString("tableMergeCells", "ItemTable");
+	scrMenuMgr->addMenuItemString("tableSplitCells", "ItemTable");
 	scrMenuMgr->addMenuSeparator("ItemTable");
-	scrMenuMgr->addMenuItem(scrActions["tableMergeCells"], "ItemTable", false);
-	scrMenuMgr->addMenuItem(scrActions["tableSplitCells"], "ItemTable", false);
+	scrMenuMgr->addMenuItemString("SEPARATOR", "ItemTable");
+	scrMenuMgr->addMenuItemString("tableSetRowHeights", "ItemTable");
+	scrMenuMgr->addMenuItemString("tableSetColumnWidths", "ItemTable");
+	scrMenuMgr->addMenuItemString("tableDistributeRowsEvenly", "ItemTable");
+	scrMenuMgr->addMenuItemString("tableDistributeColumnsEvenly", "ItemTable");
 	scrMenuMgr->addMenuSeparator("ItemTable");
-	scrMenuMgr->addMenuItem(scrActions["tableSetRowHeights"], "ItemTable", false);
-	scrMenuMgr->addMenuItem(scrActions["tableSetColumnWidths"], "ItemTable", false);
-	scrMenuMgr->addMenuItem(scrActions["tableDistributeRowsEvenly"], "ItemTable", false);
-	scrMenuMgr->addMenuItem(scrActions["tableDistributeColumnsEvenly"], "ItemTable", false);
-	scrMenuMgr->addMenuSeparator("ItemTable");
-	scrMenuMgr->addMenuItem(scrActions["tableAdjustFrameToTable"], "ItemTable", false);
-	scrMenuMgr->addMenuItem(scrActions["tableAdjustTableToFrame"], "ItemTable", false);
+	scrMenuMgr->addMenuItemString("SEPARATOR", "ItemTable");
+	scrMenuMgr->addMenuItemString("tableAdjustFrameToTable", "ItemTable");
+	scrMenuMgr->addMenuItemString("tableAdjustTableToFrame", "ItemTable");
 
 	//Extra menu
 	scrMenuMgr->createMenu("Extras", ActionManager::defaultMenuNameEntryTranslated("Extras"));
-	scrMenuMgr->addMenuItem(scrActions["extrasManageImages"], "Extras", false);
-	scrMenuMgr->addMenuItem(scrActions["extrasHyphenateText"], "Extras", false);
-	scrMenuMgr->addMenuItem(scrActions["extrasDeHyphenateText"], "Extras", false);
-	scrMenuMgr->addMenuItem(scrActions["extrasGenerateTableOfContents"], "Extras", false);
-	scrMenuMgr->addMenuItem(scrActions["extrasUpdateDocument"], "Extras", false);
-	scrMenuMgr->addMenuItem(scrActions["itemUpdateMarks"], "Extras", true);
-	scrMenuMgr->addMenuItem(scrActions["extrasTestQTQuick2_1"], "Extras", true);
+	scrMenuMgr->addMenuItemString("extrasManageImages", "Extras");
+	scrMenuMgr->addMenuItemString("extrasHyphenateText", "Extras");
+	scrMenuMgr->addMenuItemString("extrasDeHyphenateText", "Extras");
+	scrMenuMgr->addMenuItemString("extrasGenerateTableOfContents", "Extras");
+	scrMenuMgr->addMenuItemString("extrasUpdateDocument", "Extras");
+	scrMenuMgr->addMenuItemString("itemUpdateMarks", "Extras");
+	scrMenuMgr->addMenuItemString("extrasTestQTQuick2_1", "Extras");
 	connect(scrMenuMgr->getLocalPopupMenu("Extras"), SIGNAL(aboutToShow()), this, SLOT(extrasMenuAboutToShow()));
 
 	//Window menu
 	scrMenuMgr->createMenu("Windows", ActionManager::defaultMenuNameEntryTranslated("Windows"), QString::null, true);
-	connect(scrMenuMgr->getLocalPopupMenu("Windows"), SIGNAL(aboutToShow()), this, SLOT(windowsMenuAboutToShow()));
-	addDefaultWindowMenuItems();
+	//connect(scrMenuMgr->getLocalPopupMenu("Windows"), SIGNAL(aboutToShow()), this, SLOT(windowsMenuAboutToShow()));
+	//addDefaultWindowMenuItems();
 
 	//Help menu
 	scrMenuMgr->createMenu("Help", ActionManager::defaultMenuNameEntryTranslated("Help"));
-	scrMenuMgr->addMenuItem(scrActions["helpManual"], "Help", true);
-	//scrMenuMgr->addMenuItem(scrActions["helpManual2"], "Help", true);
-	scrMenuMgr->addMenuSeparator("Help");
-	scrMenuMgr->addMenuItem(scrActions["helpTooltips"], "Help", true);
-	scrMenuMgr->addMenuSeparator("Help");
-	scrMenuMgr->addMenuItem(scrActions["helpOnlineWWW"], "Help", true);
-	scrMenuMgr->addMenuItem(scrActions["helpOnlineDocs"], "Help", true);
-	scrMenuMgr->addMenuItem(scrActions["helpOnlineWiki"], "Help", true);
-	scrMenuMgr->createMenu("HelpOnlineTutorials", tr("Online &Tutorials"), "Help");
-	scrMenuMgr->addMenuItem(scrActions["helpOnlineTutorial1"], "HelpOnlineTutorials", true);
-	scrMenuMgr->addMenuSeparator("Help");
-	scrMenuMgr->addMenuItem(scrActions["helpCheckUpdates"], "Help", true);
-	scrMenuMgr->addMenuSeparator("Help");
-	scrMenuMgr->addMenuItem(scrActions["helpAboutScribus"], "Help", true);
-	scrMenuMgr->addMenuItem(scrActions["helpAboutPlugins"], "Help", true);
-	scrMenuMgr->addMenuItem(scrActions["helpAboutQt"], "Help", true);
-
-	scrMenuMgr->addMenuToMenuBar("File");
-	scrMenuMgr->addMenuToMenuBar("Edit");
-	scrMenuMgr->addMenuToMenuBar("Item");
-	scrMenuMgr->addMenuToMenuBar("Insert");
-	scrMenuMgr->addMenuToMenuBar("Page");
-	scrMenuMgr->addMenuToMenuBar("ItemTable");
-	scrMenuMgr->addMenuToMenuBar("Extras");
-	scrMenuMgr->addMenuToMenuBar("View");
-	scrMenuMgr->addMenuToMenuBar("Windows");
+	scrMenuMgr->addMenuItemString("helpManual", "Help");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Help");
+	scrMenuMgr->addMenuItemString("helpTooltips", "Help");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Help");
+	scrMenuMgr->addMenuItemString("helpOnlineWWW", "Help");
+	scrMenuMgr->addMenuItemString("helpOnlineDocs", "Help");
+	scrMenuMgr->addMenuItemString("helpOnlineWiki", "Help");
+	scrMenuMgr->addMenuItemString("HelpOnlineTutorials", "Help");
+	scrMenuMgr->addMenuItemString("helpOnlineTutorial1", "Help");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Help");
+	scrMenuMgr->addMenuItemString("helpCheckUpdates", "Help");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Help");
+	scrMenuMgr->addMenuItemString("helpAboutScribus", "Help");
+	scrMenuMgr->addMenuItemString("helpAboutPlugins", "Help");
+	scrMenuMgr->addMenuItemString("helpAboutQt", "Help");
+
+	scrMenuMgr->addMenuStringToMenuBar("File");
+	scrMenuMgr->addMenuItemStringstoMenuBar("File", scrActions);
+	scrMenuMgr->addMenuStringToMenuBar("Edit");
+	scrMenuMgr->addMenuItemStringstoMenuBar("Edit", scrActions);
+	scrMenuMgr->addMenuStringToMenuBar("Item");
+	scrMenuMgr->addMenuItemStringstoMenuBar("Item", scrActions);
+	scrMenuMgr->addMenuStringToMenuBar("Insert");
+	scrMenuMgr->addMenuItemStringstoMenuBar("Insert", scrActions);
+	scrMenuMgr->addMenuStringToMenuBar("Page");
+	scrMenuMgr->addMenuItemStringstoMenuBar("Page", scrActions);
+	scrMenuMgr->addMenuStringToMenuBar("ItemTable");
+	scrMenuMgr->addMenuItemStringstoMenuBar("ItemTable", scrActions);
+	scrMenuMgr->addMenuStringToMenuBar("Extras");
+	scrMenuMgr->addMenuItemStringstoMenuBar("Extras", scrActions);
+	scrMenuMgr->addMenuStringToMenuBar("View");
+	scrMenuMgr->addMenuItemStringstoMenuBar("View", scrActions);
+	scrMenuMgr->addMenuStringToMenuBar("Windows");
+	addDefaultWindowMenuItems();
 	menuBar()->addSeparator();
-	scrMenuMgr->addMenuToMenuBar("Help");
+	scrMenuMgr->addMenuStringToMenuBar("Help");
+	scrMenuMgr->addMenuItemStringstoMenuBar("Help", scrActions);
+//	scrMenuMgr->addMenuToMenuBar("File");
+//	scrMenuMgr->addMenuToMenuBar("Edit");
+//	scrMenuMgr->addMenuToMenuBar("Item");
+//	scrMenuMgr->addMenuToMenuBar("Insert");
+//	scrMenuMgr->addMenuToMenuBar("Page");
+//	scrMenuMgr->addMenuToMenuBar("ItemTable");
+//	scrMenuMgr->addMenuToMenuBar("Extras");
+//	scrMenuMgr->addMenuToMenuBar("View");
+//	scrMenuMgr->addMenuToMenuBar("Windows");
+	menuBar()->addSeparator();
+//	scrMenuMgr->addMenuToMenuBar("Help");
+
+	scrMenuMgr->dumpMenuStrings();
 }
 
 
 void ScribusMainWindow::addDefaultWindowMenuItems()
 {
 	scrMenuMgr->clearMenu("Windows");
-	scrMenuMgr->addMenuItem(scrActions["windowsCascade"], "Windows", true);
-	scrMenuMgr->addMenuItem(scrActions["windowsTile"], "Windows", true);
+	scrMenuMgr->addMenuItemString("windowsCascade", "Windows");
+	scrMenuMgr->addMenuItemString("windowsTile", "Windows");
 	scrMenuMgr->addMenuSeparator("Windows");
-	scrMenuMgr->addMenuItem(scrActions["toolsProperties"], "Windows", true);
-	scrMenuMgr->addMenuItem(scrActions["toolsActionHistory"], "Windows", true);
-	scrMenuMgr->addMenuItem(scrActions["toolsAlignDistribute"], "Windows", true);
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Windows");
+	scrMenuMgr->addMenuItemString("toolsProperties", "Windows");
+	scrMenuMgr->addMenuItemString("toolsActionHistory", "Windows");
+	scrMenuMgr->addMenuItemString("toolsAlignDistribute", "Windows");
 	scrMenuMgr->addMenuSeparator("Windows");
-	scrMenuMgr->addMenuItem(scrActions["toolsOutline"], "Windows", true);
-	scrMenuMgr->addMenuItem(scrActions["toolsPages"], "Windows", true);
-	scrMenuMgr->addMenuItem(scrActions["toolsLayers"], "Windows", true);
-	scrMenuMgr->addMenuItem(scrActions["toolsBookmarks"], "Windows", true);
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Windows");
+	scrMenuMgr->addMenuItemString("toolsOutline", "Windows");
+	scrMenuMgr->addMenuItemString("toolsPages", "Windows");
+	scrMenuMgr->addMenuItemString("toolsLayers", "Windows");
+	scrMenuMgr->addMenuItemString("toolsBookmarks", "Windows");
 	scrMenuMgr->addMenuSeparator("Windows");
-	scrMenuMgr->addMenuItem(scrActions["toolsScrapbook"], "Windows", true);
-	scrMenuMgr->addMenuItem(scrActions["toolsSymbols"], "Windows", true);
-	scrMenuMgr->addMenuItem(scrActions["toolsInline"], "Windows", true);
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Windows");
+	scrMenuMgr->addMenuItemString("toolsScrapbook", "Windows");
+	scrMenuMgr->addMenuItemString("toolsSymbols", "Windows");
+	scrMenuMgr->addMenuItemString("toolsInline", "Windows");
 	scrMenuMgr->addMenuSeparator("Windows");
-	scrMenuMgr->addMenuItem(scrActions["toolsMeasurements"], "Windows", true);
-	scrMenuMgr->addMenuItem(scrActions["toolsPreflightVerifier"], "Windows", true);
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Windows");
+	scrMenuMgr->addMenuItemString("toolsMeasurements", "Windows");
+	scrMenuMgr->addMenuItemString("toolsPreflightVerifier", "Windows");
 	scrMenuMgr->addMenuSeparator("Windows");
-	scrMenuMgr->addMenuItem(scrActions["toolsToolbarTools"], "Windows", true);
-	scrMenuMgr->addMenuItem(scrActions["toolsToolbarPDF"], "Windows", true);
+	scrMenuMgr->addMenuItemString("SEPARATOR", "Windows");
+	scrMenuMgr->addMenuItemString("toolsToolbarTools", "Windows");
+	scrMenuMgr->addMenuItemString("toolsToolbarPDF", "Windows");
+	scrMenuMgr->addMenuItemStringstoMenuBar("Windows", scrActions);
 }
 
 
@@ -2163,8 +2220,8 @@
 
 void ScribusMainWindow::windowsMenuAboutToShow()
 {
-	for( QMap<QString, QPointer<ScrAction> >::Iterator it = scrWindowsActions.begin(); it!=scrWindowsActions.end(); ++it )
-		scrMenuMgr->removeMenuItem((*it), "Windows");
+	//for( QMap<QString, QPointer<ScrAction> >::Iterator it = scrWindowsActions.begin(); it!=scrWindowsActions.end(); ++it )
+	//	scrMenuMgr->removeMenuItem((*it), "Windows");
 	scrWindowsActions.clear();
 	addDefaultWindowMenuItems();
 	QList<QMdiSubWindow *> windows = mdiArea->subWindowList();
@@ -2175,17 +2232,19 @@
 	{
 		int windowCount=static_cast<int>(windows.count());
 		if (windowCount>1)
-			scrMenuMgr->addMenuSeparator("Windows");
+			scrMenuMgr->addMenuItemString("SEPARATOR", "Windows");
 		for ( int i = 0; i < windowCount; ++i )
 		{
 			QString docInWindow(windows.at(i)->windowTitle());
 			scrWindowsActions.insert(docInWindow, new ScrAction( ScrAction::Window, QPixmap(), QPixmap(), docInWindow, QKeySequence(), this, i));
 			scrWindowsActions[docInWindow]->setToggleAction(true);
 			connect( scrWindowsActions[docInWindow], SIGNAL(triggeredData(int)), this, SLOT(windowsMenuActivated(int)) );
-			if (windowCount>1)
-				scrMenuMgr->addMenuItem(scrWindowsActions[docInWindow], "Windows", true);
+//			if (windowCount>1)
+//				scrMenuMgr->addMenuItem(scrWindowsActions[docInWindow], "Windows", true);
 			scrWindowsActions[docInWindow]->setChecked(mdiArea->activeSubWindow() == windows.at(i));
 		}
+		if (windowCount>1)
+			scrMenuMgr->addMenuItemStringstoSpecialMenu("Windows", scrWindowsActions);
 	}
 }
 
@@ -3490,6 +3549,7 @@
 
 void ScribusMainWindow::rebuildRecentFileMenu()
 {
+	scrMenuMgr->clearMenuStrings("FileOpenRecent");
 	for( QMap<QString, QPointer<ScrAction> >::Iterator it = scrRecentFileActions.begin(); it!=scrRecentFileActions.end(); ++it )
 		scrMenuMgr->removeMenuItem((*it), "FileOpenRecent");
 
@@ -3500,10 +3560,12 @@
 	{
 		strippedName = localName = QDir::toNativeSeparators(RecentDocs[m]);
 		strippedName.remove(QDir::separator());
-		scrRecentFileActions.insert(strippedName, new ScrAction(ScrAction::RecentFile, QPixmap(), QPixmap(), QString("&%1 %2").arg(m+1).arg(localName.replace("&","&&")), QKeySequence(), this, 0,0.0,RecentDocs[m]));
+		scrRecentFileActions.insert(strippedName, new ScrAction(ScrAction::RecentFile, QPixmap(), QPixmap(), QString("&%1").arg(localName.replace("&","&&")), QKeySequence(), this, 0,0.0,RecentDocs[m]));
 		connect( scrRecentFileActions[strippedName], SIGNAL(triggeredData(QString)), this, SLOT(loadRecent(QString)) );
-		scrMenuMgr->addMenuItem(scrRecentFileActions[strippedName], "FileOpenRecent", true);
-	}
+//		scrMenuMgr->addMenuItem(scrRecentFileActions[strippedName], "FileOpenRecent", true);
+
+	}
+	scrMenuMgr->addMenuItemStringstoSpecialMenu("FileOpenRecent", scrRecentFileActions);
 }
 
 void ScribusMainWindow::rebuildRecentPasteMenu()

Modified: trunk/Scribus/scribus/ui/scmenu.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18533&path=/trunk/Scribus/scribus/ui/scmenu.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scmenu.cpp (original)
+++ trunk/Scribus/scribus/ui/scmenu.cpp Tue Oct  8 22:11:51 2013
@@ -18,6 +18,8 @@
  *   (at your option) any later version.                                   *
  *                                                                         *
  ***************************************************************************/
+
+#include <QDebug>
 #include <QObject>
 #include <QMetaObject>
 #include <QMenu>
@@ -143,7 +145,7 @@
 		bool menuListHasNoIcons = true;
 		// look for ScrAction or ScrPopupMenu from the end of the list
 //		QList< QPointer<QObject> >::Iterator it = menuItemList.end();
-		int s=menuItemList.size()-1; 
+		int s=menuItemList.size()-1;
 		for (int i=s; i>=0; --i) {
 			QObject* menuItem = menuItemList[i];
 			QString menuItemListClassName = menuItemList[i]->metaObject()->className();
@@ -298,6 +300,7 @@
 				ScrPopupMenu * men = dynamic_cast<ScrPopupMenu *>(listObj);
 				if (men!=NULL)
 				{
+					//qDebug()<<men->localPopupMenu->title()<<men->localPopupMenu->;
 // 					localPopupMenu->insertItem(men->getMenuIcon(), men->getMenuText(), men->getLocalPopupMenu());
 					QAction *m=localPopupMenu->addMenu(men->getLocalPopupMenu());
 					if (m)




More information about the scribus-commit mailing list