r18557 by craig - More MenuManager cleanup, remove use of ScrPopMenu

scribus-commit scribus-commit at lists.scribus.net
Mon Oct 14 20:20:41 UTC 2013


Author: craig
Date: Mon Oct 14 20:20:41 2013
New Revision: 18557

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18557
Log:
More MenuManager cleanup, remove use of ScrPopMenu

Modified:
    trunk/Scribus/scribus/menumanager.cpp
    trunk/Scribus/scribus/menumanager.h
    trunk/Scribus/scribus/scribus.cpp

Modified: trunk/Scribus/scribus/menumanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18557&path=/trunk/Scribus/scribus/menumanager.cpp
==============================================================================
--- trunk/Scribus/scribus/menumanager.cpp (original)
+++ trunk/Scribus/scribus/menumanager.cpp Mon Oct 14 20:20:41 2013
@@ -29,7 +29,6 @@
 MenuManager::MenuManager(QMenuBar* mb, QObject *parent) : QObject(parent)
 {
 	scribusMenuBar=mb;
-	menuList.clear();
 	menuStrings.clear();
 	recentFileMenu=NULL;
 	editPasteRecentMenu=NULL;
@@ -52,13 +51,6 @@
 	QList<QString> menuEntries;
 	menuStrings.insert(menuName, menuEntries);
 	menuStringTexts.insert(menuName, menuText);
-	ScrPopupMenu *newMenu = new ScrPopupMenu(NULL, menuName, menuText, parent);
-	if (newMenu)
-	{
-		menuList.insert(menuName, newMenu);
-		if (!parent.isNull() && menuList[parent])
-			retVal=menuList[parent]->insertSubMenu(newMenu);
-	}
 	return retVal;
 }
 
@@ -281,25 +273,26 @@
 bool MenuManager::addMenuToWidgetOfAction(const QString &menuName, ScrAction *action)
 {
 	bool retVal=false;
-	if (menuList.contains(menuName) && menuList[menuName]!=NULL && action!=NULL)
-	{
-		/* //qt4 cb replace with qwidgetaction or similar
-		QWidget *w=action->getWidgetAddedTo();
-		if (w)
-		{
-			QString menuItemListClassName=w->className();
-			if (menuItemListClassName=="QToolButton")
-			{
-				QToolButton *toolButton=dynamic_cast<QToolButton *>(w);
-				if (toolButton!=NULL)
-				{
-					toolButton->setPopup(menuList[menuName]->getLocalPopupMenu());
-					retVal=true;
-				}
-			}
-		}
-		*/
-	}
+	/*if (menuList.contains(menuName) && menuList[menuName]!=NULL && action!=NULL)
+	{
+		 //qt4 cb replace with qwidgetaction or similar
+//		QWidget *w=action->getWidgetAddedTo();
+//		if (w)
+//		{
+//			QString menuItemListClassName=w->className();
+//			if (menuItemListClassName=="QToolButton")
+//			{
+//				QToolButton *toolButton=dynamic_cast<QToolButton *>(w);
+//				if (toolButton!=NULL)
+//				{
+//					toolButton->setPopup(menuList[menuName]->getLocalPopupMenu());
+//					retVal=true;
+//				}
+//			}
+//		}
+
+	}
+*/
 	return retVal;
 }
 
@@ -322,19 +315,23 @@
 bool MenuManager::removeMenuItem(ScrAction *menuAction, const QString &parent)
 {
 	bool retVal=false;
-	if (menuList.contains(parent) && menuList[parent]!=NULL)
+	/*
+	 if (menuList.contains(parent) && menuList[parent]!=NULL)
 		retVal=menuList[parent]->removeMenuItem(menuAction);
+	*/
 	return retVal;
 }
 
 void MenuManager::runMenuAtPos(const QString &menuName, const QPoint position)
 {
+	/*
 	if (menuList.contains(menuName) && menuList[menuName]!=NULL)
 	{	
 		QMenu *popupmenu=menuList[menuName]->getLocalPopupMenu();
 		if (popupmenu)
 			popupmenu->exec(position);
 	}
+	*/
 }
 
 // Used to generate a list of entries from the menu system into the keyboard shortcut manager

Modified: trunk/Scribus/scribus/menumanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18557&path=/trunk/Scribus/scribus/menumanager.h
==============================================================================
--- trunk/Scribus/scribus/menumanager.h (original)
+++ trunk/Scribus/scribus/menumanager.h Mon Oct 14 20:20:41 2013
@@ -35,7 +35,6 @@
 #include "scribusapi.h"
 #include "actionmanager.h"
 class ScrAction;
-class ScrPopupMenu;
 class ScribusMainWindow;
 
 /**
@@ -81,7 +80,6 @@
 
 private:
 	QMenuBar *scribusMenuBar;
-	QMap<QString, ScrPopupMenu *> menuList;
 
 	QMap<QString, QList<QString> > menuStrings;
 	QMap<QString, QString> menuStringTexts;

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18557&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Mon Oct 14 20:20:41 2013
@@ -281,6 +281,7 @@
 	mainWindowStatusLabel=0;
 	ExternalApp=0;
 #ifdef Q_OS_MAC
+	ScQApp->setAttribute(Qt::AA_DontShowIconsInMenus);
 	noIcon = loadIcon("noicon.xpm");
 #endif
 }
@@ -1076,11 +1077,9 @@
 	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();
 
 	//Help menu
@@ -1125,6 +1124,9 @@
 	menuBar()->addSeparator();
 	scrMenuMgr->addMenuStringToMenuBar("Help");
 	scrMenuMgr->addMenuItemStringstoMenuBar("Help", scrActions);
+	connect(scrMenuMgr->getLocalPopupMenu("Extras"), SIGNAL(aboutToShow()), this, SLOT(extrasMenuAboutToShow()));
+	connect(scrMenuMgr->getLocalPopupMenu("Windows"), SIGNAL(aboutToShow()), this, SLOT(windowsMenuAboutToShow()));
+
 }
 
 




More information about the scribus-commit mailing list