r19495 by craig - #12666: Rewrite app mode changing a little to make #1266 easier to work on. Work work to come but easier to manage and fix now

scribus-commit scribus-commit at lists.scribus.net
Tue Sep 9 22:21:15 UTC 2014


Author: craig
Date: Tue Sep  9 22:21:15 2014
New Revision: 19495

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19495
Log:
#12666: Rewrite app mode changing a little to make #1266 easier to work on. Work work to come but easier to manage and fix now

Modified:
    trunk/Scribus/scribus/appmodehelper.cpp
    trunk/Scribus/scribus/appmodehelper.h
    trunk/Scribus/scribus/canvasmode_framelinks.h
    trunk/Scribus/scribus/pageitem_textframe.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/scribusview.h
    trunk/Scribus/scribus/ui/propertiespalette.cpp
    trunk/Scribus/scribus/ui/propertiespalette_table.cpp
    trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
    trunk/Scribus/scribus/ui/propertywidget_distance.cpp
    trunk/Scribus/scribus/ui/propertywidget_optmargins.cpp
    trunk/Scribus/scribus/ui/propertywidget_pareffect.cpp

Modified: trunk/Scribus/scribus/appmodehelper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19495&path=/trunk/Scribus/scribus/appmodehelper.cpp
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.cpp (original)
+++ trunk/Scribus/scribus/appmodehelper.cpp Tue Sep  9 22:21:15 2014
@@ -15,119 +15,536 @@
 */
 
 #include "appmodehelper.h"
+#include "pageitem.h"
+#include "pageitem_table.h"
+#include "pluginmanager.h"
+#include "prefsmanager.h"
+#include "scmimedata.h"
+#include "scribus.h"
+#include "scribuscore.h"
 #include "scribusdoc.h"
-#include "scribuscore.h"
+#include "scribusview.h"
+#include "selection.h"
+#include "ui/charselect.h"
+#include "ui/hruler.h"
+#include "ui/modetoolbar.h"
+#include "ui/outlinepalette.h"
+#include "ui/pageselector.h"
+#include "ui/propertiespalette.h"
+#include "ui/scmwmenumanager.h"
+#include "ui/scrspinbox.h"
+#include "ui/vruler.h"
 #include "undomanager.h"
+#include "util_icon.h"
+
 
 AppModeHelper::AppModeHelper(QObject *parent) :
     QObject(parent)
 {
-	scrActions=NULL;
-	actMgr=NULL;
+	a_scrActions=NULL;
+	a_actMgr=NULL;
 }
 
 void AppModeHelper::setup(ActionManager* am, QMap<QString, QPointer<ScrAction> > *scra)
 {
-	actMgr=am;
-	scrActions=scra;
+	a_actMgr=am;
+	a_scrActions=scra;
+}
+
+void AppModeHelper::resetApplicationMode(ScribusMainWindow* scmw, int newMode)
+{
+	a_actMgr->disconnectModeActions();
+	setModeActionsPerMode(newMode);
+	a_actMgr->connectModeActions();
+	return;
+}
+
+void AppModeHelper::setApplicationMode(ScribusMainWindow* scmw, ScribusDoc* doc, int newMode)
+{
+	//Application modes start at 1 (appmodes.h), canvasmodes start at 1000 (canvasmode.h)
+	assert(mode < submodeFirstSubmode);
+
+	//If no doc and we end here, just reset the tool actions
+	if (doc==NULL)
+	{
+		resetApplicationMode(scmw, newMode);
+		return;
+	}
+
+	//disconnect the tools actions so we dont fire them off
+	a_actMgr->disconnectModeActions();
+	setModeActionsPerMode(newMode);
+
+
+	int oldMode = doc->appMode;
+	PageItem *currItem=0;
+	if (!doc->m_Selection->isEmpty())
+		currItem = doc->m_Selection->itemAt(0);
+
+	if (oldMode == modeEditClip && newMode != modeEditClip)
+		scmw->NoFrameEdit();
+	else if (oldMode != modeEditClip && newMode == modeEditClip)
+		scmw->ToggleFrameEdit();
+
+	//Ugly hack but I have absolutly no idea about how to do this in another way
+	if(UndoManager::undoEnabled() && currItem && oldMode != newMode && (newMode == modeEditMeshPatch || newMode == modeEditMeshGradient || newMode == modeEditGradientVectors || oldMode == modeEditMeshPatch || oldMode == modeEditMeshGradient || oldMode == modeEditGradientVectors || oldMode == modeEditPolygon || newMode == modeEditPolygon || oldMode == modeEditArc || newMode == modeEditArc || oldMode == modeEditSpiral || newMode == modeEditSpiral))
+	{
+		SimpleState *ss = new SimpleState(Um::Mode);
+		ss->set("CHANGE_MODE","change_mode");
+		ss->set("OLD",oldMode);
+		ss->set("NEW",newMode);
+		UndoManager::instance()->action(currItem,ss);
+	}
+	doc->appMode = newMode ;
+	//disable text action which work only text frame in edit mode
+	if ((newMode != modeEdit) || (!currItem) || !currItem->isTextFrame())
+		enableTextActions(false);
+	if (newMode != modeDrawShapes)
+		doc->SubMode = -1;
+	if (newMode != modeNormal && newMode != modeStoryEditor)
+		scmw->activateWindow();
+
+
+	switch (oldMode)
+	{
+		case modeEdit:
+			{
+				if (newMode!=modeEdit)
+					a_actMgr->restoreActionShortcutsPostEditMode();
+				scmw->zoomSpinBox->setFocusPolicy(Qt::ClickFocus);
+				scmw->pageSelector->setFocusPolicy(Qt::ClickFocus);
+				(*a_scrActions)["editClearContents"]->setEnabled(false);
+				(*a_scrActions)["editTruncateContents"]->setEnabled(false);
+				scmw->charPalette->setEnabled(false, 0);
+				if (currItem != 0)
+				{
+					currItem->update();
+					if (currItem->asTextFrame())
+						enableTextActions(false);
+					//		scrMenuMgr->setMenuEnabled("Item", true);
+					(*a_scrActions)["itemDuplicate"]->setEnabled(true);
+					(*a_scrActions)["itemMulDuplicate"]->setEnabled(true);
+					(*a_scrActions)["itemTransform"]->setEnabled(true);
+					(*a_scrActions)["itemDelete"]->setEnabled(true);
+					(*a_scrActions)["itemRaise"]->setEnabled(true);
+					(*a_scrActions)["itemLower"]->setEnabled(true);
+					(*a_scrActions)["itemRaiseToTop"]->setEnabled(true);
+					(*a_scrActions)["itemLowerToBottom"]->setEnabled(true);
+					scmw->scrMenuMgr->setMenuEnabled("itemSendToScrapbook", true);
+					(*a_scrActions)["itemSendToPattern"]->setEnabled(true);
+					(*a_scrActions)["itemSendToInline"]->setEnabled(true);
+					(*a_scrActions)["itemAdjustFrameToImage"]->setEnabled(true);
+					(*a_scrActions)["itemAdjustImageToFrame"]->setEnabled(true);
+					(*a_scrActions)["itemExtendedImageProperties"]->setEnabled(true);
+					(*a_scrActions)["itemUpdateImage"]->setEnabled(true);
+					(*a_scrActions)["itemPreviewFull"]->setEnabled(true);
+					(*a_scrActions)["itemPreviewNormal"]->setEnabled(true);
+					(*a_scrActions)["itemPreviewLow"]->setEnabled(true);
+					(*a_scrActions)["itemAttributes"]->setEnabled(true);
+				}
+				doc->view()->horizRuler->textMode(false);
+				doc->view()->horizRuler->update();
+			}
+			break;
+		case modeEditTable:
+			if (newMode != modeEditTable)
+			{
+				scmw->outlinePalette->setEnabled(true);
+				scmw->charPalette->setEnabled(false, 0);
+				enableTextActions(false);
+				(*a_scrActions)["insertSampleText"]->setEnabled(false);
+				(*a_scrActions)["toolsEditWithStoryEditor"]->setEnabled(false);
+				a_actMgr->restoreActionShortcutsPostEditMode();
+			}
+			break;
+		case modeEditArc:
+			setSpecialEditMode(false);
+			break;
+		case modeEditSpiral:
+			setSpecialEditMode(false);
+			break;
+		case modeEditPolygon:
+			setSpecialEditMode(false);
+			break;
+		case modeLinkFrames:
+			doc->regionsChanged()->update(QRect());
+			break;
+		case modeUnlinkFrames:
+			doc->regionsChanged()->update(QRect());
+			break;
+	}
+
+	switch (newMode)
+	{
+		case modeNormal:
+			{
+				scmw->propertiesPalette->setGradientEditMode(false);
+				scmw->outlinePalette->setEnabled(true);
+			}
+			break;
+		case modeDrawShapes:
+			{
+				doc->SubMode = scmw->modeToolBar->SubMode;
+				doc->ShapeValues = scmw->modeToolBar->ShapeVals;
+				doc->ValCount = scmw->modeToolBar->ValCount;
+				scmw->emitUpdateRequest(reqCustomShapeUpdate);
+			}
+			break;
+		case modeStoryEditor:
+			{
+				scmw->slotStoryEditor(oldMode == modeEditTable);
+				scmw->slotSelect();
+			}
+			break;
+		case modeDrawImage:
+			break;
+		case modeDrawText:
+			break;
+		case modeMagnifier:
+			break;
+		case modeEdit:
+			{
+				if (oldMode!=modeEdit)
+					a_actMgr->saveActionShortcutsPreEditMode();
+				if (currItem != 0)
+				{
+					currItem->itemText.setCursorPosition(0);
+					scmw->setTBvals(currItem);
+				}
+				(*a_scrActions)["editPaste"]->setEnabled(false);
+				scmw->charPalette->setEnabled(true, currItem);
+				if (currItem!=NULL && currItem->asTextFrame())
+				{
+					enableTextActions(true, currItem->currentCharStyle().font().scName());
+					currItem->asTextFrame()->togleEditModeActions();
+				}
+				if (ScMimeData::clipboardHasScribusData())
+				{
+					bool textFrameEditMode = ((currItem != NULL) && (currItem->asTextFrame()));
+					(*a_scrActions)["editPaste"]->setEnabled( textFrameEditMode || (currItem == NULL) );
+				}
+				(*a_scrActions)["itemDuplicate"]->setEnabled(false);
+				(*a_scrActions)["itemMulDuplicate"]->setEnabled(false);
+				(*a_scrActions)["itemTransform"]->setEnabled(false);
+				(*a_scrActions)["itemDelete"]->setEnabled(false);
+				(*a_scrActions)["itemRaise"]->setEnabled(false);
+				(*a_scrActions)["itemLower"]->setEnabled(false);
+				(*a_scrActions)["itemRaiseToTop"]->setEnabled(false);
+				(*a_scrActions)["itemLowerToBottom"]->setEnabled(false);
+				scmw->scrMenuMgr->setMenuEnabled("itemSendToScrapbook", false);
+				(*a_scrActions)["itemSendToPattern"]->setEnabled(false);
+				(*a_scrActions)["itemSendToInline"]->setEnabled(false);
+				(*a_scrActions)["itemAdjustFrameToImage"]->setEnabled(false);
+				(*a_scrActions)["itemAdjustImageToFrame"]->setEnabled(false);
+				(*a_scrActions)["itemExtendedImageProperties"]->setEnabled(false);
+				(*a_scrActions)["itemUpdateImage"]->setEnabled(false);
+				(*a_scrActions)["itemPreviewFull"]->setEnabled(false);
+				(*a_scrActions)["itemPreviewNormal"]->setEnabled(false);
+				(*a_scrActions)["itemPreviewLow"]->setEnabled(false);
+				(*a_scrActions)["itemAttributes"]->setEnabled(false);
+
+				if (currItem != 0)
+				{
+					(*a_scrActions)["editCut"]->setEnabled(currItem->HasSel);
+					(*a_scrActions)["editCopy"]->setEnabled(currItem->HasSel);
+					(*a_scrActions)["editClearContents"]->setEnabled(currItem->HasSel);
+					(*a_scrActions)["editTruncateContents"]->setEnabled(currItem->HasSel);
+					(*a_scrActions)["editSearchReplace"]->setEnabled(true);
+				}
+			}
+			break;
+		case modeDrawLine:
+			break;
+		case modeRotation:
+			break;
+		case modeLinkFrames:
+			{
+				doc->regionsChanged()->update(QRect());
+				doc->ElemToLink = doc->m_Selection->itemAt(0);
+			}
+			break;
+		case modeImportImage:
+			break;
+		case modeUnlinkFrames:
+			doc->regionsChanged()->update(QRect());
+			break;
+		case modeDrawRegularPolygon:
+			break;
+		case modeDrawBezierLine:
+			{
+				if ((doc->m_Selection->count() != 0) && (!PrefsManager::instance()->appPrefs.uiPrefs.stickyTools))
+					doc->view()->Deselect(true);
+				doc->view()->FirstPoly = true;
+			}
+			break;
+		case modeInsertPDFButton:
+			break;
+		case modeInsertPDFTextfield:
+			break;
+		case modeInsertPDFCheckbox:
+			break;
+		case modeInsertPDFCombobox:
+			break;
+		case modeInsertPDFListbox:
+			break;
+		case modeInsertPDFTextAnnotation:
+			break;
+		case modeInsertPDFLinkAnnotation:
+			break;
+		case modeDrawFreehandLine:
+			break;
+		case modeDrawTable:
+			break;
+		case modeDrawTable2:
+			break;
+		case modePanning:
+			break;
+		case modeMeasurementTool:
+			break;
+		case modeEditGradientVectors:
+			{
+				scmw->propertiesPalette->setGradientEditMode(true);
+			}
+			break;
+		case modeEyeDropper:
+			break;
+		case modeCopyProperties:
+			{
+				if (!doc->m_Selection->isEmpty())
+				{
+					doc->ElemToLink = doc->m_Selection->itemAt(0);
+					doc->view()->Deselect(true);
+					(*a_scrActions)["toolsCopyProperties"]->setEnabled(true);
+				}
+			}
+			break;
+		case modeEditClip:
+			break;
+		case modeDrawLatex:
+			break;
+		case modeImportObject:
+			break;
+		case modeInsertPDF3DAnnotation:
+			break;
+		case modeEditMeshGradient:
+			break;
+		case modeDrawCalligraphicLine:
+			break;
+		case modeDrawArc:
+			break;
+		case modeEditArc:
+			setSpecialEditMode(true);
+			break;
+		case modeEditPolygon:
+			setSpecialEditMode(true);
+			break;
+		case modeDrawSpiral:
+			break;
+		case modeEditSpiral:
+			setSpecialEditMode(true);
+			scmw->outlinePalette->setEnabled(false);
+			break;
+		case modeEditTable:
+			{
+				if (oldMode != modeEditTable)
+				{
+					scmw->outlinePalette->setEnabled(false);
+					scmw->charPalette->setEnabled(true, currItem);
+					(*a_scrActions)["insertSampleText"]->setEnabled(true);
+					(*a_scrActions)["toolsEditWithStoryEditor"]->setEnabled(true);
+					PageItem *i2 = currItem->asTable()->activeCell().textFrame();
+					enableTextActions(true, i2->currentCharStyle().font().scName());
+					a_actMgr->saveActionShortcutsPreEditMode();
+				}
+			}
+			break;
+		case modeEditMeshPatch:
+			break;
+		case modeEditWeldPoint:
+			break;
+		case modeInsertPDFRadioButton:
+			break;
+		default:
+			//No doc open?
+			break;
+	}
+	emit AppModeChanged(oldMode, newMode);
+	a_actMgr->connectModeActions();
+	PluginManager::instance().enablePluginActionsForSelection(scmw);
+}
+
+void AppModeHelper::setModeActionsPerMode(int newMode)
+{
+	//set the actions state based on incoming mode
+	(*a_scrActions)["toolsSelect"]->setChecked(newMode==modeNormal);
+	(*a_scrActions)["toolsInsertTextFrame"]->setChecked(newMode==modeDrawText);
+	(*a_scrActions)["toolsInsertImageFrame"]->setChecked(newMode==modeDrawImage);
+	(*a_scrActions)["toolsInsertTable"]->setChecked(newMode==modeDrawTable2);
+	(*a_scrActions)["toolsInsertShape"]->setChecked(newMode==modeDrawShapes);
+	(*a_scrActions)["toolsInsertPolygon"]->setChecked(newMode==modeDrawRegularPolygon);
+	(*a_scrActions)["toolsInsertArc"]->setChecked(newMode==modeDrawArc);
+	(*a_scrActions)["toolsInsertSpiral"]->setChecked(newMode==modeDrawSpiral);
+	(*a_scrActions)["toolsInsertLine"]->setChecked(newMode==modeDrawLine);
+	(*a_scrActions)["toolsInsertBezier"]->setChecked(newMode==modeDrawBezierLine);
+	(*a_scrActions)["toolsInsertFreehandLine"]->setChecked(newMode==modeDrawFreehandLine);
+	(*a_scrActions)["toolsInsertCalligraphicLine"]->setChecked(newMode == modeDrawCalligraphicLine);
+	(*a_scrActions)["toolsInsertRenderFrame"]->setChecked(newMode==modeDrawLatex);
+	(*a_scrActions)["toolsRotate"]->setChecked(newMode==modeRotation);
+	(*a_scrActions)["toolsZoom"]->setChecked(newMode==modeMagnifier);
+	(*a_scrActions)["toolsEditContents"]->setChecked(newMode==modeEdit);
+	(*a_scrActions)["toolsEditWithStoryEditor"]->setChecked(newMode==modeStoryEditor);
+	(*a_scrActions)["toolsLinkTextFrame"]->setChecked(newMode==modeLinkFrames);
+	(*a_scrActions)["toolsUnlinkTextFrame"]->setChecked(newMode==modeUnlinkFrames);
+//	(*a_scrActions)["toolsUnlinkTextFrameWithTextCopy"]->setChecked(newMode==modeUnlinkFrames);
+//	(*a_scrActions)["toolsUnlinkTextFrameWithTextCut"]->setChecked(newMode==modeUnlinkFrames);
+	(*a_scrActions)["toolsEyeDropper"]->setChecked(newMode==modeEyeDropper);
+	(*a_scrActions)["toolsMeasurements"]->setChecked(newMode==modeMeasurementTool);
+	(*a_scrActions)["toolsCopyProperties"]->setChecked(newMode==modeCopyProperties);
+	(*a_scrActions)["toolsPDFPushButton"]->setChecked(newMode==modeInsertPDFButton);
+	(*a_scrActions)["toolsPDFRadioButton"]->setChecked(newMode==modeInsertPDFRadioButton);
+	(*a_scrActions)["toolsPDFTextField"]->setChecked(newMode==modeInsertPDFTextfield);
+	(*a_scrActions)["toolsPDFCheckBox"]->setChecked(newMode==modeInsertPDFCheckbox);
+	(*a_scrActions)["toolsPDFComboBox"]->setChecked(newMode==modeInsertPDFCombobox);
+	(*a_scrActions)["toolsPDFListBox"]->setChecked(newMode==modeInsertPDFListbox);
+	(*a_scrActions)["toolsPDFAnnotText"]->setChecked(newMode==modeInsertPDFTextAnnotation);
+	(*a_scrActions)["toolsPDFAnnotLink"]->setChecked(newMode==modeInsertPDFLinkAnnotation);
+#ifdef HAVE_OSG
+	(*a_scrActions)["toolsPDFAnnot3D"]->setChecked(newMode==modeInsertPDF3DAnnotation);
+#endif
+}
+
+bool AppModeHelper::inAnEditMode(ScribusDoc *doc)
+{
+	bool inEditMode=false;
+
+	if (doc->appMode == modeEdit ||
+		doc->appMode == modeEditTable ||
+		doc->appMode == modeEditSpiral ||
+		doc->appMode == modeEditGradientVectors ||
+		doc->appMode == modeEditClip ||
+		doc->appMode == modeEditMeshGradient ||
+		doc->appMode == modeEditArc ||
+		doc->appMode == modeEditMeshPatch ||
+		doc->appMode == modeEditWeldPoint ||
+		doc->appMode == modeEditPolygon
+		)
+		inEditMode=true;
+
+	return inEditMode;
+}
+
+void AppModeHelper::setSpecialEditMode(bool b)
+{
+	bool b2=!b;
+
+	(*a_scrActions)["editCut"]->setEnabled(b2);
+	(*a_scrActions)["editCopy"]->setEnabled(b2);
+	(*a_scrActions)["editPaste"]->setEnabled(b2);
+	(*a_scrActions)["editCopyContents"]->setEnabled(b2);
+	(*a_scrActions)["editPasteContents"]->setEnabled(b2);
+	(*a_scrActions)["editPasteContentsAbs"]->setEnabled(b2);
+	(*a_scrActions)["editSelectAll"]->setEnabled(b2);
+	(*a_scrActions)["editSelectAllOnLayer"]->setEnabled(b2);
+	(*a_scrActions)["editDeselectAll"]->setEnabled(b2);
+	(*a_scrActions)["itemDelete"]->setEnabled(b2);
 }
 
 void AppModeHelper::setFrameEditMode(bool b)
 {
 	bool b2=!b;
 
-	(*scrActions)["itemShapeEdit"]->setChecked(b);
+	(*a_scrActions)["itemShapeEdit"]->setChecked(b);
 
 	//CB Enable/Disable undo in frame edit mode
 	if (b2)
 	{
-		(*scrActions)["editUndoAction"]->setEnabled(UndoManager::instance()->hasUndoActions());
-		(*scrActions)["editRedoAction"]->setEnabled(UndoManager::instance()->hasRedoActions());
+		(*a_scrActions)["editUndoAction"]->setEnabled(UndoManager::instance()->hasUndoActions());
+		(*a_scrActions)["editRedoAction"]->setEnabled(UndoManager::instance()->hasRedoActions());
 	}
 	else
 	{
-		(*scrActions)["editUndoAction"]->setEnabled(false);
-		(*scrActions)["editRedoAction"]->setEnabled(false);
-	}
-
-	(*scrActions)["insertFrame"]->setEnabled(b2);
-	(*scrActions)["toolsSelect"]->setEnabled(b2);
-	(*scrActions)["toolsRotate"]->setEnabled(b2);
-	(*scrActions)["toolsEditContents"]->setEnabled(b2);
-	(*scrActions)["toolsEditWithStoryEditor"]->setEnabled(b2);
-	(*scrActions)["toolsZoom"]->setEnabled(b2);
-	(*scrActions)["toolsInsertTextFrame"]->setEnabled(b2);
-	(*scrActions)["toolsInsertImageFrame"]->setEnabled(b2);
-	(*scrActions)["toolsInsertTable"]->setEnabled(b2);
-	(*scrActions)["toolsInsertShape"]->setEnabled(b2);
-	(*scrActions)["toolsInsertLine"]->setEnabled(b2);
-	(*scrActions)["toolsInsertBezier"]->setEnabled(b2);
-	(*scrActions)["toolsInsertFreehandLine"]->setEnabled(b2);
-	(*scrActions)["toolsInsertCalligraphicLine"]->setEnabled(b2);
-	(*scrActions)["toolsInsertPolygon"]->setEnabled(b2);
-	(*scrActions)["toolsInsertArc"]->setEnabled(b2);
-	(*scrActions)["toolsInsertSpiral"]->setEnabled(b2);
-	(*scrActions)["toolsInsertRenderFrame"]->setEnabled(b2);
-	(*scrActions)["toolsLinkTextFrame"]->setEnabled(b2);
-	(*scrActions)["toolsUnlinkTextFrame"]->setEnabled(b2);
-	(*scrActions)["toolsUnlinkTextFrameWithTextCopy"]->setEnabled(b2);
-	(*scrActions)["toolsUnlinkTextFrameWithTextCut"]->setEnabled(b2);
-	(*scrActions)["toolsMeasurements"]->setEnabled(b2);
-	(*scrActions)["toolsCopyProperties"]->setEnabled(b2);
-	(*scrActions)["toolsEyeDropper"]->setEnabled(b2);
-	(*scrActions)["toolsPDFPushButton"]->setEnabled(b2);
-	(*scrActions)["toolsPDFRadioButton"]->setEnabled(b2);
-	(*scrActions)["toolsPDFTextField"]->setEnabled(b2);
-	(*scrActions)["toolsPDFCheckBox"]->setEnabled(b2);
-	(*scrActions)["toolsPDFComboBox"]->setEnabled(b2);
-	(*scrActions)["toolsPDFListBox"]->setEnabled(b2);
-	(*scrActions)["toolsPDFAnnotText"]->setEnabled(b2);
-	(*scrActions)["toolsPDFAnnotLink"]->setEnabled(b2);
+		(*a_scrActions)["editUndoAction"]->setEnabled(false);
+		(*a_scrActions)["editRedoAction"]->setEnabled(false);
+	}
+
+	(*a_scrActions)["insertFrame"]->setEnabled(b2);
+	(*a_scrActions)["toolsSelect"]->setEnabled(b2);
+	(*a_scrActions)["toolsRotate"]->setEnabled(b2);
+	(*a_scrActions)["toolsEditContents"]->setEnabled(b2);
+	(*a_scrActions)["toolsEditWithStoryEditor"]->setEnabled(b2);
+	(*a_scrActions)["toolsZoom"]->setEnabled(b2);
+	(*a_scrActions)["toolsInsertTextFrame"]->setEnabled(b2);
+	(*a_scrActions)["toolsInsertImageFrame"]->setEnabled(b2);
+	(*a_scrActions)["toolsInsertTable"]->setEnabled(b2);
+	(*a_scrActions)["toolsInsertShape"]->setEnabled(b2);
+	(*a_scrActions)["toolsInsertLine"]->setEnabled(b2);
+	(*a_scrActions)["toolsInsertBezier"]->setEnabled(b2);
+	(*a_scrActions)["toolsInsertFreehandLine"]->setEnabled(b2);
+	(*a_scrActions)["toolsInsertCalligraphicLine"]->setEnabled(b2);
+	(*a_scrActions)["toolsInsertPolygon"]->setEnabled(b2);
+	(*a_scrActions)["toolsInsertArc"]->setEnabled(b2);
+	(*a_scrActions)["toolsInsertSpiral"]->setEnabled(b2);
+	(*a_scrActions)["toolsInsertRenderFrame"]->setEnabled(b2);
+	(*a_scrActions)["toolsLinkTextFrame"]->setEnabled(b2);
+	(*a_scrActions)["toolsUnlinkTextFrame"]->setEnabled(b2);
+	(*a_scrActions)["toolsUnlinkTextFrameWithTextCopy"]->setEnabled(b2);
+	(*a_scrActions)["toolsUnlinkTextFrameWithTextCut"]->setEnabled(b2);
+	(*a_scrActions)["toolsMeasurements"]->setEnabled(b2);
+	(*a_scrActions)["toolsCopyProperties"]->setEnabled(b2);
+	(*a_scrActions)["toolsEyeDropper"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFPushButton"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFRadioButton"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFTextField"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFCheckBox"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFComboBox"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFListBox"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFAnnotText"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFAnnotLink"]->setEnabled(b2);
 #ifdef HAVE_OSG
 	(*scrActions)["toolsPDFAnnot3D"]->setEnabled(b2);
 #endif
