r18035 by fschmid - Preview Mode: implemented the most common "Named Actions"

scribus-commit scribus-commit at lists.scribus.net
Thu Jan 3 10:58:49 UTC 2013


Author: fschmid
Date: Thu Jan  3 10:58:49 2013
New Revision: 18035

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18035
Log:
Preview Mode: implemented the most common "Named Actions"

Modified:
    trunk/Scribus/scribus/canvasmode_normal.cpp

Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18035&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Thu Jan  3 10:58:49 2013
@@ -1423,7 +1423,6 @@
 		default:
 			break;
 	}
-	m_doc->regionsChanged()->update(currItem->getVisualBoundingRect());
 }
 
 void CanvasMode_Normal::handleRadioButtonRelease(PageItem* currItem)
@@ -1510,7 +1509,26 @@
 
 void CanvasMode_Normal::handleNamedAction(PageItem* currItem)
 {
-//	qDebug() << "Named Action:" << currItem->annotation().Action();
+	m_view->Deselect(true);
+	QString name = currItem->annotation().Action();
+	if (name == "FirstPage")
+		m_view->GotoPage(0);
+	else if (name == "PrevPage")
+		m_view->GotoPage(qMax(0, m_doc->currentPageNumber()-1));
+	else if (name == "NextPage")
+		m_view->GotoPage(qMin(m_doc->currentPageNumber()+1, m_doc->Pages->count()-1));
+	else if (name == "LastPage")
+		m_view->GotoPage(m_doc->Pages->count()-1);
+	else if (name == "Print")
+		m_ScMW->slotFilePrint();
+	else if (name == "Close")
+		m_ScMW->slotFileClose();
+	else if (name == "Quit")
+		m_ScMW->slotFileQuit();
+	else if (name == "FitHeight")
+		m_ScMW->slotZoom(-100);
+	else if (name == "FitWidth")
+		m_ScMW->slotZoom(-200);
 }
 
 void CanvasMode_Normal::handleLinkAnnotation(PageItem* currItem)




More information about the scribus-commit mailing list