r19465 by jghali - #12637: fix inconsistent preview settings order in scribus menus

scribus-commit scribus-commit at lists.scribus.net
Sat Aug 30 14:02:53 UTC 2014


Author: jghali
Date: Sat Aug 30 14:02:53 2014
New Revision: 19465

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19465
Log:
#12637: fix inconsistent preview settings order in scribus menus

Modified:
    trunk/Scribus/scribus/actionmanager.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/contextmenu.cpp

Modified: trunk/Scribus/scribus/actionmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19465&path=/trunk/Scribus/scribus/actionmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/actionmanager.cpp (original)
+++ trunk/Scribus/scribus/actionmanager.cpp Sat Aug 30 14:02:53 2014
@@ -481,12 +481,12 @@
 	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
 	name="itemToggleInlineImage";
 	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
+	name="itemPreviewFull";
+	scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0));
+	name="itemPreviewNormal";
+	scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 1));
 	name="itemPreviewLow";
 	scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 2));
-	name="itemPreviewNormal";
-	scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 1));
-	name="itemPreviewFull";
-	scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0));
 	name="itemPDFIsBookmark";
 	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
 	(*scrActions)["itemPDFIsBookmark"]->setToggleAction(true);
@@ -499,9 +499,9 @@
 	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
 
 	(*scrActions)["itemImageIsVisible"]->setToggleAction(true);
+	(*scrActions)["itemPreviewFull"]->setToggleAction(true);
+	(*scrActions)["itemPreviewNormal"]->setToggleAction(true);
 	(*scrActions)["itemPreviewLow"]->setToggleAction(true);
-	(*scrActions)["itemPreviewNormal"]->setToggleAction(true);
-	(*scrActions)["itemPreviewFull"]->setToggleAction(true);
 	(*scrActions)["itemToggleInlineImage"]->setToggleAction(true);
 
 	name="itemShapeEdit";
@@ -1279,9 +1279,9 @@
 	disconnect( (*scrActions)["toolsZoomIn"], 0, 0, 0);
 	disconnect( (*scrActions)["toolsZoomOut"], 0, 0, 0);
 	disconnect( (*scrActions)["itemImageIsVisible"], 0, 0, 0);
+	disconnect( (*scrActions)["itemPreviewFull"], SIGNAL(triggeredData(int)), 0, 0 );
+	disconnect( (*scrActions)["itemPreviewNormal"], SIGNAL(triggeredData(int)), 0, 0 );
 	disconnect( (*scrActions)["itemPreviewLow"], SIGNAL(triggeredData(int)), 0, 0 );
-	disconnect( (*scrActions)["itemPreviewNormal"], SIGNAL(triggeredData(int)), 0,0 );
-	disconnect( (*scrActions)["itemPreviewFull"], SIGNAL(triggeredData(int)), 0, 0 );
 	disconnect( (*scrActions)["itemConvertToBezierCurve"], 0, 0, 0);
 	disconnect( (*scrActions)["itemConvertToImageFrame"], 0, 0, 0);
 	disconnect( (*scrActions)["itemConvertToOutlines"], 0, 0, 0);
@@ -1316,9 +1316,9 @@
 {
 	disconnect( (*scrActions)["itemImageIsVisible"], 0, 0, 0);
 	//Only disconnect triggeredData for data based actions or you will disconnect the internal signal
+	disconnect( (*scrActions)["itemPreviewFull"], SIGNAL(triggeredData(int)) , 0, 0);
+	disconnect( (*scrActions)["itemPreviewNormal"], SIGNAL(triggeredData(int)) , 0, 0);
 	disconnect( (*scrActions)["itemPreviewLow"], SIGNAL(triggeredData(int)) , 0, 0);
-	disconnect( (*scrActions)["itemPreviewNormal"], SIGNAL(triggeredData(int)) , 0, 0);
-	disconnect( (*scrActions)["itemPreviewFull"], SIGNAL(triggeredData(int)) , 0, 0);
 	disconnect( (*scrActions)["editClearContents"], 0, 0, 0);
 	disconnect( (*scrActions)["editTruncateContents"], 0, 0, 0);
 }