-	(*scrActions)["itemDelete"]->setEnabled(b2);
+	(*a_scrActions)["itemDelete"]->setEnabled(b2);
 }
 
 void AppModeHelper::setSymbolEditMode(bool b, ScribusDoc* doc)
 {
 	bool b2=!b;
-	(*scrActions)["pageInsert"]->setEnabled(b2);
-	(*scrActions)["pageImport"]->setEnabled(b2);
-	(*scrActions)["pageCopy"]->setEnabled(b2);
-	(*scrActions)["pageApplyMasterPage"]->setEnabled(b2);
-	(*scrActions)["pageCopyToMasterPage"]->setEnabled(b2);
-	(*scrActions)["editMasterPages"]->setEnabled(b2);
-	(*scrActions)["fileNew"]->setEnabled(b2);
-	(*scrActions)["fileNewFromTemplate"]->setEnabled(b2);
-	(*scrActions)["fileOpen"]->setEnabled(b2);
-	(*scrActions)["fileClose"]->setEnabled(b2);
-	(*scrActions)["fileSave"]->setEnabled(b2);
-	(*scrActions)["pageDelete"]->setEnabled(b2);
-	(*scrActions)["pageMove"]->setEnabled(b2);
+	(*a_scrActions)["pageInsert"]->setEnabled(b2);
+	(*a_scrActions)["pageImport"]->setEnabled(b2);
+	(*a_scrActions)["pageCopy"]->setEnabled(b2);
+	(*a_scrActions)["pageApplyMasterPage"]->setEnabled(b2);
+	(*a_scrActions)["pageCopyToMasterPage"]->setEnabled(b2);
+	(*a_scrActions)["editMasterPages"]->setEnabled(b2);
+	(*a_scrActions)["fileNew"]->setEnabled(b2);
+	(*a_scrActions)["fileNewFromTemplate"]->setEnabled(b2);
+	(*a_scrActions)["fileOpen"]->setEnabled(b2);
+	(*a_scrActions)["fileClose"]->setEnabled(b2);
+	(*a_scrActions)["fileSave"]->setEnabled(b2);
+	(*a_scrActions)["pageDelete"]->setEnabled(b2);
+	(*a_scrActions)["pageMove"]->setEnabled(b2);
 	if (b2)
 	{
-		(*scrActions)["fileSave"]->setEnabled(!doc->isConverted);
+		(*a_scrActions)["fileSave"]->setEnabled(!doc->isConverted);
 		bool setter = doc->DocPages.count() > 1 ? true : false;
-		(*scrActions)["pageDelete"]->setEnabled(setter);
-		(*scrActions)["pageMove"]->setEnabled(setter);
-	}
-	(*scrActions)["fileRevert"]->setEnabled(b2);
-	(*scrActions)["fileDocSetup150"]->setEnabled(b2);
-	(*scrActions)["filePrint"]->setEnabled(b2);
-	(*scrActions)["fileCollect"]->setEnabled(b2);
-	(*scrActions)["fileSaveAs"]->setEnabled(b2);
-	(*scrActions)["fileExportAsEPS"]->setEnabled(b2);
-	(*scrActions)["fileExportAsPDF"]->setEnabled(b2);
+		(*a_scrActions)["pageDelete"]->setEnabled(setter);
+		(*a_scrActions)["pageMove"]->setEnabled(setter);
+	}
+	(*a_scrActions)["fileRevert"]->setEnabled(b2);
+	(*a_scrActions)["fileDocSetup150"]->setEnabled(b2);
+	(*a_scrActions)["filePrint"]->setEnabled(b2);
+	(*a_scrActions)["fileCollect"]->setEnabled(b2);
+	(*a_scrActions)["fileSaveAs"]->setEnabled(b2);
+	(*a_scrActions)["fileExportAsEPS"]->setEnabled(b2);
+	(*a_scrActions)["fileExportAsPDF"]->setEnabled(b2);
 	if ( ScCore->haveGS() || ScCore->isWinGUI() )
