r19572 by craig - #12744: Convert to menu items re-enabled even when in an edit mode

scribus-commit scribus-commit at lists.scribus.net
Sat Oct 11 14:29:13 UTC 2014


Author: craig
Date: Sat Oct 11 14:29:13 2014
New Revision: 19572

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19572
Log:
#12744: Convert to menu items re-enabled even when in an edit mode

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/scribus.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19572&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Sat Oct 11 14:29:13 2014
@@ -6820,12 +6820,15 @@
 	ScItemState<CharStyle> *is = dynamic_cast<ScItemState<CharStyle> *>(ss);
 	QString text = is->get("TEXT_STR");
 	int start = is->getInt("START");
-	if (isUndo){
+	if (isUndo)
+	{
 		itemText.insertChars(start,text);
 		itemText.applyCharStyle(start, text.length(), is->getItem());
 		invalid = true;
 		invalidateLayout();
-	} else {
+	}
+	else
+	{
 		itemText.select(start,text.length());
 		asTextFrame()->deleteSelectedTextFromFrame();
 	}

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19572&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sat Oct 11 14:29:13 2014
@@ -3034,25 +3034,26 @@
 		scrActions["itemPreviewNormal"]->setEnabled(false);
 		scrActions["itemPreviewLow"]->setEnabled(false);
 		scrActions["itemAttributes"]->setEnabled(true);
+		bool inAnEditMode=doc->inAnEditMode();
 		if (SelectedType == PageItem::Polygon) //Polygon
 		{
 			scrMenuMgr->setMenuEnabled("ItemConvertTo", true);
-			scrActions["itemConvertToBezierCurve"]->setEnabled(doc->appMode != modeEdit);
-			scrActions["itemConvertToImageFrame"]->setEnabled(doc->appMode != modeEdit);
+			scrActions["itemConvertToBezierCurve"]->setEnabled(!inAnEditMode);
+			scrActions["itemConvertToImageFrame"]->setEnabled(!inAnEditMode);
 			scrActions["itemConvertToOutlines"]->setEnabled(false);
 			scrActions["itemConvertToPolygon"]->setEnabled(false);
-			scrActions["itemConvertToTextFrame"]->setEnabled(doc->appMode != modeEdit);
-			scrActions["itemConvertToSymbolFrame"]->setEnabled(doc->appMode != modeEdit);
+			scrActions["itemConvertToTextFrame"]->setEnabled(!inAnEditMode);
+			scrActions["itemConvertToSymbolFrame"]->setEnabled(!inAnEditMode);
 		}
 		else if ((SelectedType == PageItem::RegularPolygon) || (SelectedType == PageItem::Arc)) // Regular Polygon + Arc
 		{
 			scrMenuMgr->setMenuEnabled("ItemConvertTo", true);
-			scrActions["itemConvertToBezierCurve"]->setEnabled(doc->appMode != modeEdit);
-			scrActions["itemConvertToImageFrame"]->setEnabled(doc->appMode != modeEdit);
+			scrActions["itemConvertToBezierCurve"]->setEnabled(!inAnEditMode);
+			scrActions["itemConvertToImageFrame"]->setEnabled(!inAnEditMode);
 			scrActions["itemConvertToOutlines"]->setEnabled(false);
-			scrActions["itemConvertToPolygon"]->setEnabled(doc->appMode != modeEdit);
-			scrActions["itemConvertToTextFrame"]->setEnabled(doc->appMode != modeEdit);
-			scrActions["itemConvertToSymbolFrame"]->setEnabled(doc->appMode != modeEdit);
+			scrActions["itemConvertToPolygon"]->setEnabled(!inAnEditMode);
+			scrActions["itemConvertToTextFrame"]->setEnabled(!inAnEditMode);
+			scrActions["itemConvertToSymbolFrame"]->setEnabled(!inAnEditMode);
 		}
 		else if (SelectedType == PageItem::PolyLine) //Polyline
 		{
@@ -3060,9 +3061,9 @@
 			scrActions["itemConvertToBezierCurve"]->setEnabled(false);
 			scrActions["itemConvertToImageFrame"]->setEnabled(false);
 			scrActions["itemConvertToOutlines"]->setEnabled(false);
-			scrActions["itemConvertToPolygon"]->setEnabled(doc->appMode != modeEdit);
+			scrActions["itemConvertToPolygon"]->setEnabled(!inAnEditMode);
 			scrActions["itemConvertToTextFrame"]->setEnabled(false);
-			scrActions["itemConvertToSymbolFrame"]->setEnabled(doc->appMode != modeEdit);
+			scrActions["itemConvertToSymbolFrame"]->setEnabled(!inAnEditMode);
 		}
 		else if ((SelectedType == PageItem::Line) || (SelectedType == PageItem::Spiral)) // Line
 		{
@@ -3071,11 +3072,11 @@
 			scrActions["itemConvertToImageFrame"]->setEnabled(false);
 			scrActions["itemConvertToOutlines"]->setEnabled(false);
 			if (SelectedType == PageItem::Spiral)
-				scrActions["itemConvertToPolygon"]->setEnabled(doc->appMode != modeEdit);
+				scrActions["itemConvertToPolygon"]->setEnabled(!inAnEditMode);
 			else
 				scrActions["itemConvertToPolygon"]->setEnabled(false);
 			scrActions["itemConvertToTextFrame"]->setEnabled(false);
-			scrActions["itemConvertToSymbolFrame"]->setEnabled(doc->appMode != modeEdit);
+			scrActions["itemConvertToSymbolFrame"]->setEnabled(!inAnEditMode);
 		}
 		else if (SelectedType == PageItem::Symbol)
 			scrMenuMgr->setMenuEnabled("ItemConvertTo", false);




More information about the scribus-commit mailing list