r19386 by craig - #12469: Update status bar after item resize. Clean SCMW::HaveNewSel a little

scribus-commit scribus-commit at lists.scribus.net
Tue Jul 29 22:11:01 UTC 2014


Author: craig
Date: Tue Jul 29 22:11:01 2014
New Revision: 19386

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19386
Log:
#12469: Update status bar after item resize. Clean SCMW::HaveNewSel a little

Modified:
    trunk/Scribus/scribus/canvasgesture_resize.cpp
    trunk/Scribus/scribus/canvasmode_create.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h

Modified: trunk/Scribus/scribus/canvasgesture_resize.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19386&path=/trunk/Scribus/scribus/canvasgesture_resize.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_resize.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_resize.cpp Tue Jul 29 22:11:01 2014
@@ -28,6 +28,7 @@
 #include "pageitem_arc.h"
 #include "pageitem_spiral.h"
 #include "pageitem_table.h"
+#include "scribus.h"
 #include "scribusdoc.h"
 #include "scribusview.h"
 #include "selection.h"
@@ -271,6 +272,8 @@
 	m->accept();
 	m_canvas->update();
 	m_view->stopGesture();
+	//#12469: emit? update from selection even after resize? if removed, remove scribus.h include
+	m_view->m_ScMW->setStatusBarTextSelectedItemInfo();
 }
 
 

Modified: trunk/Scribus/scribus/canvasmode_create.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19386&path=/trunk/Scribus/scribus/canvasmode_create.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_create.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_create.cpp Tue Jul 29 22:11:01 2014
@@ -424,7 +424,7 @@
 									Um::Create + " " + currItem->getUName(),  "", Um::ICreate);
 		m_doc->changed();
 		delete m_createTransaction;
-		m_createTransaction = NULL;	
+		m_createTransaction = NULL;
 		/*currItem->update();
 		currItem->emitAllToGUI();*/
 	}

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19386&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Tue Jul 29 22:11:01 2014
@@ -1309,6 +1309,72 @@
 	mainWindowYPosDataLabel->setText("-");
 }
 
+void ScribusMainWindow::setStatusBarTextSelectedItemInfo()
+{
+	const uint docSelectionCount = doc->m_Selection->count();
+	if (docSelectionCount == 0)
+		setStatusBarInfoText("");
+	else if (docSelectionCount == 1)
+	{
+		QString whatSel = tr("Unknown");
+		switch (doc->m_Selection->itemAt(0)->itemType())
+		{
+			case 2:
+				whatSel = CommonStrings::itemType_ImageFrame;
+				break;
+			case 4:
+				whatSel = CommonStrings::itemType_TextFrame;
+				break;
+			case 5:
+				whatSel = CommonStrings::itemType_Line;
+				break;
+			case 6:
+				whatSel = CommonStrings::itemType_Polygon;
+				break;
+			case 7:
+				whatSel = CommonStrings::itemType_Polyline;
+				break;
+			case 8:
+				whatSel = CommonStrings::itemType_PathText;
+				break;
+			case 9:
+				whatSel = CommonStrings::itemType_LatexFrame;
+				break;
+			case 11:
+				whatSel = CommonStrings::itemType_Symbol;
+				break;
+			case 12:
+				whatSel = CommonStrings::itemType_Group;
+				break;
+			case 13:
+				whatSel = CommonStrings::itemType_RegularPolygon;
+				break;
+			case 14:
+				whatSel = CommonStrings::itemType_Arc;
+				break;
+			case 15:
+				whatSel = CommonStrings::itemType_Spiral;
+				break;
+			case 16:
+				whatSel = CommonStrings::itemType_Table;
+				break;
+			default:
+				whatSel = "Unknown";
+				break;
+		}
+		QString widthTxt = value2String(doc->m_Selection->width(), doc->unitIndex(), true, true);
+		QString heightTxt = value2String(doc->m_Selection->height(), doc->unitIndex(), true, true);
+		QString txtBody = tr("%1 selected").arg(whatSel) + " : " + tr("Size");
+		setStatusBarInfoText( QString("%1 = %3 x %4").arg(txtBody).arg(widthTxt).arg(heightTxt));
+	}
+	else
+	{
+		QString widthTxt = value2String(doc->m_Selection->width(), doc->unitIndex(), true, true);
+		QString heightTxt = value2String(doc->m_Selection->height(), doc->unitIndex(), true, true);
+		setStatusBarInfoText( tr("%1 Objects selected, Selection Size = %2 x %3").arg(docSelectionCount).arg(widthTxt).arg(heightTxt));
+	}
+}
+
 void ScribusMainWindow::setTempStatusBarText(const QString &text)
 {
 	if (mainWindowStatusLabel)
@@ -2591,67 +2657,9 @@
 		SelectedType = -1;
 	}
 	assert (docSelectionCount == 0 || currItem != NULL); // help coverity analysis