-		(*scrActions)["PrintPreview"]->setEnabled(b2);
-	(*scrActions)["toolsPDFPushButton"]->setEnabled(b2);
-	(*scrActions)["toolsPDFRadioButton"]->setEnabled(b2);
-	(*scrActions)["toolsPDFTextField"]->setEnabled(b2);
-	(*scrActions)["toolsPDFCheckBox"]->setEnabled(b2);
-	(*scrActions)["toolsPDFComboBox"]->setEnabled(b2);
-	(*scrActions)["toolsPDFListBox"]->setEnabled(b2);
-	(*scrActions)["toolsPDFAnnotText"]->setEnabled(b2);
+		(*a_scrActions)["PrintPreview"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFPushButton"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFRadioButton"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFTextField"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFCheckBox"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFComboBox"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFListBox"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFAnnotText"]->setEnabled(b2);
 #ifdef HAVE_OSG
 	(*scrActions)["toolsPDFAnnot3D"]->setEnabled(b2);
 #endif
@@ -136,43 +553,43 @@
 void AppModeHelper::setInlineEditMode(bool b, ScribusDoc *doc)
 {
 	bool b2=!b;
-	(*scrActions)["pageInsert"]->setEnabled(b2);
-	(*scrActions)["pageImport"]->setEnabled(b2);
-	(*scrActions)["pageDelete"]->setEnabled(b2);
-	(*scrActions)["pageCopy"]->setEnabled(b2);
-	(*scrActions)["pageMove"]->setEnabled(b2);
-	(*scrActions)["pageApplyMasterPage"]->setEnabled(b2);
-	(*scrActions)["pageCopyToMasterPage"]->setEnabled(b2);
-	(*scrActions)["editMasterPages"]->setEnabled(b2);
-	(*scrActions)["fileNew"]->setEnabled(b2);
-	(*scrActions)["fileNewFromTemplate"]->setEnabled(b2);
-	(*scrActions)["fileOpen"]->setEnabled(b2);
-	(*scrActions)["fileSave"]->setEnabled(b2);
+	(*a_scrActions)["pageInsert"]->setEnabled(b2);
+	(*a_scrActions)["pageImport"]->setEnabled(b2);
+	(*a_scrActions)["pageDelete"]->setEnabled(b2);
+	(*a_scrActions)["pageCopy"]->setEnabled(b2);
+	(*a_scrActions)["pageMove"]->setEnabled(b2);
+	(*a_scrActions)["pageApplyMasterPage"]->setEnabled(b2);
+	(*a_scrActions)["pageCopyToMasterPage"]->setEnabled(b2);
+	(*a_scrActions)["editMasterPages"]->setEnabled(b2);
+	(*a_scrActions)["fileNew"]->setEnabled(b2);
+	(*a_scrActions)["fileNewFromTemplate"]->setEnabled(b2);
+	(*a_scrActions)["fileOpen"]->setEnabled(b2);
+	(*a_scrActions)["fileSave"]->setEnabled(b2);
 	if (b2)
 	{
-		(*scrActions)["fileSave"]->setEnabled(!doc->isConverted);
+		(*a_scrActions)["fileSave"]->setEnabled(!doc->isConverted);
 		if ( ScCore->haveGS() || ScCore->isWinGUI() )
-			(*scrActions)["PrintPreview"]->setEnabled(true);
+			(*a_scrActions)["PrintPreview"]->setEnabled(true);
 		bool setter = doc->DocPages.count() > 1 ? true : false;
-		(*scrActions)["pageDelete"]->setEnabled(setter);
-		(*scrActions)["pageMove"]->setEnabled(setter);
-	}
-	(*scrActions)["fileRevert"]->setEnabled(b2);
-	(*scrActions)["fileDocSetup150"]->setEnabled(b2);
-	(*scrActions)["filePrint"]->setEnabled(b2);
-	(*scrActions)["fileCollect"]->setEnabled(b2);
-	(*scrActions)["fileSaveAs"]->setEnabled(b2);
-	(*scrActions)["fileExportAsEPS"]->setEnabled(b2);
-	(*scrActions)["fileExportAsPDF"]->setEnabled(b2);
+		(*a_scrActions)["pageDelete"]->setEnabled(setter);
+		(*a_scrActions)["pageMove"]->setEnabled(setter);
+	}
+	(*a_scrActions)["fileRevert"]->setEnabled(b2);
+	(*a_scrActions)["fileDocSetup150"]->setEnabled(b2);
+	(*a_scrActions)["filePrint"]->setEnabled(b2);
+	(*a_scrActions)["fileCollect"]->setEnabled(b2);
+	(*a_scrActions)["fileSaveAs"]->setEnabled(b2);
+	(*a_scrActions)["fileExportAsEPS"]->setEnabled(b2);
+	(*a_scrActions)["fileExportAsPDF"]->setEnabled(b2);
 	if ( ScCore->haveGS() || ScCore->isWinGUI() )
-		(*scrActions)["PrintPreview"]->setEnabled(b2);
-	(*scrActions)["toolsPDFPushButton"]->setEnabled(b2);
-	(*scrActions)["toolsPDFRadioButton"]->setEnabled(b2);
-	(*scrActions)["toolsPDFTextField"]->setEnabled(b2);
-	(*scrActions)["toolsPDFCheckBox"]->setEnabled(b2);
-	(*scrActions)["toolsPDFComboBox"]->setEnabled(b2);
-	(*scrActions)["toolsPDFListBox"]->setEnabled(b2);
-	(*scrActions)["toolsPDFAnnotText"]->setEnabled(b2);
+		(*a_scrActions)["PrintPreview"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFPushButton"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFRadioButton"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFTextField"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFCheckBox"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFComboBox"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFListBox"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFAnnotText"]->setEnabled(b2);
 #ifdef HAVE_OSG
 	(*scrActions)["toolsPDFAnnot3D"]->setEnabled(b2);
 #endif
@@ -181,43 +598,43 @@
 void AppModeHelper::setMasterPageEditMode(bool b, ScribusDoc* doc)
 {
 	bool b2=!b;
-	(*scrActions)["pageInsert"]->setEnabled(b2);
-	(*scrActions)["pageImport"]->setEnabled(b2);
-	(*scrActions)["pageDelete"]->setEnabled(b2);
-	(*scrActions)["pageCopy"]->setEnabled(b2);
-	(*scrActions)["pageMove"]->setEnabled(b2);
-	(*scrActions)["pageApplyMasterPage"]->setEnabled(b2);
-	(*scrActions)["pageCopyToMasterPage"]->setEnabled(b2);
-	(*scrActions)["editMasterPages"]->setEnabled(b2);
-	(*scrActions)["fileNew"]->setEnabled(b2);
-	(*scrActions)["fileNewFromTemplate"]->setEnabled(b2);
-	(*scrActions)["fileOpen"]->setEnabled(b2);
-	(*scrActions)["fileClose"]->setEnabled(!b2);
-	(*scrActions)["fileSave"]->setEnabled(b2);
-	(*scrActions)["fileExportAsEPS"]->setEnabled(b2);
-	(*scrActions)["fileExportAsPDF"]->setEnabled(b2);
+	(*a_scrActions)["pageInsert"]->setEnabled(b2);
+	(*a_scrActions)["pageImport"]->setEnabled(b2);
+	(*a_scrActions)["pageDelete"]->setEnabled(b2);
+	(*a_scrActions)["pageCopy"]->setEnabled(b2);
+	(*a_scrActions)["pageMove"]->setEnabled(b2);
+	(*a_scrActions)["pageApplyMasterPage"]->setEnabled(b2);
+	(*a_scrActions)["pageCopyToMasterPage"]->setEnabled(b2);
+	(*a_scrActions)["editMasterPages"]->setEnabled(b2);
+	(*a_scrActions)["fileNew"]->setEnabled(b2);
+	(*a_scrActions)["fileNewFromTemplate"]->setEnabled(b2);
+	(*a_scrActions)["fileOpen"]->setEnabled(b2);
+	(*a_scrActions)["fileClose"]->setEnabled(!b2);
+	(*a_scrActions)["fileSave"]->setEnabled(b2);
+	(*a_scrActions)["fileExportAsEPS"]->setEnabled(b2);
+	(*a_scrActions)["fileExportAsPDF"]->setEnabled(b2);
 	if (b2)
 	{
-		(*scrActions)["fileSave"]->setEnabled(!doc->isConverted);
+		(*a_scrActions)["fileSave"]->setEnabled(!doc->isConverted);
 		if ( ScCore->haveGS() || ScCore->isWinGUI() )
-			(*scrActions)["PrintPreview"]->setEnabled(true);
+			(*a_scrActions)["PrintPreview"]->setEnabled(true);
 		bool setter = doc->DocPages.count() > 1 ? true : false;
-		(*scrActions)["pageDelete"]->setEnabled(setter);
-		(*scrActions)["pageMove"]->setEnabled(setter);
-	}
-
-	(*scrActions)["fileRevert"]->setEnabled(b2);
-	(*scrActions)["fileDocSetup150"]->setEnabled(b2);
-	(*scrActions)["filePrint"]->setEnabled(b2);
+		(*a_scrActions)["pageDelete"]->setEnabled(setter);
+		(*a_scrActions)["pageMove"]->setEnabled(setter);
+	}
+
+	(*a_scrActions)["fileRevert"]->setEnabled(b2);
+	(*a_scrActions)["fileDocSetup150"]->setEnabled(b2);
+	(*a_scrActions)["filePrint"]->setEnabled(b2);
 	if ( ScCore->haveGS() || ScCore->isWinGUI() )
-		(*scrActions)["PrintPreview"]->setEnabled(b2);
-	(*scrActions)["toolsPDFPushButton"]->setEnabled(b2);
-	(*scrActions)["toolsPDFRadioButton"]->setEnabled(b2);
-	(*scrActions)["toolsPDFTextField"]->setEnabled(b2);
-	(*scrActions)["toolsPDFCheckBox"]->setEnabled(b2);
-	(*scrActions)["toolsPDFComboBox"]->setEnabled(b2);
-	(*scrActions)["toolsPDFListBox"]->setEnabled(b2);
-	(*scrActions)["toolsPDFAnnotText"]->setEnabled(b2);
+		(*a_scrActions)["PrintPreview"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFPushButton"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFRadioButton"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFTextField"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFCheckBox"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFComboBox"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFListBox"]->setEnabled(b2);
+	(*a_scrActions)["toolsPDFAnnotText"]->setEnabled(b2);
 #ifdef HAVE_OSG
 	(*scrActions)["toolsPDFAnnot3D"]->setEnabled(b2);
 #endif
@@ -227,363 +644,363 @@
 void AppModeHelper::changeLayer(ScribusDoc *doc, bool clipScrapHaveData)
 {
 	bool setter = !doc->layerLocked( doc->activeLayer() );
-	(*scrActions)["editPaste"]->setEnabled(clipScrapHaveData && setter);
-	(*scrActions)["editSelectAll"]->setEnabled(setter);
-	(*scrActions)["editSelectAllOnLayer"]->setEnabled(setter);
-	(*scrActions)["editDeselectAll"]->setEnabled(false);
-	(*scrActions)["insertFrame"]->setEnabled(setter);
-	(*scrActions)["toolsSelect"]->setEnabled(setter);
-	(*scrActions)["toolsInsertTextFrame"]->setEnabled(setter);
-	(*scrActions)["toolsInsertImageFrame"]->setEnabled(setter);
-	(*scrActions)["toolsInsertTable"]->setEnabled(setter);
-	(*scrActions)["toolsInsertShape"]->setEnabled(setter);
-	(*scrActions)["toolsInsertLine"]->setEnabled(setter);
-	(*scrActions)["toolsInsertBezier"]->setEnabled(setter);
-	(*scrActions)["toolsInsertFreehandLine"]->setEnabled(setter);
-	(*scrActions)["toolsInsertCalligraphicLine"]->setEnabled(setter);
-	(*scrActions)["toolsInsertPolygon"]->setEnabled(setter);
-	(*scrActions)["toolsInsertArc"]->setEnabled(setter);
-	(*scrActions)["toolsInsertSpiral"]->setEnabled(setter);
-	(*scrActions)["toolsInsertRenderFrame"]->setEnabled(setter);
+	(*a_scrActions)["editPaste"]->setEnabled(clipScrapHaveData && setter);
+	(*a_scrActions)["editSelectAll"]->setEnabled(setter);
+	(*a_scrActions)["editSelectAllOnLayer"]->setEnabled(setter);
+	(*a_scrActions)["editDeselectAll"]->setEnabled(false);
+	(*a_scrActions)["insertFrame"]->setEnabled(setter);
+	(*a_scrActions)["toolsSelect"]->setEnabled(setter);
+	(*a_scrActions)["toolsInsertTextFrame"]->setEnabled(setter);
+	(*a_scrActions)["toolsInsertImageFrame"]->setEnabled(setter);
+	(*a_scrActions)["toolsInsertTable"]->setEnabled(setter);
+	(*a_scrActions)["toolsInsertShape"]->setEnabled(setter);
+	(*a_scrActions)["toolsInsertLine"]->setEnabled(setter);
+	(*a_scrActions)["toolsInsertBezier"]->setEnabled(setter);
+	(*a_scrActions)["toolsInsertFreehandLine"]->setEnabled(setter);
+	(*a_scrActions)["toolsInsertCalligraphicLine"]->setEnabled(setter);
+	(*a_scrActions)["toolsInsertPolygon"]->setEnabled(setter);
+	(*a_scrActions)["toolsInsertArc"]->setEnabled(setter);
+	(*a_scrActions)["toolsInsertSpiral"]->setEnabled(setter);
+	(*a_scrActions)["toolsInsertRenderFrame"]->setEnabled(setter);
 	bool setter2=doc->masterPageMode() ? false : setter;
-	(*scrActions)["toolsPDFPushButton"]->setEnabled(setter2);
-	(*scrActions)["toolsPDFRadioButton"]->setEnabled(setter2);
-	(*scrActions)["toolsPDFTextField"]->setEnabled(setter2);
-	(*scrActions)["toolsPDFCheckBox"]->setEnabled(setter2);
-	(*scrActions)["toolsPDFComboBox"]->setEnabled(setter2);
-	(*scrActions)["toolsPDFListBox"]->setEnabled(setter2);
-	(*scrActions)["toolsPDFAnnotText"]->setEnabled(setter2);
-	(*scrActions)["toolsPDFAnnotLink"]->setEnabled(setter);
+	(*a_scrActions)["toolsPDFPushButton"]->setEnabled(setter2);
+	(*a_scrActions)["toolsPDFRadioButton"]->setEnabled(setter2);
+	(*a_scrActions)["toolsPDFTextField"]->setEnabled(setter2);
+	(*a_scrActions)["toolsPDFCheckBox"]->setEnabled(setter2);
+	(*a_scrActions)["toolsPDFComboBox"]->setEnabled(setter2);
+	(*a_scrActions)["toolsPDFListBox"]->setEnabled(setter2);
+	(*a_scrActions)["toolsPDFAnnotText"]->setEnabled(setter2);
+	(*a_scrActions)["toolsPDFAnnotLink"]->setEnabled(setter);
 }
 
 void AppModeHelper::mainWindowHasNewDoc(ScribusDoc *doc, bool clipScrapHaveData)
 {
-	(*scrActions)["filePrint"]->setEnabled(true);
-	(*scrActions)["fileSave"]->setEnabled(!doc->isConverted);
-	(*scrActions)["fileClose"]->setEnabled(true);
-	(*scrActions)["fileDocSetup150"]->setEnabled(true);
-	(*scrActions)["fileRevert"]->setEnabled(false);
-	(*scrActions)["fileCollect"]->setEnabled(true);
-	(*scrActions)["fileSaveAs"]->setEnabled(true);
-	(*scrActions)["fileExportAsEPS"]->setEnabled(true);
-	(*scrActions)["fileExportAsPDF"]->setEnabled(true);
-	(*scrActions)["fileImportVector"]->setEnabled(true);
-	(*scrActions)["pageImport"]->setEnabled(true);
+	(*a_scrActions)["filePrint"]->setEnabled(true);
+	(*a_scrActions)["fileSave"]->setEnabled(!doc->isConverted);
+	(*a_scrActions)["fileClose"]->setEnabled(true);
+	(*a_scrActions)["fileDocSetup150"]->setEnabled(true);
+	(*a_scrActions)["fileRevert"]->setEnabled(false);
+	(*a_scrActions)["fileCollect"]->setEnabled(true);
+	(*a_scrActions)["fileSaveAs"]->setEnabled(true);
+	(*a_scrActions)["fileExportAsEPS"]->setEnabled(true);
+	(*a_scrActions)["fileExportAsPDF"]->setEnabled(true);
+	(*a_scrActions)["fileImportVector"]->setEnabled(true);
+	(*a_scrActions)["pageImport"]->setEnabled(true);
 
 	if ( ScCore->haveGS() || ScCore->isWinGUI() )
-		(*scrActions)["PrintPreview"]->setEnabled(true);
-
-	if ((*scrActions)["SaveAsDocumentTemplate"])
-		(*scrActions)["SaveAsDocumentTemplate"]->setEnabled(true);
-
-	(*scrActions)["editCut"]->setEnabled(false);
-	(*scrActions)["editCopy"]->setEnabled(false);
-	(*scrActions)["editPaste"]->setEnabled(clipScrapHaveData);
-	(*scrActions)["editCopyContents"]->setEnabled(false);
-	(*scrActions)["editPasteContents"]->setEnabled(false);
-	(*scrActions)["editPasteContentsAbs"]->setEnabled(false);
-	(*scrActions)["editSelectAll"]->setEnabled(true);
-	(*scrActions)["editSelectAllOnLayer"]->setEnabled(true);
-	(*scrActions)["editDeselectAll"]->setEnabled(false);
-	(*scrActions)["editReplaceColors"]->setEnabled(true);
-	(*scrActions)["editStyles"]->setEnabled(true);
-	(*scrActions)["editMarks"]->setEnabled(true);
-	(*scrActions)["editNotesStyles"]->setEnabled(true);
-	(*scrActions)["editMasterPages"]->setEnabled(true);
-	(*scrActions)["editJavascripts"]->setEnabled(true);
-
-	(*scrActions)["viewFitInWindow"]->setEnabled(true);
-	(*scrActions)["viewFitWidth"]->setEnabled(true);
-	(*scrActions)["viewFit50"]->setEnabled(true);
-	(*scrActions)["viewFit75"]->setEnabled(true);
-	(*scrActions)["viewFit100"]->setEnabled(true);
-	(*scrActions)["viewFit200"]->setEnabled(true);
-	(*scrActions)["viewFit400"]->setEnabled(true);
-
-	(*scrActions)["viewSnapToGrid"]->setChecked(doc->SnapGrid);
-	(*scrActions)["viewSnapToGuides"]->setChecked(doc->SnapGuides);
-	(*scrActions)["viewSnapToElements"]->setChecked(doc->SnapElement);
-	(*scrActions)["viewShowRulers"]->setEnabled(true);
-
-	(*scrActions)["insertFrame"]->setEnabled(true);
-
-	(*scrActions)["toolsSelect"]->setEnabled(true);
-	(*scrActions)["toolsZoom"]->setEnabled(true);
-	(*scrActions)["toolsInsertTextFrame"]->setEnabled(true);
-	(*scrActions)["toolsInsertImageFrame"]->setEnabled(true);
-	(*scrActions)["toolsInsertTable"]->setEnabled(true);
-	(*scrActions)["toolsInsertShape"]->setEnabled(true);
-	(*scrActions)["toolsInsertLine"]->setEnabled(true);
-	(*scrActions)["toolsInsertBezier"]->setEnabled(true);
-	(*scrActions)["toolsInsertFreehandLine"]->setEnabled(true);
-	(*scrActions)["toolsInsertCalligraphicLine"]->setEnabled(true);
-	(*scrActions)["toolsInsertPolygon"]->setEnabled(true);
-	(*scrActions)["toolsInsertArc"]->setEnabled(true);
-	(*scrActions)["toolsInsertSpiral"]->setEnabled(true);
-	(*scrActions)["toolsInsertRenderFrame"]->setEnabled(true);
-	(*scrActions)["toolsMeasurements"]->setEnabled(true);
-	(*scrActions)["toolsEyeDropper"]->setEnabled(true);
-	(*scrActions)["toolsPDFPushButton"]->setEnabled(true);
-	(*scrActions)["toolsPDFRadioButton"]->setEnabled(true);
-	(*scrActions)["toolsPDFTextField"]->setEnabled(true);
-	(*scrActions)["toolsPDFCheckBox"]->setEnabled(true);
-	(*scrActions)["toolsPDFComboBox"]->setEnabled(true);
-	(*scrActions)["toolsPDFListBox"]->setEnabled(true);
-	(*scrActions)["toolsPDFAnnotText"]->setEnabled(true);
-	(*scrActions)["toolsPDFAnnotLink"]->setEnabled(true);
+		(*a_scrActions)["PrintPreview"]->setEnabled(true);
+
+	if ((*a_scrActions)["SaveAsDocumentTemplate"])
+		(*a_scrActions)["SaveAsDocumentTemplate"]->setEnabled(true);
+
+	(*a_scrActions)["editCut"]->setEnabled(false);
+	(*a_scrActions)["editCopy"]->setEnabled(false);
+	(*a_scrActions)["editPaste"]->setEnabled(clipScrapHaveData);
+	(*a_scrActions)["editCopyContents"]->setEnabled(false);
+	(*a_scrActions)["editPasteContents"]->setEnabled(false);
+	(*a_scrActions)["editPasteContentsAbs"]->setEnabled(false);
+	(*a_scrActions)["editSelectAll"]->setEnabled(true);
+	(*a_scrActions)["editSelectAllOnLayer"]->setEnabled(true);
+	(*a_scrActions)["editDeselectAll"]->setEnabled(false);
+	(*a_scrActions)["editReplaceColors"]->setEnabled(true);
+	(*a_scrActions)["editStyles"]->setEnabled(true);
+	(*a_scrActions)["editMarks"]->setEnabled(true);
+	(*a_scrActions)["editNotesStyles"]->setEnabled(true);
+	(*a_scrActions)["editMasterPages"]->setEnabled(true);
+	(*a_scrActions)["editJavascripts"]->setEnabled(true);
+
+	(*a_scrActions)["viewFitInWindow"]->setEnabled(true);
+	(*a_scrActions)["viewFitWidth"]->setEnabled(true);
+	(*a_scrActions)["viewFit50"]->setEnabled(true);
+	(*a_scrActions)["viewFit75"]->setEnabled(true);
+	(*a_scrActions)["viewFit100"]->setEnabled(true);
+	(*a_scrActions)["viewFit200"]->setEnabled(true);
+	(*a_scrActions)["viewFit400"]->setEnabled(true);
+
+	(*a_scrActions)["viewSnapToGrid"]->setChecked(doc->SnapGrid);
+	(*a_scrActions)["viewSnapToGuides"]->setChecked(doc->SnapGuides);
+	(*a_scrActions)["viewSnapToElements"]->setChecked(doc->SnapElement);
+	(*a_scrActions)["viewShowRulers"]->setEnabled(true);
+
+	(*a_scrActions)["insertFrame"]->setEnabled(true);
+
+	(*a_scrActions)["toolsSelect"]->setEnabled(true);
+	(*a_scrActions)["toolsZoom"]->setEnabled(true);
+	(*a_scrActions)["toolsInsertTextFrame"]->setEnabled(true);
+	(*a_scrActions)["toolsInsertImageFrame"]->setEnabled(true);
+	(*a_scrActions)["toolsInsertTable"]->setEnabled(true);
+	(*a_scrActions)["toolsInsertShape"]->setEnabled(true);
+	(*a_scrActions)["toolsInsertLine"]->setEnabled(true);
+	(*a_scrActions)["toolsInsertBezier"]->setEnabled(true);
+	(*a_scrActions)["toolsInsertFreehandLine"]->setEnabled(true);
+	(*a_scrActions)["toolsInsertCalligraphicLine"]->setEnabled(true);
+	(*a_scrActions)["toolsInsertPolygon"]->setEnabled(true);
+	(*a_scrActions)["toolsInsertArc"]->setEnabled(true);
+	(*a_scrActions)["toolsInsertSpiral"]->setEnabled(true);
+	(*a_scrActions)["toolsInsertRenderFrame"]->setEnabled(true);
+	(*a_scrActions)["toolsMeasurements"]->setEnabled(true);
+	(*a_scrActions)["toolsEyeDropper"]->setEnabled(true);
+	(*a_scrActions)["toolsPDFPushButton"]->setEnabled(true);
+	(*a_scrActions)["toolsPDFRadioButton"]->setEnabled(true);
+	(*a_scrActions)["toolsPDFTextField"]->setEnabled(true);
+	(*a_scrActions)["toolsPDFCheckBox"]->setEnabled(true);
+	(*a_scrActions)["toolsPDFComboBox"]->setEnabled(true);
+	(*a_scrActions)["toolsPDFListBox"]->setEnabled(true);
+	(*a_scrActions)["toolsPDFAnnotText"]->setEnabled(true);
+	(*a_scrActions)["toolsPDFAnnotLink"]->setEnabled(true);
 #ifdef HAVE_OSG
 	(*scrActions)["toolsPDFAnnot3D"]->setEnabled(true);
 #endif
-	(*scrActions)["toolsPreflightVerifier"]->setEnabled(true);
+	(*a_scrActions)["toolsPreflightVerifier"]->setEnabled(true);
 	bool setter = doc->DocPages.count() > 1 ? true : false;
-	(*scrActions)["pageDelete"]->setEnabled(setter);
-	(*scrActions)["pageMove"]->setEnabled(setter);
-	(*scrActions)["pageInsert"]->setEnabled(true);
-	(*scrActions)["pageImport"]->setEnabled(true);
-	(*scrActions)["pageCopy"]->setEnabled(true);
-	(*scrActions)["pageApplyMasterPage"]->setEnabled(true);
-	(*scrActions)["pageCopyToMasterPage"]->setEnabled(true);
-	(*scrActions)["pageManageGuides"]->setEnabled(true);
-	(*scrActions)["pageManageMargins"]->setEnabled(true);
+	(*a_scrActions)["pageDelete"]->setEnabled(setter);
+	(*a_scrActions)["pageMove"]->setEnabled(setter);
+	(*a_scrActions)["pageInsert"]->setEnabled(true);
+	(*a_scrActions)["pageImport"]->setEnabled(true);
+	(*a_scrActions)["pageCopy"]->setEnabled(true);
+	(*a_scrActions)["pageApplyMasterPage"]->setEnabled(true);
+	(*a_scrActions)["pageCopyToMasterPage"]->setEnabled(true);
+	(*a_scrActions)["pageManageGuides"]->setEnabled(true);
+	(*a_scrActions)["pageManageMargins"]->setEnabled(true);
 }
 
 void AppModeHelper::mainWindowSwitchWin(ScribusDoc *doc)
 {
-	(*scrActions)["fileClose"]->setEnabled(true);
+	(*a_scrActions)["fileClose"]->setEnabled(true);
 	if (doc->masterPageMode() || doc->symbolEditMode() || doc->inlineEditMode())
 	{
-		(*scrActions)["pageInsert"]->setEnabled(false);
-		(*scrActions)["pageDelete"]->setEnabled(false);
-		(*scrActions)["pageCopy"]->setEnabled(false);
-		(*scrActions)["pageMove"]->setEnabled(false);
-		(*scrActions)["pageApplyMasterPage"]->setEnabled(false);
-		(*scrActions)["pageCopyToMasterPage"]->setEnabled(false);
-		(*scrActions)["editMasterPages"]->setEnabled(false);
-		(*scrActions)["fileNew"]->setEnabled(false);
-		(*scrActions)["fileNewFromTemplate"]->setEnabled(false);
+		(*a_scrActions)["pageInsert"]->setEnabled(false);
+		(*a_scrActions)["pageDelete"]->setEnabled(false);
+		(*a_scrActions)["pageCopy"]->setEnabled(false);
+		(*a_scrActions)["pageMove"]->setEnabled(false);
+		(*a_scrActions)["pageApplyMasterPage"]->setEnabled(false);
+		(*a_scrActions)["pageCopyToMasterPage"]->setEnabled(false);
+		(*a_scrActions)["editMasterPages"]->setEnabled(false);
+		(*a_scrActions)["fileNew"]->setEnabled(false);
+		(*a_scrActions)["fileNewFromTemplate"]->setEnabled(false);
 		if (doc->symbolEditMode() || doc->inlineEditMode())
 		{
-			(*scrActions)["fileCollect"]->setEnabled(false);
-			(*scrActions)["fileSaveAs"]->setEnabled(false);
-			(*scrActions)["fileExportAsEPS"]->setEnabled(false);
-			(*scrActions)["fileExportAsPDF"]->setEnabled(false);
-			(*scrActions)["fileSave"]->setEnabled(false);
+			(*a_scrActions)["fileCollect"]->setEnabled(false);
+			(*a_scrActions)["fileSaveAs"]->setEnabled(false);
+			(*a_scrActions)["fileExportAsEPS"]->setEnabled(false);
+			(*a_scrActions)["fileExportAsPDF"]->setEnabled(false);
+			(*a_scrActions)["fileSave"]->setEnabled(false);
 		}
 		else
-			(*scrActions)["fileSave"]->setEnabled(!doc->isConverted);
-		(*scrActions)["fileOpen"]->setEnabled(false);
-		(*scrActions)["fileRevert"]->setEnabled(false);
-		(*scrActions)["toolsPDFPushButton"]->setEnabled(false);
-		(*scrActions)["toolsPDFRadioButton"]->setEnabled(false);
-		(*scrActions)["toolsPDFTextField"]->setEnabled(false);
-		(*scrActions)["toolsPDFCheckBox"]->setEnabled(false);
-		(*scrActions)["toolsPDFComboBox"]->setEnabled(false);
-		(*scrActions)["toolsPDFListBox"]->setEnabled(false);
-		(*scrActions)["toolsPDFAnnotText"]->setEnabled(false);
+			(*a_scrActions)["fileSave"]->setEnabled(!doc->isConverted);
+		(*a_scrActions)["fileOpen"]->setEnabled(false);
+		(*a_scrActions)["fileRevert"]->setEnabled(false);
+		(*a_scrActions)["toolsPDFPushButton"]->setEnabled(false);
+		(*a_scrActions)["toolsPDFRadioButton"]->setEnabled(false);
+		(*a_scrActions)["toolsPDFTextField"]->setEnabled(false);
+		(*a_scrActions)["toolsPDFCheckBox"]->setEnabled(false);
+		(*a_scrActions)["toolsPDFComboBox"]->setEnabled(false);
+		(*a_scrActions)["toolsPDFListBox"]->setEnabled(false);
+		(*a_scrActions)["toolsPDFAnnotText"]->setEnabled(false);
 #ifdef HAVE_OSG
 		(*scrActions)["toolsPDFAnnot3D"]->setEnabled(false);
 #endif
 	}
 	else
 	{
-		(*scrActions)["editMasterPages"]->setEnabled(true);
-		(*scrActions)["fileNew"]->setEnabled(true);
-		(*scrActions)["fileNewFromTemplate"]->setEnabled(true);
-		(*scrActions)["fileOpen"]->setEnabled(true);
-		(*scrActions)["fileClose"]->setEnabled(true);
-		(*scrActions)["fileSave"]->setEnabled(!doc->isConverted);
-		(*scrActions)["fileRevert"]->setEnabled(false);
+		(*a_scrActions)["editMasterPages"]->setEnabled(true);
+		(*a_scrActions)["fileNew"]->setEnabled(true);
+		(*a_scrActions)["fileNewFromTemplate"]->setEnabled(true);
+		(*a_scrActions)["fileOpen"]->setEnabled(true);
+		(*a_scrActions)["fileClose"]->setEnabled(true);
+		(*a_scrActions)["fileSave"]->setEnabled(!doc->isConverted);
+		(*a_scrActions)["fileRevert"]->setEnabled(false);
 
 		if (!doc->isModified())
 		{
 			bool setter = doc->DocPages.count() > 1 ? true : false;
-			(*scrActions)["pageDelete"]->setEnabled(setter);
-			(*scrActions)["pageMove"]->setEnabled(setter);
+			(*a_scrActions)["pageDelete"]->setEnabled(setter);
+			(*a_scrActions)["pageMove"]->setEnabled(setter);
 		}
-		(*scrActions)["pageInsert"]->setEnabled(true);
-		(*scrActions)["pageImport"]->setEnabled(true);
-		(*scrActions)["pageCopy"]->setEnabled(true);
-		(*scrActions)["pageApplyMasterPage"]->setEnabled(true);
-		(*scrActions)["pageCopyToMasterPage"]->setEnabled(true);
-		(*scrActions)["pageManageGuides"]->setEnabled(true);
-		(*scrActions)["pageManageMargins"]->setEnabled(true);
-
-		(*scrActions)["fileSaveAs"]->setEnabled(true);
-		(*scrActions)["fileCollect"]->setEnabled(true);
-		(*scrActions)["toolsPDFPushButton"]->setEnabled(true);
-		(*scrActions)["toolsPDFRadioButton"]->setEnabled(true);
-		(*scrActions)["toolsPDFTextField"]->setEnabled(true);
-		(*scrActions)["toolsPDFCheckBox"]->setEnabled(true);
-		(*scrActions)["toolsPDFComboBox"]->setEnabled(true);
-		(*scrActions)["toolsPDFListBox"]->setEnabled(true);
-		(*scrActions)["toolsPDFAnnotText"]->setEnabled(true);
+		(*a_scrActions)["pageInsert"]->setEnabled(true);
+		(*a_scrActions)["pageImport"]->setEnabled(true);
+		(*a_scrActions)["pageCopy"]->setEnabled(true);
+		(*a_scrActions)["pageApplyMasterPage"]->setEnabled(true);
+		(*a_scrActions)["pageCopyToMasterPage"]->setEnabled(true);
+		(*a_scrActions)["pageManageGuides"]->setEnabled(true);
+		(*a_scrActions)["pageManageMargins"]->setEnabled(true);
+
+		(*a_scrActions)["fileSaveAs"]->setEnabled(true);
+		(*a_scrActions)["fileCollect"]->setEnabled(true);
+		(*a_scrActions)["toolsPDFPushButton"]->setEnabled(true);
+		(*a_scrActions)["toolsPDFRadioButton"]->setEnabled(true);
+		(*a_scrActions)["toolsPDFTextField"]->setEnabled(true);
+		(*a_scrActions)["toolsPDFCheckBox"]->setEnabled(true);
+		(*a_scrActions)["toolsPDFComboBox"]->setEnabled(true);
+		(*a_scrActions)["toolsPDFListBox"]->setEnabled(true);
+		(*a_scrActions)["toolsPDFAnnotText"]->setEnabled(true);
 #ifdef HAVE_OSG
 		(*scrActions)["toolsPDFAnnot3D"]->setEnabled(true);
 #endif
 	}
 
-	(*scrActions)["viewSnapToGrid"]->setChecked(doc->SnapGrid);
-	(*scrActions)["viewSnapToGuides"]->setChecked(doc->SnapGuides);
-	(*scrActions)["viewSnapToElements"]->setChecked(doc->SnapElement);
+	(*a_scrActions)["viewSnapToGrid"]->setChecked(doc->SnapGrid);
+	(*a_scrActions)["viewSnapToGuides"]->setChecked(doc->SnapGuides);
+	(*a_scrActions)["viewSnapToElements"]->setChecked(doc->SnapElement);
 }
 
 void AppModeHelper::mainWindowCloseLastDoc()
 {
 	if ( ScCore->haveGS() || ScCore->isWinGUI() )
-		(*scrActions)["PrintPreview"]->setEnabled(false);
-	if ((*scrActions)["SaveAsDocumentTemplate"])
-		(*scrActions)["SaveAsDocumentTemplate"]->setEnabled(false);
-	(*scrActions)["editClearContents"]->setEnabled(false);
-	(*scrActions)["editCopy"]->setEnabled(false);
-	(*scrActions)["editCut"]->setEnabled(false);
-	(*scrActions)["editDeselectAll"]->setEnabled(false);
-	(*scrActions)["editEditRenderSource"]->setEnabled(false);
-	(*scrActions)["editEditWithImageEditor"]->setEnabled(false);
-	(*scrActions)["editJavascripts"]->setEnabled(false);
-	(*scrActions)["editMarks"]->setEnabled(false);
-	(*scrActions)["editMasterPages"]->setEnabled(false);
-	(*scrActions)["editNotesStyles"]->setEnabled(false);
-	(*scrActions)["editPaste"]->setEnabled(false);
-	(*scrActions)["editRedoAction"]->setEnabled(false);
-	(*scrActions)["editReplaceColors"]->setEnabled(false);
-	(*scrActions)["editSearchReplace"]->setEnabled(false);
-	(*scrActions)["editSelectAll"]->setEnabled(false);
-	(*scrActions)["editSelectAllOnLayer"]->setEnabled(false);
-	(*scrActions)["editStyles"]->setEnabled(false);
-	(*scrActions)["editUndoAction"]->setEnabled(false);
-	(*scrActions)["extrasDeHyphenateText"]->setEnabled(false);
-	(*scrActions)["extrasHyphenateText"]->setEnabled(false);
-	(*scrActions)["fileClose"]->setEnabled(false);
-	(*scrActions)["fileCollect"]->setEnabled(false);
-	(*scrActions)["fileDocSetup150"]->setEnabled(false);
-	(*scrActions)["fileExportAsEPS"]->setEnabled(false);
-	(*scrActions)["fileExportAsPDF"]->setEnabled(false);
-	(*scrActions)["fileExportText"]->setEnabled(false);
-	(*scrActions)["fileImportAppendText"]->setEnabled(false);
-	(*scrActions)["fileImportImage"]->setEnabled(false);
-	(*scrActions)["fileImportText"]->setEnabled(false);
-	(*scrActions)["fileImportText2"]->setEnabled(false);
-	(*scrActions)["fileImportVector"]->setEnabled(false);
-	(*scrActions)["filePrint"]->setEnabled(false);
-	(*scrActions)["fileRevert"]->setEnabled(false);
-	(*scrActions)["fileSave"]->setEnabled(false);
-	(*scrActions)["fileSaveAs"]->setEnabled(false);
-	(*scrActions)["insertFrame"]->setEnabled(false);
-	(*scrActions)["insertSampleText"]->setEnabled(false);
-	(*scrActions)["itemAdjustFrameToImage"]->setEnabled(false);
-	(*scrActions)["itemAdjustImageToFrame"]->setEnabled(false);
-	(*scrActions)["itemAttributes"]->setEnabled(false);
-	(*scrActions)["itemDelete"]->setEnabled(false);
-	(*scrActions)["itemDuplicate"]->setEnabled(false);
-	(*scrActions)["itemExtendedImageProperties"]->setEnabled(false);
-	(*scrActions)["itemLower"]->setEnabled(false);
-	(*scrActions)["itemLowerToBottom"]->setEnabled(false);
-	(*scrActions)["itemMulDuplicate"]->setEnabled(false);
-	(*scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
-	(*scrActions)["itemPDFFieldProps"]->setEnabled(false);
-	(*scrActions)["itemPreviewFull"]->setEnabled(false);
-	(*scrActions)["itemPreviewLow"]->setEnabled(false);
-	(*scrActions)["itemPreviewNormal"]->setEnabled(false);
-	(*scrActions)["itemRaise"]->setEnabled(false);
-	(*scrActions)["itemRaiseToTop"]->setEnabled(false);
-	(*scrActions)["itemSendToInline"]->setEnabled(false);
-	(*scrActions)["itemSendToPattern"]->setEnabled(false);
-	(*scrActions)["itemToggleInlineImage"]->setEnabled(false);
-	(*scrActions)["itemTransform"]->setEnabled(false);
-	(*scrActions)["itemUpdateImage"]->setEnabled(false);
-	(*scrActions)["pageApplyMasterPage"]->setEnabled(false);
-	(*scrActions)["pageCopy"]->setEnabled(false);
-	(*scrActions)["pageCopyToMasterPage"]->setEnabled(false);
-	(*scrActions)["pageDelete"]->setEnabled(false);
-	(*scrActions)["pageImport"]->setEnabled(false);
-	(*scrActions)["pageImport"]->setEnabled(false);
-	(*scrActions)["pageInsert"]->setEnabled(false);
-	(*scrActions)["pageManageGuides"]->setEnabled(false);
-	(*scrActions)["pageManageMargins"]->setEnabled(false);
-	(*scrActions)["pageMove"]->setEnabled(false);
-	(*scrActions)["toolsCopyProperties"]->setEnabled(false);
-	(*scrActions)["toolsEditContents"]->setEnabled(false);
-	(*scrActions)["toolsEditWithStoryEditor"]->setEnabled(false);
-	(*scrActions)["toolsEyeDropper"]->setEnabled(false);
-	(*scrActions)["toolsInsertArc"]->setEnabled(false);
-	(*scrActions)["toolsInsertBezier"]->setEnabled(false);
-	(*scrActions)["toolsInsertCalligraphicLine"]->setEnabled(false);
-	(*scrActions)["toolsInsertFreehandLine"]->setEnabled(false);
-	(*scrActions)["toolsInsertImageFrame"]->setEnabled(false);
-	(*scrActions)["toolsInsertLine"]->setEnabled(false);
-	(*scrActions)["toolsInsertPolygon"]->setEnabled(false);
-	(*scrActions)["toolsInsertRenderFrame"]->setEnabled(false);
-	(*scrActions)["toolsInsertShape"]->setEnabled(false);
-	(*scrActions)["toolsInsertSpiral"]->setEnabled(false);
-	(*scrActions)["toolsInsertTable"]->setEnabled(false);
-	(*scrActions)["toolsInsertTextFrame"]->setEnabled(false);
-	(*scrActions)["toolsLinkTextFrame"]->setEnabled(false);
-	(*scrActions)["toolsMeasurements"]->setEnabled(false);
-	(*scrActions)["toolsPDFAnnotLink"]->setEnabled(false);
-	(*scrActions)["toolsPDFAnnotText"]->setEnabled(false);
-	(*scrActions)["toolsPDFCheckBox"]->setEnabled(false);
-	(*scrActions)["toolsPDFComboBox"]->setEnabled(false);
-	(*scrActions)["toolsPDFListBox"]->setEnabled(false);
-	(*scrActions)["toolsPDFPushButton"]->setEnabled(false);
-	(*scrActions)["toolsPDFRadioButton"]->setEnabled(false);
-	(*scrActions)["toolsPDFTextField"]->setEnabled(false);
-	(*scrActions)["toolsPreflightVerifier"]->setEnabled(false);
-	(*scrActions)["toolsRotate"]->setEnabled(false);
-	(*scrActions)["toolsSelect"]->setEnabled(false);
-	(*scrActions)["toolsUnlinkTextFrame"]->setEnabled(false);
-	(*scrActions)["toolsUnlinkTextFrameWithTextCopy"]->setEnabled(false);
-	(*scrActions)["toolsUnlinkTextFrameWithTextCut"]->setEnabled(false);
-	(*scrActions)["toolsZoom"]->setEnabled(false);
-	(*scrActions)["viewFit100"]->setEnabled(false);
-	(*scrActions)["viewFit200"]->setEnabled(false);
-	(*scrActions)["viewFit400"]->setEnabled(false);
-	(*scrActions)["viewFit50"]->setEnabled(false);
-	(*scrActions)["viewFit75"]->setEnabled(false);
-	(*scrActions)["viewFitInWindow"]->setEnabled(false);
-	(*scrActions)["viewFitWidth"]->setEnabled(false);
-	(*scrActions)["viewShowRulers"]->setEnabled(false);
-	(*scrActions)["viewSnapToElements"]->setChecked(false);
-	(*scrActions)["viewSnapToGrid"]->setChecked(false);
-	(*scrActions)["viewSnapToGuides"]->setChecked(false);
+		(*a_scrActions)["PrintPreview"]->setEnabled(false);
+	if ((*a_scrActions)["SaveAsDocumentTemplate"])
+		(*a_scrActions)["SaveAsDocumentTemplate"]->setEnabled(false);
+	(*a_scrActions)["editClearContents"]->setEnabled(false);
+	(*a_scrActions)["editCopy"]->setEnabled(false);
+	(*a_scrActions)["editCut"]->setEnabled(false);
+	(*a_scrActions)["editDeselectAll"]->setEnabled(false);
+	(*a_scrActions)["editEditRenderSource"]->setEnabled(false);
+	(*a_scrActions)["editEditWithImageEditor"]->setEnabled(false);
+	(*a_scrActions)["editJavascripts"]->setEnabled(false);
+	(*a_scrActions)["editMarks"]->setEnabled(false);
+	(*a_scrActions)["editMasterPages"]->setEnabled(false);
+	(*a_scrActions)["editNotesStyles"]->setEnabled(false);
+	(*a_scrActions)["editPaste"]->setEnabled(false);
+	(*a_scrActions)["editRedoAction"]->setEnabled(false);
+	(*a_scrActions)["editReplaceColors"]->setEnabled(false);
+	(*a_scrActions)["editSearchReplace"]->setEnabled(false);
+	(*a_scrActions)["editSelectAll"]->setEnabled(false);
+	(*a_scrActions)["editSelectAllOnLayer"]->setEnabled(false);
+	(*a_scrActions)["editStyles"]->setEnabled(false);
+	(*a_scrActions)["editUndoAction"]->setEnabled(false);
+	(*a_scrActions)["extrasDeHyphenateText"]->setEnabled(false);
+	(*a_scrActions)["extrasHyphenateText"]->setEnabled(false);
+	(*a_scrActions)["fileClose"]->setEnabled(false);
+	(*a_scrActions)["fileCollect"]->setEnabled(false);
+	(*a_scrActions)["fileDocSetup150"]->setEnabled(false);
+	(*a_scrActions)["fileExportAsEPS"]->setEnabled(false);
+	(*a_scrActions)["fileExportAsPDF"]->setEnabled(false);
+	(*a_scrActions)["fileExportText"]->setEnabled(false);
+	(*a_scrActions)["fileImportAppendText"]->setEnabled(false);
+	(*a_scrActions)["fileImportImage"]->setEnabled(false);
+	(*a_scrActions)["fileImportText"]->setEnabled(false);
+	(*a_scrActions)["fileImportText2"]->setEnabled(false);
+	(*a_scrActions)["fileImportVector"]->setEnabled(false);
+	(*a_scrActions)["filePrint"]->setEnabled(false);
+	(*a_scrActions)["fileRevert"]->setEnabled(false);
+	(*a_scrActions)["fileSave"]->setEnabled(false);
+	(*a_scrActions)["fileSaveAs"]->setEnabled(false);
+	(*a_scrActions)["insertFrame"]->setEnabled(false);
+	(*a_scrActions)["insertSampleText"]->setEnabled(false);
+	(*a_scrActions)["itemAdjustFrameToImage"]->setEnabled(false);
+	(*a_scrActions)["itemAdjustImageToFrame"]->setEnabled(false);
+	(*a_scrActions)["itemAttributes"]->setEnabled(false);
+	(*a_scrActions)["itemDelete"]->setEnabled(false);
+	(*a_scrActions)["itemDuplicate"]->setEnabled(false);
+	(*a_scrActions)["itemExtendedImageProperties"]->setEnabled(false);
+	(*a_scrActions)["itemLower"]->setEnabled(false);
+	(*a_scrActions)["itemLowerToBottom"]->setEnabled(false);
+	(*a_scrActions)["itemMulDuplicate"]->setEnabled(false);
+	(*a_scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
+	(*a_scrActions)["itemPDFFieldProps"]->setEnabled(false);
+	(*a_scrActions)["itemPreviewFull"]->setEnabled(false);
+	(*a_scrActions)["itemPreviewLow"]->setEnabled(false);
+	(*a_scrActions)["itemPreviewNormal"]->setEnabled(false);
+	(*a_scrActions)["itemRaise"]->setEnabled(false);
+	(*a_scrActions)["itemRaiseToTop"]->setEnabled(false);
+	(*a_scrActions)["itemSendToInline"]->setEnabled(false);
+	(*a_scrActions)["itemSendToPattern"]->setEnabled(false);
+	(*a_scrActions)["itemToggleInlineImage"]->setEnabled(false);
+	(*a_scrActions)["itemTransform"]->setEnabled(false);
+	(*a_scrActions)["itemUpdateImage"]->setEnabled(false);
+	(*a_scrActions)["pageApplyMasterPage"]->setEnabled(false);
+	(*a_scrActions)["pageCopy"]->setEnabled(false);
+	(*a_scrActions)["pageCopyToMasterPage"]->setEnabled(false);
+	(*a_scrActions)["pageDelete"]->setEnabled(false);
+	(*a_scrActions)["pageImport"]->setEnabled(false);
+	(*a_scrActions)["pageImport"]->setEnabled(false);
+	(*a_scrActions)["pageInsert"]->setEnabled(false);
+	(*a_scrActions)["pageManageGuides"]->setEnabled(false);
+	(*a_scrActions)["pageManageMargins"]->setEnabled(false);
+	(*a_scrActions)["pageMove"]->setEnabled(false);
+	(*a_scrActions)["toolsCopyProperties"]->setEnabled(false);
+	(*a_scrActions)["toolsEditContents"]->setEnabled(false);
+	(*a_scrActions)["toolsEditWithStoryEditor"]->setEnabled(false);
+	(*a_scrActions)["toolsEyeDropper"]->setEnabled(false);
+	(*a_scrActions)["toolsInsertArc"]->setEnabled(false);
+	(*a_scrActions)["toolsInsertBezier"]->setEnabled(false);
+	(*a_scrActions)["toolsInsertCalligraphicLine"]->setEnabled(false);
+	(*a_scrActions)["toolsInsertFreehandLine"]->setEnabled(false);
+	(*a_scrActions)["toolsInsertImageFrame"]->setEnabled(false);
+	(*a_scrActions)["toolsInsertLine"]->setEnabled(false);
+	(*a_scrActions)["toolsInsertPolygon"]->setEnabled(false);
+	(*a_scrActions)["toolsInsertRenderFrame"]->setEnabled(false);
+	(*a_scrActions)["toolsInsertShape"]->setEnabled(false);
+	(*a_scrActions)["toolsInsertSpiral"]->setEnabled(false);
+	(*a_scrActions)["toolsInsertTable"]->setEnabled(false);
+	(*a_scrActions)["toolsInsertTextFrame"]->setEnabled(false);
+	(*a_scrActions)["toolsLinkTextFrame"]->setEnabled(false);
+	(*a_scrActions)["toolsMeasurements"]->setEnabled(false);
+	(*a_scrActions)["toolsPDFAnnotLink"]->setEnabled(false);
+	(*a_scrActions)["toolsPDFAnnotText"]->setEnabled(false);
+	(*a_scrActions)["toolsPDFCheckBox"]->setEnabled(false);
+	(*a_scrActions)["toolsPDFComboBox"]->setEnabled(false);
+	(*a_scrActions)["toolsPDFListBox"]->setEnabled(false);
+	(*a_scrActions)["toolsPDFPushButton"]->setEnabled(false);
+	(*a_scrActions)["toolsPDFRadioButton"]->setEnabled(false);
+	(*a_scrActions)["toolsPDFTextField"]->setEnabled(false);
+	(*a_scrActions)["toolsPreflightVerifier"]->setEnabled(false);
+	(*a_scrActions)["toolsRotate"]->setEnabled(false);
+	(*a_scrActions)["toolsSelect"]->setEnabled(false);
+	(*a_scrActions)["toolsUnlinkTextFrame"]->setEnabled(false);
+	(*a_scrActions)["toolsUnlinkTextFrameWithTextCopy"]->setEnabled(false);
+	(*a_scrActions)["toolsUnlinkTextFrameWithTextCut"]->setEnabled(false);
+	(*a_scrActions)["toolsZoom"]->setEnabled(false);
+	(*a_scrActions)["viewFit100"]->setEnabled(false);
+	(*a_scrActions)["viewFit200"]->setEnabled(false);
+	(*a_scrActions)["viewFit400"]->setEnabled(false);
+	(*a_scrActions)["viewFit50"]->setEnabled(false);
+	(*a_scrActions)["viewFit75"]->setEnabled(false);
+	(*a_scrActions)["viewFitInWindow"]->setEnabled(false);
+	(*a_scrActions)["viewFitWidth"]->setEnabled(false);
+	(*a_scrActions)["viewShowRulers"]->setEnabled(false);
+	(*a_scrActions)["viewSnapToElements"]->setChecked(false);
+	(*a_scrActions)["viewSnapToGrid"]->setChecked(false);
+	(*a_scrActions)["viewSnapToGuides"]->setChecked(false);
 
 #ifdef HAVE_OSG
 	(*scrActions)["toolsPDFAnnot3D"]->setEnabled(false);
 #endif
-	(*scrActions)["itemConvertToBezierCurve"]->setEnabled(false);
-	(*scrActions)["itemConvertToImageFrame"]->setEnabled(false);
-	(*scrActions)["itemConvertToOutlines"]->setEnabled(false);
-	(*scrActions)["itemConvertToPolygon"]->setEnabled(false);
-	(*scrActions)["itemConvertToTextFrame"]->setEnabled(false);
-	(*scrActions)["itemConvertToSymbolFrame"]->setEnabled(false);
-	(*scrActions)["itemLock"]->setEnabled(false);
-	(*scrActions)["itemLockSize"]->setEnabled(false);
+	(*a_scrActions)["itemConvertToBezierCurve"]->setEnabled(false);
+	(*a_scrActions)["itemConvertToImageFrame"]->setEnabled(false);
+	(*a_scrActions)["itemConvertToOutlines"]->setEnabled(false);
+	(*a_scrActions)["itemConvertToPolygon"]->setEnabled(false);
+	(*a_scrActions)["itemConvertToTextFrame"]->setEnabled(false);
+	(*a_scrActions)["itemConvertToSymbolFrame"]->setEnabled(false);
+	(*a_scrActions)["itemLock"]->setEnabled(false);
+	(*a_scrActions)["itemLockSize"]->setEnabled(false);
 }
 
 void AppModeHelper::setPreviewMode(bool b)
 {
 	bool b2=!b;
-	(*scrActions)["viewShowMargins"]->setEnabled(b2);
-	(*scrActions)["viewShowFrames"]->setEnabled(b2);
-	(*scrActions)["viewShowLayerMarkers"]->setEnabled(b2);
-	(*scrActions)["viewShowGrid"]->setEnabled(b2);
-	(*scrActions)["viewShowGuides"]->setEnabled(b2);
-	(*scrActions)["viewShowColumnBorders"]->setEnabled(b2);
-	(*scrActions)["viewShowBaseline"]->setEnabled(b);
-	(*scrActions)["viewShowTextChain"]->setEnabled(b2);
-	(*scrActions)["viewShowTextControls"]->setEnabled(b2);
+	(*a_scrActions)["viewShowMargins"]->setEnabled(b2);
+	(*a_scrActions)["viewShowFrames"]->setEnabled(b2);
+	(*a_scrActions)["viewShowLayerMarkers"]->setEnabled(b2);
+	(*a_scrActions)["viewShowGrid"]->setEnabled(b2);
+	(*a_scrActions)["viewShowGuides"]->setEnabled(b2);
+	(*a_scrActions)["viewShowColumnBorders"]->setEnabled(b2);
+	(*a_scrActions)["viewShowBaseline"]->setEnabled(b);
+	(*a_scrActions)["viewShowTextChain"]->setEnabled(b2);
+	(*a_scrActions)["viewShowTextControls"]->setEnabled(b2);
 }
 
 void AppModeHelper::enableTextActions(bool enabled, const QString& fontName)
 {
-	(*scrActions)["insertGlyph"]->setEnabled(enabled);
-	actMgr->enableUnicodeActions(scrActions, enabled, fontName);
+	(*a_scrActions)["insertGlyph"]->setEnabled(enabled);
+	a_actMgr->enableUnicodeActions(a_scrActions, enabled, fontName);
 	if (!enabled)
 	{
-		(*scrActions)["insertMarkVariableText"]->setEnabled(false);
-		(*scrActions)["insertMarkAnchor"]->setEnabled(false);
-		(*scrActions)["insertMarkItem"]->setEnabled(false);
-		(*scrActions)["insertMark2Mark"]->setEnabled(false);
-		(*scrActions)["insertMarkNote"]->setEnabled(false);
-		(*scrActions)["editMark"]->setEnabled(false);
-	}
-}
+		(*a_scrActions)["insertMarkVariableText"]->setEnabled(false);
+		(*a_scrActions)["insertMarkAnchor"]->setEnabled(false);
+		(*a_scrActions)["insertMarkItem"]->setEnabled(false);
+		(*a_scrActions)["insertMark2Mark"]->setEnabled(false);
+		(*a_scrActions)["insertMarkNote"]->setEnabled(false);
+		(*a_scrActions)["editMark"]->setEnabled(false);
+	}
+}

Modified: trunk/Scribus/scribus/appmodehelper.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19495&path=/trunk/Scribus/scribus/appmodehelper.h
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.h (original)
+++ trunk/Scribus/scribus/appmodehelper.h Tue Sep  9 22:21:15 2014
@@ -22,11 +22,12 @@
 #include <QPointer>
 #include <QString>
 #include "actionmanager.h"
+#include "appmodes.h"
 #include "scraction.h"
 
 class AppModeHelper : public QObject
 {
-		Q_OBJECT
+	Q_OBJECT
 
 	friend class ActionManager;
 	friend class ScribusMainWindow;
@@ -34,6 +35,11 @@
 	public:
 		explicit AppModeHelper(QObject *parent = 0);
 		void setup(ActionManager* am, QMap<QString, QPointer<ScrAction> > *);
+		void resetApplicationMode(ScribusMainWindow* scmw, int newMode);
+		void setApplicationMode(ScribusMainWindow* scmw, ScribusDoc* doc, int newMode);
+		void setModeActionsPerMode(int newMode);
+		bool inAnEditMode(ScribusDoc* doc);
+		void setSpecialEditMode(bool b);
 		void setFrameEditMode(bool b);
 		void setSymbolEditMode(bool b, ScribusDoc* doc);
 		void setInlineEditMode(bool b, ScribusDoc* doc);
@@ -46,13 +52,16 @@
 		//! \brief enable or disable the unicode actions and their menus
 		void enableTextActions(bool enabled, const QString& fontName=QString::null);
 
+
 	signals:
+		void AppModeChanged(int oldMode, int newMode);
+		void UpdateRequest(int updateFlags);
 
 	public slots:
 
 	protected:
-		QMap<QString, QPointer<ScrAction> > *scrActions;
-		ActionManager* actMgr;
+		QMap<QString, QPointer<ScrAction> > *a_scrActions;
+		ActionManager* a_actMgr;
 };
 
 #endif // APPMODEHELPER_H

Modified: trunk/Scribus/scribus/canvasmode_framelinks.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19495&path=/trunk/Scribus/scribus/canvasmode_framelinks.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_framelinks.h (original)
+++ trunk/Scribus/scribus/canvasmode_framelinks.h Tue Sep  9 22:21:15 2014
@@ -65,7 +65,6 @@
 	double Mxp, Myp, Dxp, Dyp;
 	double SeRx, SeRy;
 	ScribusMainWindow* m_ScMW;
-	int    m_oldAppMode;
 };
 
 

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19495&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Tue Sep  9 22:21:15 2014
@@ -33,6 +33,7 @@
 #include <cairo.h>
 #include <cassert>
 
+#include "actionmanager.h"
 #include "appmodes.h"
 #include "canvas.h"
 #include "commonstrings.h"

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19495&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Tue Sep  9 22:21:15 2014
@@ -95,6 +95,7 @@
 
 
 #include "actionmanager.h"
+#include "appModeHelper.h"
 #include "appmodes.h"
 #include "canvasmode.h"
 #include "canvasmode_imageimport.h"
@@ -290,6 +291,7 @@
 ScribusMainWindow::ScribusMainWindow()
 {
 	actionManager=0;
+	appModeHelper=0;
 	scrMenuMgr=0;
 	prefsManager=0;
 	formatsManager=0;
@@ -355,7 +357,8 @@
 	scrLayersActions.clear();
 	scrScrapActions.clear();
 	actionManager = new ActionManager(this);
-	appModeHelper.setup(actionManager, &scrActions);
+	appModeHelper = new AppModeHelper();
+	appModeHelper->setup(actionManager, &scrActions);
 	scrMenuMgr = new ScMWMenuManager(menuBar(), actionManager);
 	prefsManager = PrefsManager::instance();
 	formatsManager = FormatsManager::instance();
@@ -476,6 +479,8 @@
 {
 	if (actionManager)
 		delete actionManager;
+	if (appModeHelper)
+		delete appModeHelper;
 	delete m_doc;
 }
 
@@ -2564,7 +2569,7 @@
 		doc->appMode = modeNormal;
 		view->requestMode(submodeEndNodeEdit);
 	} */
-	appModeHelper.mainWindowSwitchWin(doc);
+	appModeHelper->mainWindowSwitchWin(doc);
 
 	if (doc->masterPageMode() || doc->symbolEditMode() || doc->inlineEditMode())
 		pagePalette->enablePalette(false);
@@ -2579,7 +2584,7 @@
 
 void ScribusMainWindow::HaveNewDoc()
 {
-	appModeHelper.mainWindowHasNewDoc(doc, (ScMimeData::clipboardHasScribusData()) || (scrapbookPalette->tempHasContents()));
+	appModeHelper->mainWindowHasNewDoc(doc, (ScMimeData::clipboardHasScribusData()) || (scrapbookPalette->tempHasContents()));
 
 	//Update palettes
 	updateActiveWindowCaption(doc->DocName);
@@ -2686,7 +2691,7 @@
 		scrActions["itemPreviewLow"]->setChecked(false);
 	}
 	if ((SelectedType==-1) || (SelectedType!=-1 && !currItem->asTextFrame()))
-		appModeHelper.enableTextActions(false);
+		appModeHelper->enableTextActions(false);
 	scrActions["insertSampleText"]->setEnabled(false);
 
 	view->horizRuler->textMode(false);
@@ -2892,7 +2897,7 @@
 			charPalette->setEnabled(true, currItem);
 			if (currItem->asTextFrame())
 			{
-				appModeHelper.enableTextActions(true, currItem->currentStyle().charStyle().font().scName());
+				appModeHelper->enableTextActions(true, currItem->currentStyle().charStyle().font().scName());
 				currItem->asTextFrame()->togleEditModeActions();
 			}
 			view->horizRuler->setItem(currItem);
@@ -2923,7 +2928,7 @@
 		{
 			charPalette->setEnabled(true, currItem);
 			PageItem *i2 = currItem->asTable()->activeCell().textFrame();
-			appModeHelper.enableTextActions(true, i2->currentCharStyle().font().scName());
+			appModeHelper->enableTextActions(true, i2->currentCharStyle().font().scName());
 			scrActions["insertSampleText"]->setEnabled(true);
 			scrActions["toolsEditWithStoryEditor"]->setEnabled(true);
 		}
@@ -4712,7 +4717,7 @@
 	{
 		PluginManager& pluginManager(PluginManager::instance());
 		pluginManager.enableOnlyStartupPluginActions(this);
-		appModeHelper.mainWindowCloseLastDoc();
+		appModeHelper->mainWindowCloseLastDoc();
 		mainWindowStatusLabel->setText( tr("Ready"));
 		PrinterUsed = false;
 	}
@@ -4929,10 +4934,8 @@
 
 void ScribusMainWindow::slotEditCut()
 {
-//	int a;
 	if (HaveDoc && doc->appMode == modeEditClip)
 		view->requestMode(submodeEndNodeEdit);
-	QString BufferI = "";
 	uint docSelectionCount=doc->m_Selection->count();
 	if ((HaveDoc) && (docSelectionCount != 0))
 	{
@@ -5024,12 +5027,14 @@
 
 void ScribusMainWindow::slotEditCopy()
 {
-//	int a;
-	if (HaveDoc && doc->appMode == modeEditClip)
+	if (!HaveDoc)
+		return;
+	if (doc->appMode == modeEditClip)
 		view->requestMode(submodeEndNodeEdit);
-	QString BufferI = "";
-	if ((HaveDoc) && (!doc->m_Selection->isEmpty()))
-	{
+
+	if (!doc->m_Selection->isEmpty())
+	{
+//		QString BufferI = "";
 		PageItem *currItem = doc->m_Selection->itemAt(0);
 		if (((doc->appMode == modeEdit) || (doc->appMode == modeEditTable)) && (currItem->isTextFrame() || currItem->isTable()))
 		{
@@ -5043,7 +5048,7 @@
 				StoryText itemText(doc);
 				itemText.setDefaultStyle(cItem->itemText.defaultStyle());
 				itemText.insert(0, cItem->itemText, true);
-				BufferI = itemText.text(0, itemText.length());
+//				BufferI = itemText.text(0, itemText.length());
 				std::ostringstream xmlString;
 				SaxXML xmlStream(xmlString);
 				xmlStream.beginDoc();
@@ -5464,20 +5469,10 @@
 
 void ScribusMainWindow::deselectAll()
 {
-	bool inEditMode=false;
-
-	if (doc->appMode == modeEdit ||
-		doc->appMode == modeEditTable ||
-		doc->appMode == modeEditSpiral ||
-		doc->appMode == modeEditGradientVectors ||
-		doc->appMode == modeEditClip ||
-		doc->appMode == modeEditMeshGradient ||
-		doc->appMode == modeEditArc ||
-		doc->appMode == modeEditMeshPatch ||
-		doc->appMode == modeEditWeldPoint
-		)
-		inEditMode=true;
-
+	if (!HaveDoc)
+		return;
+
+	bool inEditMode=appModeHelper->inAnEditMode(doc);
 	if (inEditMode)
 	{
 		if (doc->m_Selection->isEmpty())
@@ -6244,7 +6239,7 @@
 	connect(view, SIGNAL(HavePoint(bool, bool)), nodePalette, SLOT(HaveNode(bool, bool)));
 	connect(view, SIGNAL(PolyStatus(int, uint)), nodePalette, SLOT(PolyStatus(int, uint)));
 	doc->nodeEdit.reset();
-	appModeHelper.setFrameEditMode(true);
+	appModeHelper->setFrameEditMode(true);
 	layerPalette->setEnabled(false);
 	outlinePalette->setEnabled(false);
 	guidePalette->setEnabled(false);
@@ -6296,7 +6291,7 @@
 	actionManager->disconnectModeActions();
 	nodePalette->setDoc(0,0);
 	nodePalette->hide();
-	appModeHelper.setFrameEditMode(false);
+	appModeHelper->setFrameEditMode(false);
 	scrActions["toolsSelect"]->setChecked(true);
 	scrActions["toolsEditContents"]->setChecked(false);
 	scrActions["toolsEditWithStoryEditor"]->setChecked(false);
@@ -6333,7 +6328,7 @@
 	if (doc)
 		view->requestMode(modeNormal);
 	else
-		setAppMode(modeNormal);
+		appModeHelper->resetApplicationMode(this, modeNormal);
 }
 
 void ScribusMainWindow::setAppModeByToggle(bool isOn, int newMode)
@@ -6352,352 +6347,325 @@
 		slotSelect();
 }
 
+/*
 void ScribusMainWindow::setAppMode(int mode)
 {
+
 	assert(mode < submodeFirstSubmode);
-
-	//disconnect the tools actions so we dont fire them off
+	//If no doc and we end here, just reset the tool actions
+	if (!HaveDoc)
+	{	actionManager->disconnectModeActions();
+		appModeHelper->setModeActionsPerMode(mode);
+		actionManager->connectModeActions();
+		return;
+	}
+
 	actionManager->disconnectModeActions();
-	//set the actions state based on incoming mode
-	scrActions["toolsSelect"]->setChecked(mode==modeNormal);
-	scrActions["toolsInsertTextFrame"]->setChecked(mode==modeDrawText);
-	scrActions["toolsInsertImageFrame"]->setChecked(mode==modeDrawImage);
-	scrActions["toolsInsertTable"]->setChecked(mode==modeDrawTable2);
-	scrActions["toolsInsertShape"]->setChecked(mode==modeDrawShapes);
-	scrActions["toolsInsertPolygon"]->setChecked(mode==modeDrawRegularPolygon);
-	scrActions["toolsInsertArc"]->setChecked(mode==modeDrawArc);
-	scrActions["toolsInsertSpiral"]->setChecked(mode==modeDrawSpiral);
-	scrActions["toolsInsertLine"]->setChecked(mode==modeDrawLine);
-	scrActions["toolsInsertBezier"]->setChecked(mode==modeDrawBezierLine);
-	scrActions["toolsInsertFreehandLine"]->setChecked(mode==modeDrawFreehandLine);
-	scrActions["toolsInsertCalligraphicLine"]->setChecked(mode == modeDrawCalligraphicLine);
-	scrActions["toolsInsertRenderFrame"]->setChecked(mode==modeDrawLatex);
-	scrActions["toolsRotate"]->setChecked(mode==modeRotation);
-	scrActions["toolsZoom"]->setChecked(mode==modeMagnifier);
-	scrActions["toolsEditContents"]->setChecked(mode==modeEdit);
-	scrActions["toolsEditWithStoryEditor"]->setChecked(mode==modeStoryEditor);
-	scrActions["toolsLinkTextFrame"]->setChecked(mode==modeLinkFrames);
-	scrActions["toolsUnlinkTextFrame"]->setChecked(mode==modeUnlinkFrames);
-//	scrActions["toolsUnlinkTextFrameWithTextCopy"]->setChecked(mode==modeUnlinkFrames);
-//	scrActions["toolsUnlinkTextFrameWithTextCut"]->setChecked(mode==modeUnlinkFrames);
-	scrActions["toolsEyeDropper"]->setChecked(mode==modeEyeDropper);
-	scrActions["toolsMeasurements"]->setChecked(mode==modeMeasurementTool);
-	scrActions["toolsCopyProperties"]->setChecked(mode==modeCopyProperties);
-	scrActions["toolsPDFPushButton"]->setChecked(mode==modeInsertPDFButton);
-	scrActions["toolsPDFRadioButton"]->setChecked(mode==modeInsertPDFRadioButton);
-	scrActions["toolsPDFTextField"]->setChecked(mode==modeInsertPDFTextfield);
-	scrActions["toolsPDFCheckBox"]->setChecked(mode==modeInsertPDFCheckbox);
-	scrActions["toolsPDFComboBox"]->setChecked(mode==modeInsertPDFCombobox);
-	scrActions["toolsPDFListBox"]->setChecked(mode==modeInsertPDFListbox);
-	scrActions["toolsPDFAnnotText"]->setChecked(mode==modeInsertPDFTextAnnotation);
-	scrActions["toolsPDFAnnotLink"]->setChecked(mode==modeInsertPDFLinkAnnotation);
-#ifdef HAVE_OSG
-	scrActions["toolsPDFAnnot3D"]->setChecked(mode==modeInsertPDF3DAnnotation);
-#endif
-
-	if (HaveDoc)
-	{
-		PageItem *currItem=0;
-		if (!doc->m_Selection->isEmpty())
-			currItem = doc->m_Selection->itemAt(0);
-		int oldMode = doc->appMode;
-		if (oldMode == modeEditClip && mode != modeEditClip)
-			NoFrameEdit();
-		else if (oldMode != modeEditClip && mode == modeEditClip)
-			ToggleFrameEdit();
-
-		//Ugly hack but I have absolutly no idea about how to do this in another way
-		if(UndoManager::undoEnabled() && currItem && oldMode != mode && (mode == modeEditMeshPatch || mode == modeEditMeshGradient || mode == modeEditGradientVectors || oldMode == modeEditMeshPatch || oldMode == modeEditMeshGradient || oldMode == modeEditGradientVectors || oldMode == modeEditPolygon || mode == modeEditPolygon || oldMode == modeEditArc || mode == modeEditArc || oldMode == modeEditSpiral || mode == modeEditSpiral))
-		{
-			SimpleState *ss = new SimpleState(Um::Mode);
-			ss->set("CHANGE_MODE","change_mode");
-			ss->set("OLD",oldMode);
-			ss->set("NEW",mode);
-			undoManager->action(currItem,ss);
-		}
-		doc->appMode = mode;
+	appModeHelper->setModeActionsPerMode(mode);
+
+
+	PageItem *currItem=0;
+	if (!doc->m_Selection->isEmpty())
+		currItem = doc->m_Selection->itemAt(0);
+	int oldMode = doc->appMode;
+	if (oldMode == modeEditClip && mode != modeEditClip)
+		NoFrameEdit();
+	else if (oldMode != modeEditClip && mode == modeEditClip)
+		ToggleFrameEdit();
+
+	//Ugly hack but I have absolutly no idea about how to do this in another way
+	if(UndoManager::undoEnabled() && currItem && oldMode != mode && (mode == modeEditMeshPatch || mode == modeEditMeshGradient || mode == modeEditGradientVectors || oldMode == modeEditMeshPatch || oldMode == modeEditMeshGradient || oldMode == modeEditGradientVectors || oldMode == modeEditPolygon || mode == modeEditPolygon || oldMode == modeEditArc || mode == modeEditArc || oldMode == modeEditSpiral || mode == modeEditSpiral))
+	{
+		SimpleState *ss = new SimpleState(Um::Mode);
+		ss->set("CHANGE_MODE","change_mode");
+		ss->set("OLD",oldMode);
+		ss->set("NEW",mode);
+		undoManager->action(currItem,ss);
+	}
+	doc->appMode = mode;
 //		if (oldMode == modeMeasurementTool)
 //			disconnect(view, SIGNAL(MVals(double, double, double, double, double, double, int )), measurementPalette, SLOT(setValues(double, double, double, double, double, double, int )));
-/*		if (mode != modeEdit && doc->CurTimer!=NULL)
-		{
-			disconnect(doc->CurTimer, SIGNAL(timeout()), view, SLOT(blinkCursor()));
-			doc->CurTimer->stop();
-			delete doc->CurTimer;
-			doc->CurTimer = NULL;
-		} */
-
-		// Restore/save action shortcuts when entering/leaving edit mode.
-		if (mode!=modeEdit && oldMode==modeEdit)
-			actionManager->restoreActionShortcutsPostEditMode();
-		else
-		if (mode==modeEdit && oldMode!=modeEdit)
-			actionManager->saveActionShortcutsPreEditMode();
-
-		// Restore/save action shortcuts when entering/leaving table edit mode.
-		if (mode != modeEditTable && oldMode == modeEditTable)
-		{
-			outlinePalette->setEnabled(true);
-			charPalette->setEnabled(false, 0);
-			appModeHelper.enableTextActions(false);
-			scrActions["insertSampleText"]->setEnabled(false);
-			scrActions["toolsEditWithStoryEditor"]->setEnabled(false);
-			actionManager->restoreActionShortcutsPostEditMode();
-		}
-		else if (mode == modeEditTable && oldMode != modeEditTable)
-		{
-			outlinePalette->setEnabled(false);
-			charPalette->setEnabled(true, currItem);
-			scrActions["insertSampleText"]->setEnabled(true);
-			scrActions["toolsEditWithStoryEditor"]->setEnabled(true);
-			PageItem *i2 = currItem->asTable()->activeCell().textFrame();
-			appModeHelper.enableTextActions(true, i2->currentCharStyle().font().scName());
-			actionManager->saveActionShortcutsPreEditMode();
-		}
-		if (oldMode == modeEdit)
-		{
-			zoomSpinBox->setFocusPolicy(Qt::ClickFocus);
-			pageSelector->setFocusPolicy(Qt::ClickFocus);
-			scrActions["editClearContents"]->setEnabled(false);
-			scrActions["editTruncateContents"]->setEnabled(false);
-			charPalette->setEnabled(false, 0);
+//		if (mode != modeEdit && doc->CurTimer!=NULL)
+//	{
+//		disconnect(doc->CurTimer, SIGNAL(timeout()), view, SLOT(blinkCursor()));
+//		doc->CurTimer->stop();
+//		delete doc->CurTimer;
+//		doc->CurTimer = NULL;
+//	}
+
+	// Restore/save action shortcuts when entering/leaving edit mode.
+	if (mode!=modeEdit && oldMode==modeEdit)
+		actionManager->restoreActionShortcutsPostEditMode();
+	else
+	if (mode==modeEdit && oldMode!=modeEdit)
+		actionManager->saveActionShortcutsPreEditMode();
+
+	// Restore/save action shortcuts when entering/leaving table edit mode.
+	if (mode != modeEditTable && oldMode == modeEditTable)
+	{
+		outlinePalette->setEnabled(true);
+		charPalette->setEnabled(false, 0);
+		appModeHelper->enableTextActions(false);
+		scrActions["insertSampleText"]->setEnabled(false);
+		scrActions["toolsEditWithStoryEditor"]->setEnabled(false);
+		actionManager->restoreActionShortcutsPostEditMode();
+	}
+	else if (mode == modeEditTable && oldMode != modeEditTable)
+	{
+		outlinePalette->setEnabled(false);
+		charPalette->setEnabled(true, currItem);
+		scrActions["insertSampleText"]->setEnabled(true);
+		scrActions["toolsEditWithStoryEditor"]->setEnabled(true);
+		PageItem *i2 = currItem->asTable()->activeCell().textFrame();
+		appModeHelper->enableTextActions(true, i2->currentCharStyle().font().scName());
+		actionManager->saveActionShortcutsPreEditMode();
+	}
+	if (oldMode == modeEdit)
+	{
+		zoomSpinBox->setFocusPolicy(Qt::ClickFocus);
+		pageSelector->setFocusPolicy(Qt::ClickFocus);
+		scrActions["editClearContents"]->setEnabled(false);
+		scrActions["editTruncateContents"]->setEnabled(false);
+		charPalette->setEnabled(false, 0);
 //			view->slotDoCurs(false);
-			if (currItem != 0)
-			{
-				currItem->update();
-				if (currItem->asTextFrame())
-					appModeHelper.enableTextActions(false);
-				//		scrMenuMgr->setMenuEnabled("Item", true);
-				scrActions["itemDuplicate"]->setEnabled(true);
-				scrActions["itemMulDuplicate"]->setEnabled(true);
-				scrActions["itemTransform"]->setEnabled(true);
-				scrActions["itemDelete"]->setEnabled(true);
-				scrActions["itemRaise"]->setEnabled(true);
-				scrActions["itemLower"]->setEnabled(true);
-				scrActions["itemRaiseToTop"]->setEnabled(true);
-				scrActions["itemLowerToBottom"]->setEnabled(true);
+		if (currItem != 0)
+		{
+			currItem->update();
+			if (currItem->asTextFrame())
+				appModeHelper->enableTextActions(false);
+			//		scrMenuMgr->setMenuEnabled("Item", true);
+			scrActions["itemDuplicate"]->setEnabled(true);
+			scrActions["itemMulDuplicate"]->setEnabled(true);
+			scrActions["itemTransform"]->setEnabled(true);
+			scrActions["itemDelete"]->setEnabled(true);
+			scrActions["itemRaise"]->setEnabled(true);
+			scrActions["itemLower"]->setEnabled(true);
+			scrActions["itemRaiseToTop"]->setEnabled(true);
+			scrActions["itemLowerToBottom"]->setEnabled(true);
 //				scrActions["itemSendToScrapbook"]->setEnabled(true);
-				scrMenuMgr->setMenuEnabled("itemSendToScrapbook", true);
-				scrActions["itemSendToPattern"]->setEnabled(true);
-				scrActions["itemSendToInline"]->setEnabled(true);
-				scrActions["itemAdjustFrameToImage"]->setEnabled(true);
-				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["itemAttributes"]->setEnabled(true);
-			}
-			view->horizRuler->textMode(false);
-			view->horizRuler->update();
-		}
-		if (mode == modeEdit)
-		{
+			scrMenuMgr->setMenuEnabled("itemSendToScrapbook", true);
+			scrActions["itemSendToPattern"]->setEnabled(true);
+			scrActions["itemSendToInline"]->setEnabled(true);
+			scrActions["itemAdjustFrameToImage"]->setEnabled(true);
+			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["itemAttributes"]->setEnabled(true);
+		}
+		view->horizRuler->textMode(false);
+		view->horizRuler->update();
+	}
+	if (mode == modeEdit)
+	{
 //			view->zoomSpinBox->setFocusPolicy(QWidget::NoFocus);
 // 			view->pageSelector->setFocusPolicy(QWidget::NoFocus);
-			if (currItem != 0)
-			{
+		if (currItem != 0)
+		{
 //				if ((currItem->itemType() == PageItem::Polygon) || (currItem->itemType() == PageItem::PolyLine) || (currItem->itemType() == PageItem::PathText))
 //				{
 //					doc->appMode = modeNormal;
 //					view->requestMode(modeEditClip);
 //					return;
 //				}
-				//setTBvals before placing cursor has no effect
-				currItem->itemText.setCursorPosition(0);
-				setTBvals(currItem);
-			}
-			scrActions["editPaste"]->setEnabled(false);
-			charPalette->setEnabled(true, currItem);
-			if (currItem!=NULL && currItem->asTextFrame())
-			{
-				appModeHelper.enableTextActions(true, currItem->currentCharStyle().font().scName());
-				currItem->asTextFrame()->togleEditModeActions();
-			}
-			if (ScMimeData::clipboardHasScribusData())
-			{
-				bool textFrameEditMode = ((currItem != NULL) && (currItem->asTextFrame()));
-				scrActions["editPaste"]->setEnabled( textFrameEditMode || (currItem == NULL) );
-			}
+			//setTBvals before placing cursor has no effect
+			currItem->itemText.setCursorPosition(0);
+			setTBvals(currItem);
+		}
+		scrActions["editPaste"]->setEnabled(false);
+		charPalette->setEnabled(true, currItem);
+		if (currItem!=NULL && currItem->asTextFrame())
+		{
+			appModeHelper->enableTextActions(true, currItem->currentCharStyle().font().scName());
+			currItem->asTextFrame()->togleEditModeActions();
+		}
+		if (ScMimeData::clipboardHasScribusData())
+		{
+			bool textFrameEditMode = ((currItem != NULL) && (currItem->asTextFrame()));
+			scrActions["editPaste"]->setEnabled( textFrameEditMode || (currItem == NULL) );
+		}
 //			view->slotDoCurs(true);
-			//		scrMenuMgr->setMenuEnabled("Item", false);
-			scrActions["itemDuplicate"]->setEnabled(false);
-			scrActions["itemMulDuplicate"]->setEnabled(false);
-			scrActions["itemTransform"]->setEnabled(false);
-			scrActions["itemDelete"]->setEnabled(false);
-			scrActions["itemRaise"]->setEnabled(false);
-			scrActions["itemLower"]->setEnabled(false);
-			scrActions["itemRaiseToTop"]->setEnabled(false);
-			scrActions["itemLowerToBottom"]->setEnabled(false);
+		//		scrMenuMgr->setMenuEnabled("Item", false);
+		scrActions["itemDuplicate"]->setEnabled(false);
+		scrActions["itemMulDuplicate"]->setEnabled(false);
+		scrActions["itemTransform"]->setEnabled(false);
+		scrActions["itemDelete"]->setEnabled(false);
+		scrActions["itemRaise"]->setEnabled(false);
+		scrActions["itemLower"]->setEnabled(false);
+		scrActions["itemRaiseToTop"]->setEnabled(false);
+		scrActions["itemLowerToBottom"]->setEnabled(false);
 //			scrActions["itemSendToScrapbook"]->setEnabled(false);
-			scrMenuMgr->setMenuEnabled("itemSendToScrapbook", false);
-			scrActions["itemSendToPattern"]->setEnabled(false);
-			scrActions["itemSendToInline"]->setEnabled(false);
-			scrActions["itemAdjustFrameToImage"]->setEnabled(false);
-			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["itemAttributes"]->setEnabled(false);
-/*			doc->CurTimer = new QTimer(view);
-			if (doc->CurTimer!=NULL)
-			{
-				connect(doc->CurTimer, SIGNAL(timeout()), view, SLOT(blinkCursor()));
-				doc->CurTimer->start(500);
-			} */
-			if (currItem != 0)
-			{
-				scrActions["editCut"]->setEnabled(currItem->HasSel);
-				scrActions["editCopy"]->setEnabled(currItem->HasSel);
-				scrActions["editClearContents"]->setEnabled(currItem->HasSel);
-				scrActions["editTruncateContents"]->setEnabled(currItem->HasSel);
-				scrActions["editSearchReplace"]->setEnabled(true);
-
-				// Why the hell do you want to update the item here? - pm
+		scrMenuMgr->setMenuEnabled("itemSendToScrapbook", false);
+		scrActions["itemSendToPattern"]->setEnabled(false);
+		scrActions["itemSendToInline"]->setEnabled(false);
+		scrActions["itemAdjustFrameToImage"]->setEnabled(false);
+		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["itemAttributes"]->setEnabled(false);
+//			doc->CurTimer = new QTimer(view);
+//		if (doc->CurTimer!=NULL)
+//		{
+//			connect(doc->CurTimer, SIGNAL(timeout()), view, SLOT(blinkCursor()));
+//			doc->CurTimer->start(500);
+//		}
+		if (currItem != 0)
+		{
+			scrActions["editCut"]->setEnabled(currItem->HasSel);
+			scrActions["editCopy"]->setEnabled(currItem->HasSel);
+			scrActions["editClearContents"]->setEnabled(currItem->HasSel);
+			scrActions["editTruncateContents"]->setEnabled(currItem->HasSel);
+			scrActions["editSearchReplace"]->setEnabled(true);
+
+			// Why the hell do you want to update the item here? - pm
 // 				currItem->update();
-			}
-		}
-		//disable text action which work only text frame in edit mode
-		if ((mode != modeEdit) || (!currItem) || !currItem->isTextFrame())
-			appModeHelper.enableTextActions(false);
-		int docSelectionCount = doc->m_Selection->count();
-		if (mode == modeDrawBezierLine)
-		{
-			if ((docSelectionCount != 0) && (!prefsManager->appPrefs.uiPrefs.stickyTools))
-				view->Deselect(true);
-			view->FirstPoly = true;
-		}
-		if (mode == modeEditGradientVectors)
-			propertiesPalette->setGradientEditMode(true);
+		}
+	}
+	//disable text action which work only text frame in edit mode
+	if ((mode != modeEdit) || (!currItem) || !currItem->isTextFrame())
+		appModeHelper->enableTextActions(false);
+	int docSelectionCount = doc->m_Selection->count();
+	if (mode == modeDrawBezierLine)
+	{
+		if ((docSelectionCount != 0) && (!prefsManager->appPrefs.uiPrefs.stickyTools))
+			view->Deselect(true);
+		view->FirstPoly = true;
+	}
+	if (mode == modeEditGradientVectors)
+		propertiesPalette->setGradientEditMode(true);
 //		if (mode == modeMeasurementTool)
 //		{
 //			measurementPalette->show();
 //			connect(view, SIGNAL(MVals(double, double, double, double, double, double, int)), measurementPalette, SLOT(setValues(double, double, double, double, double, double, int )));
 //		}
-		switch (mode)
-		{
-			case modeDrawShapes:
-			case modeDrawArc:
-			case modeDrawSpiral:
-				if (docSelectionCount!=0)
-					view->Deselect(true);
-				view->setCursor(QCursor(loadIcon("DrawFrame.xpm")));
-				break;
-			case modeDrawImage:
-				if (docSelectionCount!=0)
-					view->Deselect(true);
-				view->setCursor(QCursor(loadIcon("DrawImageFrame.xpm")));
-				break;
-			case modeDrawLatex:
-				if (docSelectionCount!=0)
-					view->Deselect(true);
-				view->setCursor(QCursor(loadIcon("DrawLatexFrame.xpm")));
-				break;
-			case modeDrawText:
-				if (docSelectionCount!=0)
-					view->Deselect(true);
-				view->setCursor(QCursor(loadIcon("DrawTextFrame.xpm")));
-				break;
-			case modeDrawTable2:
-				if (docSelectionCount!=0)
-					view->Deselect(true);
-				view->setCursor(QCursor(loadIcon("DrawTable.xpm")));
-				break;
-			case modeDrawRegularPolygon:
-				if (docSelectionCount!=0)
-					view->Deselect(true);
-				view->setCursor(QCursor(loadIcon("DrawPolylineFrame.xpm")));
-				break;
-			case modeMagnifier:
-				if (docSelectionCount!=0)
-					view->Deselect(true);
-				view->Magnify = true;
-				view->setCursor(QCursor(loadIcon("LupeZ.xpm")));
-				break;
-			case modePanning:
-				view->setCursor(QCursor(loadIcon("HandC.xpm")));
-				break;
-			case modeDrawLine:
-			case modeDrawBezierLine:
-				view->setCursor(QCursor(Qt::CrossCursor));
-				break;
-			case modeDrawCalligraphicLine:
-			case modeDrawFreehandLine:
-				view->setCursor(QCursor(loadIcon("DrawFreeLine.png"), 0, 32));
-				break;
-			case modeEyeDropper:
-				view->setCursor(QCursor(loadIcon("colorpickercursor.png"), 0, 32));
-				break;
-			case modeInsertPDFButton:
-			case modeInsertPDFRadioButton:
-			case modeInsertPDFTextfield:
-			case modeInsertPDFCheckbox:
-			case modeInsertPDFCombobox:
-			case modeInsertPDFListbox:
-			case modeInsertPDFTextAnnotation:
-			case modeInsertPDFLinkAnnotation:
-			case modeInsertPDF3DAnnotation:
-				if (docSelectionCount!=0)
-					view->Deselect(true);
-				view->setCursor(QCursor(Qt::CrossCursor));
-				break;
-			case modeMeasurementTool:
-			case modeEditGradientVectors:
-			case modeEditMeshGradient:
-			case modeEditArc:
-			case modeEditPolygon:
-			case modeEditSpiral:
-				view->setCursor(QCursor(Qt::CrossCursor));
-				outlinePalette->setEnabled(false);
-				break;
-			default:
-				view->setCursor(QCursor(Qt::ArrowCursor));
+	switch (mode)
+	{
+		case modeDrawShapes:
+		case modeDrawArc:
+		case modeDrawSpiral:
+			if (docSelectionCount!=0)
+				view->Deselect(true);
+			view->setCursor(QCursor(loadIcon("DrawFrame.xpm")));
 			break;
-		}
-		if (mode == modeDrawShapes)
-		{
-			doc->SubMode = modeToolBar->SubMode;
-			doc->ShapeValues = modeToolBar->ShapeVals;
-			doc->ValCount = modeToolBar->ValCount;
-			emit UpdateRequest(reqCustomShapeUpdate);
-		}
-		else
-			doc->SubMode = -1;
-		if (mode == modeNormal)
-		{
-			propertiesPalette->setGradientEditMode(false);
-			outlinePalette->setEnabled(true);
-		}
-		if (mode == modeLinkFrames)
+		case modeDrawImage:
+			if (docSelectionCount!=0)
+				view->Deselect(true);
+			view->setCursor(QCursor(loadIcon("DrawImageFrame.xpm")));
+			break;
+		case modeDrawLatex:
+			if (docSelectionCount!=0)
+				view->Deselect(true);
+			view->setCursor(QCursor(loadIcon("DrawLatexFrame.xpm")));
+			break;
+		case modeDrawText:
+			if (docSelectionCount!=0)
+				view->Deselect(true);
+			view->setCursor(QCursor(loadIcon("DrawTextFrame.xpm")));
+			break;
+		case modeDrawTable2:
+			if (docSelectionCount!=0)
+				view->Deselect(true);
+			view->setCursor(QCursor(loadIcon("DrawTable.xpm")));
+			break;
+		case modeDrawRegularPolygon:
+			if (docSelectionCount!=0)
+				view->Deselect(true);
+			view->setCursor(QCursor(loadIcon("DrawPolylineFrame.xpm")));
+			break;
+		case modeMagnifier:
+			if (docSelectionCount!=0)
+				view->Deselect(true);
+			view->Magnify = true;
+			view->setCursor(QCursor(loadIcon("LupeZ.xpm")));
+			break;
+		case modePanning:
+			view->setCursor(QCursor(loadIcon("HandC.xpm")));
+			break;
+		case modeDrawLine:
+		case modeDrawBezierLine:
+			view->setCursor(QCursor(Qt::CrossCursor));
+			break;
+		case modeDrawCalligraphicLine:
+		case modeDrawFreehandLine:
+			view->setCursor(QCursor(loadIcon("DrawFreeLine.png"), 0, 32));
+			break;
+		case modeEyeDropper:
+			view->setCursor(QCursor(loadIcon("colorpickercursor.png"), 0, 32));
+			break;
+		case modeInsertPDFButton:
+		case modeInsertPDFRadioButton:
+		case modeInsertPDFTextfield:
+		case modeInsertPDFCheckbox:
+		case modeInsertPDFCombobox:
+		case modeInsertPDFListbox:
+		case modeInsertPDFTextAnnotation:
+		case modeInsertPDFLinkAnnotation:
+		case modeInsertPDF3DAnnotation:
+			if (docSelectionCount!=0)
+				view->Deselect(true);
+			view->setCursor(QCursor(Qt::CrossCursor));
+			break;
+		case modeMeasurementTool:
+		case modeEditGradientVectors:
+		case modeEditMeshGradient:
+		case modeEditArc:
+		case modeEditPolygon:
+		case modeEditSpiral:
+			view->setCursor(QCursor(Qt::CrossCursor));
+			outlinePalette->setEnabled(false);
+			break;
+		default:
+			view->setCursor(QCursor(Qt::ArrowCursor));
+		break;
+	}
+	if (mode == modeDrawShapes)
+	{
+		doc->SubMode = modeToolBar->SubMode;
+		doc->ShapeValues = modeToolBar->ShapeVals;
+		doc->ValCount = modeToolBar->ValCount;
+		emit UpdateRequest(reqCustomShapeUpdate);
+	}
+	else
+		doc->SubMode = -1;
+	if (mode == modeNormal)
+	{
+		propertiesPalette->setGradientEditMode(false);
+		outlinePalette->setEnabled(true);
+	}
+	if (mode == modeLinkFrames)
+		doc->ElemToLink = doc->m_Selection->itemAt(0);
+	if ((mode == modeLinkFrames) || (mode == modeUnlinkFrames) || (oldMode == modeLinkFrames) || (oldMode == modeUnlinkFrames))
+		doc->regionsChanged()->update(QRect());
+
+	if (mode == modeStoryEditor)
+	{
+		slotStoryEditor(oldMode == modeEditTable);
+		slotSelect();
+	}
+	if (mode == modeCopyProperties)
+	{
+		if (!doc->m_Selection->isEmpty())
+		{
 			doc->ElemToLink = doc->m_Selection->itemAt(0);
-		if ((mode == modeLinkFrames) || (mode == modeUnlinkFrames) || (oldMode == modeLinkFrames) || (oldMode == modeUnlinkFrames))
-			doc->regionsChanged()->update(QRect());
-
-		if (mode == modeStoryEditor)
-		{
-			slotStoryEditor(oldMode == modeEditTable);
-			slotSelect();
-		}
-		if (mode == modeCopyProperties)
-		{
-			if (!doc->m_Selection->isEmpty())
-			{
-				doc->ElemToLink = doc->m_Selection->itemAt(0);
-				view->Deselect(true);
-				scrActions["toolsCopyProperties"]->setEnabled(true);
-			}
-		}
-		if (mode != modeNormal && mode != modeStoryEditor)
-			activateWindow();
-		PluginManager& pluginManager(PluginManager::instance());
-		pluginManager.enablePluginActionsForSelection(this);
-
-		emit AppModeChanged(oldMode, mode);
-	}
+			view->Deselect(true);
+			scrActions["toolsCopyProperties"]->setEnabled(true);
+		}
+	}
+	if (mode != modeNormal && mode != modeStoryEditor)
+		activateWindow();
+	PluginManager& pluginManager(PluginManager::instance());
+	pluginManager.enablePluginActionsForSelection(this);
+
+	//emit AppModeChanged(oldMode, mode);
+
 	actionManager->connectModeActions();
 }
+*/
 
 void ScribusMainWindow::setMainWindowActive()
 {
@@ -8134,7 +8102,7 @@
 		doc->stored_minCanvasCoordinate = doc->minCanvasCoordinate;
 		doc->stored_maxCanvasCoordinate = doc->maxCanvasCoordinate;
 		view->showSymbolPage(temp);
-		appModeHelper.setSymbolEditMode(true, doc);
+		appModeHelper->setSymbolEditMode(true, doc);
 		pagePalette->enablePalette(false);
 		layerPalette->setEnabled(false);
 		patternsDependingOnThis.clear();
@@ -8171,7 +8139,7 @@
 		doc->restartAutoSaveTimer();
 	}
 	slotSelect();
-	appModeHelper.setSymbolEditMode(false, doc);
+	appModeHelper->setSymbolEditMode(false, doc);
 	scrActions["fileClose"]->setToolTip( tr("Close"));
 	scrActions["fileClose"]->setIcon(loadIcon("22/close.png"));
 	scrMenuMgr->setMenuEnabled("FileOpenRecent", true);
@@ -8216,7 +8184,7 @@
 		doc->stored_minCanvasCoordinate = doc->minCanvasCoordinate;
 		doc->stored_maxCanvasCoordinate = doc->maxCanvasCoordinate;
 		view->showInlinePage(id);
-		appModeHelper.setInlineEditMode(true, doc);
+		appModeHelper->setInlineEditMode(true, doc);
 		pagePalette->enablePalette(false);
 		layerPalette->setEnabled(false);
 		inlinePalette->editingStart(id);
@@ -8238,7 +8206,7 @@
 		doc->restartAutoSaveTimer();
 	}
 	slotSelect();
-	appModeHelper.setInlineEditMode(false, doc);
+	appModeHelper->setInlineEditMode(false, doc);
 	scrActions["fileClose"]->setToolTip( tr("Close"));
 	scrActions["fileClose"]->setIcon(loadIcon("22/close.png"));
 	scrMenuMgr->setMenuEnabled("FileOpenRecent", true);
@@ -8298,7 +8266,7 @@
 		pagePalette->show();
 		scrActions["toolsPages"]->setChecked(true);
 	}
-	appModeHelper.setMasterPageEditMode(true, doc);
+	appModeHelper->setMasterPageEditMode(true, doc);
 }
 
 void ScribusMainWindow::editMasterPagesEnd()
@@ -8313,7 +8281,7 @@
 		doc->restartAutoSaveTimer();
 	}
 	slotSelect();
-	appModeHelper.setMasterPageEditMode(false, doc);
+	appModeHelper->setMasterPageEditMode(false, doc);
 	scrActions["fileClose"]->setToolTip( tr("Close"));
 	scrActions["fileClose"]->setIcon(loadIcon("22/close.png"));
 	scrMenuMgr->setMenuEnabled("FileOpenRecent", true);
@@ -8805,7 +8773,7 @@
 	scrMenuMgr->setMenuEnabled("EditPasteRecent", ((scrapbookPalette->tempBView->objectMap.count() > 0) && (setter)));
 	scrMenuMgr->setMenuEnabled("Insert", setter);
 	scrMenuMgr->setMenuEnabled("ItemLayer", doc->layerCount() > 1);
-	appModeHelper.changeLayer(doc, (ScMimeData::clipboardHasScribusData() || (scrapbookPalette->tempHasContents())));
+	appModeHelper->changeLayer(doc, (ScMimeData::clipboardHasScribusData() || (scrapbookPalette->tempHasContents())));
 }
 
 void ScribusMainWindow::setLayerMenuText(const QString &layerName)

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19495&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Tue Sep  9 22:21:15 2014
@@ -59,10 +59,10 @@
 #include "scribusdoc.h"
 #include "styleoptions.h"
 #include "ui/customfdialog.h"
