r18870 by craig - #12105: Fix scrapbook menu creation

scribus-commit scribus-commit at lists.scribus.net
Mon Mar 3 22:22:05 UTC 2014


Author: craig
Date: Mon Mar  3 22:22:05 2014
New Revision: 18870

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18870
Log:
#12105: Fix scrapbook menu creation

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

Modified: trunk/Scribus/scribus/menumanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18870&path=/trunk/Scribus/scribus/menumanager.cpp
==============================================================================
--- trunk/Scribus/scribus/menumanager.cpp (original)
+++ trunk/Scribus/scribus/menumanager.cpp Mon Mar  3 22:22:05 2014
@@ -215,7 +215,9 @@
 	if (rememberedMenus.contains(menuName))
 	{
 		if (rememberedMenus.value(menuName)!=NULL)
+		{
 			rememberedMenus.value(menuName)->clear();
+		}
 	}
 }
 

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18870&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Mon Mar  3 22:22:05 2014
@@ -3281,18 +3281,7 @@
 	{
 		actionManager->setPDFActions(view);
 		updateItemLayerList();
-		QStringList scrapNames = scrapbookPalette->getOpenScrapbooksNames();
-		scrapNames.removeAt(1);
-		scrMenuMgr->clearMenuStrings("ItemSendToScrapbook");
-		scrScrapActions.clear();
-		for (int i = 0; i < scrapNames.count(); i++)
-		{
-			ScrAction *act = new ScrAction( ScrAction::DataInt, QPixmap(), QPixmap(), scrapNames[i], QKeySequence(), this, i);
-			scrScrapActions.insert(scrapNames[i], act);
-			connect(act, SIGNAL(triggeredData(int)), this, SLOT(PutScrap(int)));
-			scrMenuMgr->addMenuItemString(scrapNames[i], "ItemSendToScrapbook");
-		}
-		scrMenuMgr->addMenuItemStringstoRememberedMenu("ItemSendToScrapbook", scrScrapActions);
+		rebuildScrapbookMenu();
 
 		//propertiesPalette->textFlowsAroundFrame->setChecked(currItem->textFlowsAroundFrame());
 		propertiesPalette->setTextFlowMode(currItem->textFlowMode());
@@ -3559,6 +3548,25 @@
 		}
 		scrMenuMgr->addMenuItemStringstoRememberedMenu("EditPasteRecent", scrRecentPasteActions);
 	}
+}
+
+void ScribusMainWindow::rebuildScrapbookMenu()
+{
+	qDebug()<<"Clearing scrapbook menu";
+	scrMenuMgr->clearMenuStrings("ItemSendToScrapbook");
+	scrScrapActions.clear();
+	if (!HaveDoc)
+		return;
+	QStringList scrapNames = scrapbookPalette->getOpenScrapbooksNames();
+	scrapNames.removeAt(1);
+	for (int i = 0; i < scrapNames.count(); i++)
+	{
+		ScrAction *act = new ScrAction( ScrAction::DataInt, QPixmap(), QPixmap(), scrapNames[i], QKeySequence(), this, i);
+		scrScrapActions.insert(scrapNames[i], act);
+		connect(act, SIGNAL(triggeredData(int)), this, SLOT(PutScrap(int)));
+		scrMenuMgr->addMenuItemString(scrapNames[i], "ItemSendToScrapbook");
+	}
+	scrMenuMgr->addMenuItemStringstoRememberedMenu("ItemSendToScrapbook", scrScrapActions);
 }
 
 void ScribusMainWindow::pasteFromScrapbook(QString fn)
@@ -4850,6 +4858,7 @@
 	outlinePalette->unsetDoc();
 	alignDistributePalette->setDoc(NULL);
 	//>>
+
 	if ((mdiArea->subWindowList().isEmpty()) || (mdiArea->subWindowList().count() == 1))
 	{
 		PluginManager& pluginManager(PluginManager::instance());
@@ -5031,7 +5040,7 @@
 	}
 
 	updateTableMenuActions();
-
+	rebuildScrapbookMenu();
 	return true;
 }
 
@@ -9599,6 +9608,8 @@
 
 void ScribusMainWindow::PutScrap(int scID)
 {
+	if (!HaveDoc)
+		return;
 	ScriXmlDoc ss;
 	QString objectString = ss.WriteElem(doc, doc->m_Selection);
 	QDomDocument docu("scridoc");

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18870&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Mon Mar  3 22:22:05 2014
@@ -311,6 +311,7 @@
 	void loadRecent(QString fn);
 	void rebuildRecentFileMenu();
 	void rebuildRecentPasteMenu();
+	void rebuildScrapbookMenu();
 	void pasteRecent(QString fn);
 	void pasteFromScrapbook(QString fn);
 	void importVectorFile();




More information about the scribus-commit mailing list