-	if (docSelectionCount == 0)
-		setStatusBarInfoText("");
-	else if (docSelectionCount == 1)
-	{
-		QString whatSel = tr("Unknown");
-		switch (currItem->itemType())
-		{
-			case 2:
-				whatSel = CommonStrings::itemType_ImageFrame;
-				break;
-			case 4:
-				whatSel = CommonStrings::itemType_TextFrame;
-				break;
-			case 5:
-				whatSel = CommonStrings::itemType_Line;
-				break;
-			case 6:
-				whatSel = CommonStrings::itemType_Polygon;
-				break;
-			case 7:
-				whatSel = CommonStrings::itemType_Polyline;
-				break;
-			case 8:
-				whatSel = CommonStrings::itemType_PathText;
-				break;
-			case 9:
-				whatSel = CommonStrings::itemType_LatexFrame;
-				break;
-			case 11:
-				whatSel = CommonStrings::itemType_Symbol;
-				break;
-			case 12:
-				whatSel = CommonStrings::itemType_Group;
-				break;
-			case 13:
-				whatSel = CommonStrings::itemType_RegularPolygon;
-				break;
-			case 14:
-				whatSel = CommonStrings::itemType_Arc;
-				break;
-			case 15:
-				whatSel = CommonStrings::itemType_Spiral;
-				break;
-			case 16:
-				whatSel = CommonStrings::itemType_Table;
-				break;
-			default:
-				whatSel = "Unknown";
-				break;
-		}
-		QString widthTxt = value2String(doc->m_Selection->width(), doc->unitIndex(), true, true);
-		QString heightTxt = value2String(doc->m_Selection->height(), doc->unitIndex(), true, true);
-		QString txtBody = tr("%1 Selected").arg(whatSel) + " " + tr("Size");
-		setStatusBarInfoText( QString("%1 = %3 x %4").arg(txtBody).arg(widthTxt).arg(heightTxt));
-	}
-	else
-	{
-		QString widthTxt = value2String(doc->m_Selection->width(), doc->unitIndex(), true, true);
-		QString heightTxt = value2String(doc->m_Selection->height(), doc->unitIndex(), true, true);
-		setStatusBarInfoText( tr("%1 Objects selected, Selection Size = %2 x %3").arg(docSelectionCount).arg(widthTxt).arg(heightTxt));
-	}
+
+	setStatusBarTextSelectedItemInfo();
+
 	actionManager->disconnectNewSelectionActions();
 	scrActions["editSelectAllOnLayer"]->setEnabled(true);
 	scrActions["editDeselectAll"]->setEnabled(SelectedType != -1);

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19386&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Tue Jul 29 22:11:01 2014
@@ -290,6 +290,7 @@
 	void StoreBookmarks();
 	void setStatusBarMousePosition(double xp, double yp);
 	void setStatusBarTextPosition(double base, double xp);
+	void setStatusBarTextSelectedItemInfo();
 	void setTempStatusBarText(const QString &text);
 	void setStatusBarInfoText(QString newText);
 	bool DoFileClose();




More information about the scribus-commit mailing list