-#include "appmodehelper.h"
 
 class ActionManager;
 class AlignDistributePalette;
+class AppModeHelper;
 class Autoforms;
 class Biblio;
 class BookPalette;
@@ -255,7 +255,7 @@
 	ScribusWin* ActWin;
 	QClipboard *ClipB;
 	QString LoadEnc;
-	AppModeHelper appModeHelper;
+	AppModeHelper *appModeHelper;
 
 	QProcess *ExternalApp;
 
@@ -452,7 +452,7 @@
 	void slotSelect();
 	/** \brief Switch appMode
 	\param mode TODO learn modes*/
-	void setAppMode(int mode);
+	//void setAppMode(int mode);
 	void setAppModeByToggle(bool isOn, int newMode);
 	/** \brief Neues Dokument erzeugt */
 	void HaveNewDoc();
@@ -575,9 +575,11 @@
 	void testQT_slot4();
 	//void adjustCMS();
 	void changePreviewQuality(int index);
+	void ToggleFrameEdit();
+	void NoFrameEdit();
 
 signals:
-	void AppModeChanged(int oldMode, int newMode);
+	//void AppModeChanged(int oldMode, int newMode);
 	void TextStyle(const ParagraphStyle&);
 //deprecated: (av)
 	void TextEffects(int);