@@ -1326,9 +1326,9 @@
 void ActionManager::connectNewSelectionActions(ScribusView* /*currView*/, ScribusDoc* currDoc)
 {
 	connect( (*scrActions)["itemImageIsVisible"], SIGNAL(toggled(bool)), currDoc, SLOT(itemSelection_ToggleImageShown()) );
+	connect( (*scrActions)["itemPreviewFull"], SIGNAL(triggeredData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
+	connect( (*scrActions)["itemPreviewNormal"], SIGNAL(triggeredData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
 	connect( (*scrActions)["itemPreviewLow"], SIGNAL(triggeredData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
-	connect( (*scrActions)["itemPreviewNormal"], SIGNAL(triggeredData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
-	connect( (*scrActions)["itemPreviewFull"], SIGNAL(triggeredData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
 	connect( (*scrActions)["editClearContents"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_ClearItem()) );
 	connect( (*scrActions)["editTruncateContents"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_TruncateItem()) );
 }
@@ -1578,9 +1578,9 @@
 	(*scrActions)["itemAdjustImageToFrame"]->setTexts( tr("Adjust Image to Frame"));
 	(*scrActions)["itemToggleInlineImage"]->setTexts( tr("Embed Image"));
 	(*scrActions)["itemExtendedImageProperties"]->setTexts( tr("Extended Image Properties"));
+	(*scrActions)["itemPreviewFull"]->setTexts( tr("&Full Resolution"));
+	(*scrActions)["itemPreviewNormal"]->setTexts( tr("&Normal Resolution"));
 	(*scrActions)["itemPreviewLow"]->setTexts( tr("&Low Resolution"));
-	(*scrActions)["itemPreviewNormal"]->setTexts( tr("&Normal Resolution"));
-	(*scrActions)["itemPreviewFull"]->setTexts( tr("&Full Resolution"));
 	(*scrActions)["itemPDFIsBookmark"]->setTexts( tr("Is PDF &Bookmark"));
 	(*scrActions)["itemPDFIsAnnotation"]->setTexts( tr("Is PDF A&nnotation"));
 	(*scrActions)["itemPDFAnnotationProps"]->setTexts( tr("Annotation P&roperties"));
@@ -2118,9 +2118,9 @@
 		<< "itemAdjustImageToFrame" 
 		<< "itemToggleInlineImage" 
 		<< "itemExtendedImageProperties" 
+		<< "itemPreviewFull" 
+		<< "itemPreviewNormal" 
 		<< "itemPreviewLow" 
-		<< "itemPreviewNormal" 
-		<< "itemPreviewFull" 
 		<< "itemRaise" 
 		<< "itemLower" 
 		<< "itemRaiseToTop" 
@@ -2599,9 +2599,9 @@
 	(*scrActions)["itemAdjustImageToFrame"]->setEnabled(false);
 	(*scrActions)["itemExtendedImageProperties"]->setEnabled(false);
 	(*scrActions)["itemUpdateImage"]->setEnabled(false);
+	(*scrActions)["itemPreviewFull"]->setEnabled(false);
+	(*scrActions)["itemPreviewNormal"]->setEnabled(false);
 	(*scrActions)["itemPreviewLow"]->setEnabled(false);
-	(*scrActions)["itemPreviewNormal"]->setEnabled(false);
-	(*scrActions)["itemPreviewFull"]->setEnabled(false);
 	(*scrActions)["itemAttributes"]->setEnabled(false);
 	(*scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
 	(*scrActions)["itemPDFFieldProps"]->setEnabled(false);

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19465&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sat Aug 30 14:02:53 2014
@@ -867,9 +867,9 @@
 	scrMenuMgr->addMenuItemString("ItemPreviewSettings", "Image");
 	scrMenuMgr->addMenuItemString("itemImageIsVisible", "ItemPreviewSettings");
 	scrMenuMgr->addMenuItemString("SEPARATOR", "ItemPreviewSettings");
+	scrMenuMgr->addMenuItemString("itemPreviewFull", "ItemPreviewSettings");
+	scrMenuMgr->addMenuItemString("itemPreviewNormal", "ItemPreviewSettings");
 	scrMenuMgr->addMenuItemString("itemPreviewLow", "ItemPreviewSettings");
-	scrMenuMgr->addMenuItemString("itemPreviewNormal", "ItemPreviewSettings");
-	scrMenuMgr->addMenuItemString("itemPreviewFull", "ItemPreviewSettings");
 	scrMenuMgr->createMenu("ItemPDFOptions", tr("&PDF Options"));
 	scrMenuMgr->addMenuItemString("ItemPDFOptions", "Item");
 	scrMenuMgr->addMenuItemString("itemPDFIsAnnotation", "ItemPDFOptions");
@@ -2664,9 +2664,9 @@
 	scrActions["itemToggleInlineImage"]->setEnabled(SelectedType==PageItem::ImageFrame && currItem->PictureIsAvailable);
 	scrMenuMgr->setMenuEnabled("ItemPreviewSettings", SelectedType==PageItem::ImageFrame);
 	scrActions["itemImageIsVisible"]->setEnabled(SelectedType==PageItem::ImageFrame);
+	scrActions["itemPreviewFull"]->setEnabled(SelectedType==PageItem::ImageFrame);
+	scrActions["itemPreviewNormal"]->setEnabled(SelectedType==PageItem::ImageFrame);
 	scrActions["itemPreviewLow"]->setEnabled(SelectedType==PageItem::ImageFrame);
-	scrActions["itemPreviewNormal"]->setEnabled(SelectedType==PageItem::ImageFrame);
-	scrActions["itemPreviewFull"]->setEnabled(SelectedType==PageItem::ImageFrame);
 	scrActions["styleImageEffects"]->setEnabled(SelectedType==PageItem::ImageFrame && currItem->isRaster);
 	scrActions["editCopyContents"]->setEnabled(SelectedType==PageItem::ImageFrame && currItem->PictureIsAvailable);
 	scrActions["editPasteContents"]->setEnabled(SelectedType==PageItem::ImageFrame);
@@ -2681,9 +2681,9 @@
 	if (SelectedType!=PageItem::ImageFrame)
 	{
 		scrActions["itemImageIsVisible"]->setChecked(false);
+		scrActions["itemPreviewFull"]->setChecked(false);
+		scrActions["itemPreviewNormal"]->setChecked(false);
 		scrActions["itemPreviewLow"]->setChecked(false);
-		scrActions["itemPreviewNormal"]->setChecked(false);
-		scrActions["itemPreviewFull"]->setChecked(false);
 	}
 	if ((SelectedType==-1) || (SelectedType!=-1 && !currItem->asTextFrame()))
 		appModeHelper.enableTextActions(false);
@@ -2715,11 +2715,10 @@
 		scrActions["itemAdjustImageToFrame"]->setEnabled(false);
 		scrActions["itemExtendedImageProperties"]->setEnabled(false);
 		scrActions["itemUpdateImage"]->setEnabled(false);
+		scrActions["itemPreviewFull"]->setEnabled(false);
+		scrActions["itemPreviewNormal"]->setEnabled(false);
 		scrActions["itemPreviewLow"]->setEnabled(false);
-		scrActions["itemPreviewNormal"]->setEnabled(false);
-		scrActions["itemPreviewFull"]->setEnabled(false);
 		scrActions["itemAttributes"]->setEnabled(false);
-		scrActions["itemPreviewLow"]->setEnabled(false);
 //		scrMenuMgr->setMenuEnabled("Item", false);
 		//scrMenuMgr->setMenuEnabled("ItemShapes", false);
 //		scrMenuMgr->setMenuEnabled("ItemConvertTo", false);
@@ -2785,11 +2784,10 @@
 		scrActions["itemAdjustImageToFrame"]->setEnabled(true);
 		scrActions["itemExtendedImageProperties"]->setEnabled(currItem->pixm.imgInfo.valid);
 		scrActions["itemUpdateImage"]->setEnabled(true);
+		scrActions["itemPreviewFull"]->setEnabled(true);
+		scrActions["itemPreviewNormal"]->setEnabled(true);
 		scrActions["itemPreviewLow"]->setEnabled(true);
-		scrActions["itemPreviewNormal"]->setEnabled(true);
-		scrActions["itemPreviewFull"]->setEnabled(true);
 		scrActions["itemAttributes"]->setEnabled(true);
-		scrActions["itemPreviewLow"]->setEnabled(true);
 		scrActions["itemConvertToBezierCurve"]->setEnabled(false);
 		scrActions["itemConvertToImageFrame"]->setEnabled(false);
 		scrActions["itemConvertToOutlines"]->setEnabled(false);
@@ -2806,9 +2804,9 @@
 		scrActions["toolsCopyProperties"]->setEnabled(true);
 		scrActions["itemImageIsVisible"]->setChecked(currItem->imageShown());
 		scrActions["itemToggleInlineImage"]->setChecked(currItem->isImageInline());
+		scrActions["itemPreviewFull"]->setChecked(currItem->pixm.imgInfo.lowResType==scrActions["itemPreviewFull"]->actionInt());
+		scrActions["itemPreviewNormal"]->setChecked(currItem->pixm.imgInfo.lowResType==scrActions["itemPreviewNormal"]->actionInt());
 		scrActions["itemPreviewLow"]->setChecked(currItem->pixm.imgInfo.lowResType==scrActions["itemPreviewLow"]->actionInt());
-		scrActions["itemPreviewNormal"]->setChecked(currItem->pixm.imgInfo.lowResType==scrActions["itemPreviewNormal"]->actionInt());
-		scrActions["itemPreviewFull"]->setChecked(currItem->pixm.imgInfo.lowResType==scrActions["itemPreviewFull"]->actionInt());
 
 		break;
 	case PageItem::TextFrame: //Text Frame
@@ -2841,11 +2839,10 @@
 		scrActions["itemAdjustImageToFrame"]->setEnabled(false);
 		scrActions["itemExtendedImageProperties"]->setEnabled(false);
 		scrActions["itemUpdateImage"]->setEnabled(false);
+		scrActions["itemPreviewFull"]->setEnabled(false);
+		scrActions["itemPreviewNormal"]->setEnabled(false);
 		scrActions["itemPreviewLow"]->setEnabled(false);
-		scrActions["itemPreviewNormal"]->setEnabled(false);
-		scrActions["itemPreviewFull"]->setEnabled(false);
 		scrActions["itemAttributes"]->setEnabled(true);
-		scrActions["itemPreviewLow"]->setEnabled(false);
 		scrMenuMgr->setMenuEnabled("ItemConvertTo", !((doc->appMode == modeEdit) || (currItem->isAnnotation())));
 		scrActions["itemConvertToBezierCurve"]->setEnabled(false);
 		scrActions["itemConvertToImageFrame"]->setEnabled(doc->appMode != modeEdit);
@@ -2961,11 +2958,10 @@
 		scrActions["itemAdjustImageToFrame"]->setEnabled(false);
 		scrActions["itemExtendedImageProperties"]->setEnabled(false);
 		scrActions["itemUpdateImage"]->setEnabled(false);
+		scrActions["itemPreviewFull"]->setEnabled(false);
+		scrActions["itemPreviewNormal"]->setEnabled(false);
 		scrActions["itemPreviewLow"]->setEnabled(false);
-		scrActions["itemPreviewNormal"]->setEnabled(false);
-		scrActions["itemPreviewFull"]->setEnabled(false);
 		scrActions["itemAttributes"]->setEnabled(true);
-		scrActions["itemPreviewLow"]->setEnabled(false);
 		//scrMenuMgr->setMenuEnabled("ItemShapes", false);
 		scrActions["itemDetachTextFromPath"]->setEnabled(true);
 //		scrMenuMgr->setMenuEnabled("ItemConvertTo", true);
@@ -3029,11 +3025,10 @@
 		scrActions["itemAdjustImageToFrame"]->setEnabled(false);
 		scrActions["itemExtendedImageProperties"]->setEnabled(false);
 		scrActions["itemUpdateImage"]->setEnabled(false);
-		scrActions["itemPreviewLow"]->setEnabled(false);
+		scrActions["itemPreviewFull"]->setEnabled(false);
 		scrActions["itemPreviewNormal"]->setEnabled(false);
-		scrActions["itemPreviewFull"]->setEnabled(true);
+		scrActions["itemPreviewLow"]->setEnabled(true);
 		scrActions["itemAttributes"]->setEnabled(true);
-		scrActions["itemPreviewLow"]->setEnabled(true);
 		if (SelectedType == PageItem::Polygon) //Polygon
 		{
 			scrMenuMgr->setMenuEnabled("ItemConvertTo", true);
@@ -6474,9 +6469,9 @@
 				scrActions["itemAdjustImageToFrame"]->setEnabled(true);
 				scrActions["itemExtendedImageProperties"]->setEnabled(true);
 				scrActions["itemUpdateImage"]->setEnabled(true);
+				scrActions["itemPreviewFull"]->setEnabled(true);
+				scrActions["itemPreviewNormal"]->setEnabled(true);
 				scrActions["itemPreviewLow"]->setEnabled(true);
-				scrActions["itemPreviewNormal"]->setEnabled(true);
-				scrActions["itemPreviewFull"]->setEnabled(true);
 				scrActions["itemAttributes"]->setEnabled(true);
 			}
 			view->horizRuler->textMode(false);
@@ -6528,9 +6523,9 @@
 			scrActions["itemAdjustImageToFrame"]->setEnabled(false);
 			scrActions["itemExtendedImageProperties"]->setEnabled(false);
 			scrActions["itemUpdateImage"]->setEnabled(false);
+			scrActions["itemPreviewFull"]->setEnabled(false);
+			scrActions["itemPreviewNormal"]->setEnabled(false);
 			scrActions["itemPreviewLow"]->setEnabled(false);
-			scrActions["itemPreviewNormal"]->setEnabled(false);
-			scrActions["itemPreviewFull"]->setEnabled(false);
 			scrActions["itemAttributes"]->setEnabled(false);
 /*			doc->CurTimer = new QTimer(view);
 			if (doc->CurTimer!=NULL)

Modified: trunk/Scribus/scribus/ui/contextmenu.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19465&path=/trunk/Scribus/scribus/ui/contextmenu.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/contextmenu.cpp (original)
+++ trunk/Scribus/scribus/ui/contextmenu.cpp Sat Aug 30 14:02:53 2014
@@ -288,12 +288,12 @@
 			if (m_actionList.contains("itemImageIsVisible"))
 				menuResolution->addAction(m_ScMW->scrActions["itemImageIsVisible"]);
 			menuResolution->addSeparator();
+			if (m_actionList.contains("itemPreviewFull"))
+				menuResolution->addAction(m_ScMW->scrActions["itemPreviewFull"]);
+			if (m_actionList.contains("itemPreviewNormal"))
+				menuResolution->addAction(m_ScMW->scrActions["itemPreviewNormal"]);
 			if (m_actionList.contains("itemPreviewLow"))
 				menuResolution->addAction(m_ScMW->scrActions["itemPreviewLow"]);
-			if (m_actionList.contains("itemPreviewNormal"))
-				menuResolution->addAction(m_ScMW->scrActions["itemPreviewNormal"]);
-			if (m_actionList.contains("itemPreviewFull"))
-				menuResolution->addAction(m_ScMW->scrActions["itemPreviewFull"]);
 			if (menuResolution->actions().count()>0)
 			{
 				QAction *act = addMenu(menuResolution);




More information about the scribus-commit mailing list