@@ -608,8 +610,7 @@
 	void initScrapbook();
 
 	void updateColorMenu(QProgressBar* progressBar=NULL);
-	void ToggleFrameEdit();
-	void NoFrameEdit();
+
 
 	int ScriptRunning;
 

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19495&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Tue Sep  9 22:21:15 2014
@@ -40,6 +40,7 @@
 #include <QTime>
 //#include <qtconcurrentmap.h>
 
+#include "actionmanager.h"
 #include "appmodes.h"
 #include "canvas.h"
 #include "ui/masterpagepalette.h"

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19495&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Tue Sep  9 22:21:15 2014
@@ -68,6 +68,7 @@
 
 #include "appmodes.h"
 #include "actionmanager.h"
+#include "appmodehelper.h"
 #include "canvas.h"
 #include "canvasgesture.h"
 #include "canvasmode.h"
@@ -328,7 +329,7 @@
 		Doc->previewVisual = 0;
 		m_ScMW->viewToolBar->setDoc(Doc);
 	}
-	m_ScMW->appModeHelper.setPreviewMode(inPreview);
+	m_ScMW->appModeHelper->setPreviewMode(inPreview);
 	m_ScMW->setPreviewToolbar();
 	m_ScMW->viewToolBar->setViewPreviewMode(inPreview);
 	ScGuardedPtr<ScribusDoc> docPtr = Doc->guardedPtr();
@@ -476,18 +477,15 @@
 			break;
 		default:
 			if (appMode < 0 || appMode > submodeFirstSubmode)
-			{
-//				qDebug() << "request mode: UNKNOWN" << appMode;
 				appMode = modeNormal;
-			}
 			m_previousMode = appMode;
 			break;
 	}
 
-//	qDebug() << "request mode" << Doc->appMode << "-->" << appMode;
 	if (Doc->appMode != appMode)
 	{
-		m_ScMW->setAppMode(appMode);
+		//m_ScMW->setAppMode(appMode);
+		m_ScMW->appModeHelper->setApplicationMode(m_ScMW, Doc, appMode);
 		CanvasMode* newCanvasMode = modeInstances.value(appMode);
 		if (!newCanvasMode)
 		{
@@ -496,7 +494,6 @@
 		}
 		if (newCanvasMode)
 		{
-//			qDebug() << "request canvas mode" << typeid(*newCanvasMode).name();
 			m_canvasMode->deactivate(false);
 			m_canvasMode = newCanvasMode;
 			m_canvasMode->activate(false);
@@ -504,9 +501,97 @@
 		updateNecessary = true;
 	}
 	else
-		m_ScMW->setAppMode(appMode);
+	{
+		//m_ScMW->setAppMode(appMode);
+		m_ScMW->appModeHelper->setApplicationMode(m_ScMW, Doc, appMode);
+	}
 	if (updateNecessary)
 		updateCanvas();
+	setCursorBasedOnAppMode(appMode);
+}
+
+void ScribusView::setCursorBasedOnAppMode(int appMode)
+{
+	int docSelectionCount = Doc->m_Selection->count();
+	switch (appMode)
+	{
+		case modeDrawShapes:
+		case modeDrawArc:
+		case modeDrawSpiral:
+			if (docSelectionCount!=0)
+				Deselect(true);
+			setCursor(QCursor(loadIcon("DrawFrame.xpm")));
+			break;
+		case modeDrawImage:
+			if (docSelectionCount!=0)
+				Deselect(true);
+			setCursor(QCursor(loadIcon("DrawImageFrame.xpm")));
+			break;
+		case modeDrawLatex:
+			if (docSelectionCount!=0)
+				Deselect(true);
+			setCursor(QCursor(loadIcon("DrawLatexFrame.xpm")));
+			break;
+		case modeDrawText:
+			if (docSelectionCount!=0)
+				Deselect(true);
+			setCursor(QCursor(loadIcon("DrawTextFrame.xpm")));
+			break;
+		case modeDrawTable2:
+			if (docSelectionCount!=0)
+				Deselect(true);
+			setCursor(QCursor(loadIcon("DrawTable.xpm")));
+			break;
+		case modeDrawRegularPolygon:
+			if (docSelectionCount!=0)
+				Deselect(true);
+			setCursor(QCursor(loadIcon("DrawPolylineFrame.xpm")));
+			break;
+		case modeMagnifier:
+			if (docSelectionCount!=0)
+				Deselect(true);
+			Magnify = true;
+			setCursor(QCursor(loadIcon("LupeZ.xpm")));
+			break;
+		case modePanning:
+			setCursor(QCursor(loadIcon("HandC.xpm")));
+			break;
+		case modeDrawLine:
+		case modeDrawBezierLine:
+			setCursor(QCursor(Qt::CrossCursor));
+			break;
+		case modeDrawCalligraphicLine:
+		case modeDrawFreehandLine:
+			setCursor(QCursor(loadIcon("DrawFreeLine.png"), 0, 32));
+			break;
+		case modeEyeDropper:
+			setCursor(QCursor(loadIcon("colorpickercursor.png"), 0, 32));
+			break;
+		case modeInsertPDFButton:
+		case modeInsertPDFRadioButton:
+		case modeInsertPDFTextfield:
+		case modeInsertPDFCheckbox:
+		case modeInsertPDFCombobox:
+		case modeInsertPDFListbox:
+		case modeInsertPDFTextAnnotation:
+		case modeInsertPDFLinkAnnotation:
+		case modeInsertPDF3DAnnotation:
+			if (docSelectionCount!=0)
+				Deselect(true);
+			setCursor(QCursor(Qt::CrossCursor));
+			break;
+		case modeMeasurementTool:
+		case modeEditGradientVectors:
+		case modeEditMeshGradient:
+		case modeEditArc:
+		case modeEditPolygon:
+		case modeEditSpiral:
+			setCursor(QCursor(Qt::CrossCursor));
+			break;
+		default:
+			setCursor(QCursor(Qt::ArrowCursor));
+		break;
+	}
 }
 
 

Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19495&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Tue Sep  9 22:21:15 2014
@@ -111,6 +111,7 @@
 	friend class CanvasMode_Rotate;
 	
 	void requestMode(int appMode);
+	void setCursorBasedOnAppMode(int appMode);
 	void startGesture(CanvasGesture*);
 	void stopGesture();
 	

Modified: trunk/Scribus/scribus/ui/propertiespalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19495&path=/trunk/Scribus/scribus/ui/propertiespalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette.cpp Tue Sep  9 22:21:15 2014
@@ -29,6 +29,8 @@
 #define _USE_MATH_DEFINES
 #endif
 #include <cmath>
+
+#include "appmodehelper.h"
 #include "appmodes.h"
 #include "arrowchooser.h"
 #include "autoform.h"
@@ -181,7 +183,7 @@
 	//connect(this->Cpal, SIGNAL(gradientChanged()), m_ScMW, SLOT(updtGradFill()));
 	//connect(this->Cpal, SIGNAL(strokeGradientChanged()), m_ScMW, SLOT(updtGradStroke()));
 	connect(this->Tpal, SIGNAL(gradientChanged()), this, SLOT(handleGradientChanged()));
-	connect(m_ScMW, SIGNAL(AppModeChanged(int,int)), this, SLOT(AppModeChanged()));
+	connect(m_ScMW->appModeHelper, SIGNAL(AppModeChanged(int,int)), this, SLOT(AppModeChanged()));
 }
 
 void PropertiesPalette::SelTab(int t)

Modified: trunk/Scribus/scribus/ui/propertiespalette_table.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19495&path=/trunk/Scribus/scribus/ui/propertiespalette_table.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_table.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_table.cpp Tue Sep  9 22:21:15 2014
@@ -11,7 +11,7 @@
 #include <QListWidgetItem>
 #include <QWidget>
 
-
+#include "appmodehelper.h"
 #include "appmodes.h"
 #include "colorcombo.h"
 #include "commonstrings.h"
@@ -65,8 +65,8 @@
 	m_mainWindow = mainWindow;
 
 	connect(m_mainWindow, SIGNAL(UpdateRequest(int)), SLOT(handleUpdateRequest(int)));
-	connect(m_mainWindow, SIGNAL(AppModeChanged(int,int)), this, SLOT(updateFillControls()));
-	connect(m_mainWindow, SIGNAL(AppModeChanged(int,int)), this, SLOT(updateStyleControls()));
+	connect(m_mainWindow->appModeHelper, SIGNAL(AppModeChanged(int,int)), this, SLOT(updateFillControls()));
+	connect(m_mainWindow->appModeHelper, SIGNAL(AppModeChanged(int,int)), this, SLOT(updateStyleControls()));
 }
 
 void PropertiesPalette_Table::setDocument(ScribusDoc *doc)

Modified: trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19495&path=/trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp Tue Sep  9 22:21:15 2014
@@ -14,6 +14,7 @@
 #endif
 #include <cmath>
 
+#include "appmodehelper.h"
 #include "appmodes.h"
 #include "autoform.h"
 #include "basepointwidget.h"
@@ -150,7 +151,7 @@
 {
 	m_ScMW = mw;
 
-	connect(mw, SIGNAL(AppModeChanged(int, int)), this, SLOT(handleAppModeChanged(int, int)));
+	connect(mw->appModeHelper, SIGNAL(AppModeChanged(int, int)), this, SLOT(handleAppModeChanged(int, int)));
 }
 
 void PropertiesPalette_XYZ::setDoc(ScribusDoc *d)

Modified: trunk/Scribus/scribus/ui/propertywidget_distance.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19495&path=/trunk/Scribus/scribus/ui/propertywidget_distance.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_distance.cpp (original)
+++ trunk/Scribus/scribus/ui/propertywidget_distance.cpp Tue Sep  9 22:21:15 2014
@@ -7,6 +7,7 @@
 
 #include "propertywidget_distance.h"
 
+#include "appmodehelper.h"
 #include "appmodes.h"
 #include "pageitem_table.h"
 #include "pageitem_textframe.h"
@@ -56,7 +57,7 @@
 {
 	m_ScMW = mw;
 
-	connect(m_ScMW, SIGNAL(AppModeChanged(int, int)), this, SLOT(handleAppModeChanged(int, int)));
+	connect(m_ScMW->appModeHelper, SIGNAL(AppModeChanged(int, int)), this, SLOT(handleAppModeChanged(int, int)));
 	connect(m_ScMW, SIGNAL(UpdateRequest(int))      , this, SLOT(handleUpdateRequest(int)));
 }
 

Modified: trunk/Scribus/scribus/ui/propertywidget_optmargins.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19495&path=/trunk/Scribus/scribus/ui/propertywidget_optmargins.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_optmargins.cpp (original)
+++ trunk/Scribus/scribus/ui/propertywidget_optmargins.cpp Tue Sep  9 22:21:15 2014
@@ -7,6 +7,7 @@
 
 #include "propertywidget_optmargins.h"
 
+#include "appmodehelper.h"
 #include "appmodes.h"
 #include "pageitem_table.h"
 #include "scribus.h"
@@ -33,7 +34,7 @@
 {
 	m_ScMW = mw;
 
-	connect(m_ScMW, SIGNAL(AppModeChanged(int, int)), this, SLOT(handleAppModeChanged(int, int)));
+	connect(m_ScMW->appModeHelper, SIGNAL(AppModeChanged(int, int)), this, SLOT(handleAppModeChanged(int, int)));
 	connect(m_ScMW, SIGNAL(UpdateRequest(int)), this  , SLOT(handleUpdateRequest(int)));
 }
 

Modified: trunk/Scribus/scribus/ui/propertywidget_pareffect.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19495&path=/trunk/Scribus/scribus/ui/propertywidget_pareffect.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_pareffect.cpp (original)
+++ trunk/Scribus/scribus/ui/propertywidget_pareffect.cpp Tue Sep  9 22:21:15 2014
@@ -9,6 +9,7 @@
 
 
 #include "appmodes.h"
+#include "appmodehelper.h"
 #include "pageitem.h"
 #include "pageitem_table.h"
 #include "scribus.h"
@@ -48,7 +49,7 @@
 {
 	m_ScMW = mw;
 
-	connect(m_ScMW, SIGNAL(AppModeChanged(int, int)), this, SLOT(handleAppModeChanged(int, int)));
+	connect(m_ScMW->appModeHelper, SIGNAL(AppModeChanged(int, int)), this, SLOT(handleAppModeChanged(int, int)));
 	connect(m_ScMW, SIGNAL(UpdateRequest(int)), this  , SLOT(handleUpdateRequest(int)));
 }
 




More information about the scribus-commit mailing list