Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 18887 → Rev 18888

/trunk/Scribus/scribus/CMakeLists.txt
182,6 → 182,7
 
SET(SCRIBUS_MOC_CLASSES
actionmanager.h
appmodehelper.h
canvas.h
canvasgesture_cellselect.h
canvasgesture_columnresize.h
499,6 → 500,7
 
SET(SCRIBUS_SOURCES
actionmanager.cpp
appmodehelper.cpp
canvas.cpp
canvasgesture_cellselect.cpp
canvasgesture_columnresize.cpp
/trunk/Scribus/scribus/appmodehelper.cpp
0,0 → 1,233
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
 
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
 
#include "appmodehelper.h"
#include "scribusdoc.h"
#include "scribuscore.h"
 
AppModeHelper::AppModeHelper(QObject *parent) :
QObject(parent)
{
scrActions=NULL;
}
 
void AppModeHelper::setScrActions(QMap<QString, QPointer<ScrAction> > *scra)
{
scrActions=scra;
}
 
void AppModeHelper::setFrameEditMode(bool b)
{
bool b2=!b;
(*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);
#ifdef HAVE_OSG
(*scrActions)["toolsPDFAnnot3D"]->setEnabled(b2);
#endif
(*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);
if (b2)
{
(*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);
(*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);
#ifdef HAVE_OSG
(*scrActions)["toolsPDFAnnot3D"]->setEnabled(b2);
#endif
}
 
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);
if (b2)
{
(*scrActions)["fileSave"]->setEnabled(!doc->isConverted);
if ( ScCore->haveGS() || ScCore->isWinGUI() )
(*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);
(*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);
#ifdef HAVE_OSG
(*scrActions)["toolsPDFAnnot3D"]->setEnabled(b2);
#endif
}
 
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);
if (b2)
{
(*scrActions)["fileSave"]->setEnabled(!doc->isConverted);
if ( ScCore->haveGS() || ScCore->isWinGUI() )
(*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)["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);
#ifdef HAVE_OSG
(*scrActions)["toolsPDFAnnot3D"]->setEnabled(b2);
#endif
(*scrActions)["viewPreviewMode"]->setEnabled(b2);
}
 
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);
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);
}
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: Scribus/scribus/appmodehelper.h
===================================================================
--- Scribus/scribus/appmodehelper.h (nonexistent)
+++ Scribus/scribus/appmodehelper.h (revision 18888)
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+
+#ifndef APPMODEHELPER_H
+#define APPMODEHELPER_H
+
+#include <QMap>
+#include <QObject>
+#include <QPointer>
+#include <QString>
+#include "actionmanager.h"
+#include "scraction.h"
+
+class AppModeHelper : public QObject
+{
+ Q_OBJECT
+
+ friend class ActionManager;
+ friend class ScribusMainWindow;
+
+ public:
+ explicit AppModeHelper(QObject *parent = 0);
+ void setScrActions(QMap<QString, QPointer<ScrAction> > *);
+ void setFrameEditMode(bool b);
+ void setSymbolEditMode(bool b, ScribusDoc* doc);
+ void setInlineEditMode(bool b, ScribusDoc* doc);
+ void setMasterPageEditMode(bool b, ScribusDoc *doc);
+ void changeLayer(ScribusDoc *doc, bool clipScrapHaveData);
+
+ signals:
+
+ public slots:
+
+ protected:
+ QMap<QString, QPointer<ScrAction> > *scrActions;
+};
+
+#endif // APPMODEHELPER_H
/Scribus/scribus/appmodehelper.h
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: Scribus/scribus/scribus.cpp
===================================================================
--- Scribus/scribus/scribus.cpp (revision 18887)
+++ Scribus/scribus/scribus.cpp (revision 18888)
@@ -341,6 +341,7 @@
scrWindowsActions.clear();
scrLayersActions.clear();
scrScrapActions.clear();
+ appModeHelper.setScrActions(&scrActions);
actionManager = new ActionManager(this);
scrMenuMgr = new ScMWMenuManager(menuBar(), actionManager);
prefsManager = PrefsManager::instance();
@@ -672,12 +673,12 @@
connect(docCheckerPalette, SIGNAL(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
connect(docCheckerPalette, SIGNAL(selectElement(PageItem *, bool, int)), this, SLOT(selectItemFromOutlines(PageItem *, bool, int)));
connect(docCheckerPalette, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
- connect(docCheckerPalette, SIGNAL(selectMasterPage(QString)), this, SLOT(manageMasterPages(QString)));
+ connect(docCheckerPalette, SIGNAL(selectMasterPage(QString)), this, SLOT(editMasterPagesStart(QString)));
// connect(outlinePalette, SIGNAL(selectElement(int, int, bool)), this, SLOT(selectItemsFromOutlines(int, int, bool)));
connect(outlinePalette, SIGNAL(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
connect(outlinePalette, SIGNAL(editElementByItem(PageItem *)), this, SLOT(editItemsFromOutlines(PageItem *)));
connect(outlinePalette, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
- connect(outlinePalette, SIGNAL(selectMasterPage(QString)), this, SLOT(manageMasterPages(QString)));
+ connect(outlinePalette, SIGNAL(selectMasterPage(QString)), this, SLOT(editMasterPagesStart(QString)));
// connect(propertiesPalette, SIGNAL(EditLSt()), this, SLOT(slotEditLineStyles()));
// connect(nodePalette, SIGNAL(paletteClosed()), propertiesPalette, SLOT(endEdit2()));
connect(nodePalette, SIGNAL(paletteClosed()), this, SLOT(slotSelect()));
@@ -4794,7 +4795,7 @@
}
else if (doc->masterPageMode())
{
- manageMasterPagesEnd();
+ editMasterPagesEnd();
return true;
}
ScribusWin* tw = ActWin;
@@ -6551,42 +6552,7 @@
connect(view, SIGNAL(HavePoint(bool, bool)), nodePalette, SLOT(HaveNode(bool, bool)));
doc->nodeEdit.reset();
//done elsewhere now doc->appMode = modeEditClip;
- scrActions["toolsSelect"]->setEnabled(false);
- scrActions["toolsRotate"]->setEnabled(false);
- scrActions["toolsEditContents"]->setEnabled(false);
- scrActions["toolsEditWithStoryEditor"]->setEnabled(false);
- scrActions["toolsZoom"]->setEnabled(false);
- scrActions["toolsInsertTextFrame"]->setEnabled(false);
- scrActions["toolsInsertImageFrame"]->setEnabled(false);
- scrActions["toolsInsertTable"]->setEnabled(false);
- scrActions["toolsInsertShape"]->setEnabled(false);
- scrActions["toolsInsertLine"]->setEnabled(false);
- scrActions["toolsInsertBezier"]->setEnabled(false);
- scrActions["toolsInsertFreehandLine"]->setEnabled(false);
- scrActions["toolsInsertCalligraphicLine"]->setEnabled(false);
- scrActions["toolsInsertPolygon"]->setEnabled(false);
- scrActions["toolsInsertArc"]->setEnabled(false);
- scrActions["toolsInsertSpiral"]->setEnabled(false);
- scrActions["toolsInsertRenderFrame"]->setEnabled(false);
- scrActions["toolsLinkTextFrame"]->setEnabled(false);
- scrActions["toolsUnlinkTextFrame"]->setEnabled(false);
- scrActions["toolsUnlinkTextFrameWithTextCopy"]->setEnabled(false);
- scrActions["toolsUnlinkTextFrameWithTextCut"]->setEnabled(false);
- scrActions["toolsMeasurements"]->setEnabled(false);
- scrActions["toolsCopyProperties"]->setEnabled(false);
- scrActions["toolsEyeDropper"]->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);
- scrActions["toolsPDFAnnotLink"]->setEnabled(false);
-#ifdef HAVE_OSG
- scrActions["toolsPDFAnnot3D"]->setEnabled(false);
-#endif
- scrActions["itemDelete"]->setEnabled(false);
+ appModeHelper.setFrameEditMode(true);
layerPalette->setEnabled(false);
outlinePalette->setEnabled(false);
guidePalette->setEnabled(false);
@@ -6639,43 +6605,10 @@
actionManager->disconnectModeActions();
nodePalette->setDoc(0,0);
nodePalette->hide();
-// qDebug() << "nodepalette hide";
- scrActions["toolsSelect"]->setEnabled(true);
+ appModeHelper.setFrameEditMode(false);
scrActions["toolsSelect"]->setChecked(true);
- scrActions["toolsRotate"]->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["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);
-#ifdef HAVE_OSG
- scrActions["toolsPDFAnnot3D"]->setEnabled(true);
-#endif
scrActions["toolsEditContents"]->setChecked(false);
scrActions["toolsEditWithStoryEditor"]->setChecked(false);
- scrActions["toolsMeasurements"]->setEnabled(true);
- scrActions["toolsCopyProperties"]->setEnabled(true);
- scrActions["toolsEyeDropper"]->setEnabled(true);
- scrActions["toolsUnlinkTextFrame"]->setEnabled(true);
- scrActions["toolsUnlinkTextFrameWithTextCopy"]->setEnabled(true);
- scrActions["toolsUnlinkTextFrameWithTextCut"]->setEnabled(true);
- scrActions["itemDelete"]->setEnabled(true);
scrActions["itemShapeEdit"]->setChecked(false);
layerPalette->setEnabled(true);
outlinePalette->setEnabled(true);
@@ -8808,40 +8741,12 @@
doc->stored_minCanvasCoordinate = doc->minCanvasCoordinate;
doc->stored_maxCanvasCoordinate = doc->maxCanvasCoordinate;
view->showSymbolPage(temp);
- scrActions["pageInsert"]->setEnabled(false);
- scrActions["pageImport"]->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);
- scrActions["fileOpen"]->setEnabled(false);
- scrActions["fileSave"]->setEnabled(false);
+ appModeHelper.setSymbolEditMode(true, doc);
scrActions["fileClose"]->setToolTip( tr("Click here to leave symbol edit mode."));
scrActions["fileClose"]->setIcon(loadIcon("22/exit.png"));
scrMenuMgr->setMenuEnabled("FileOpenRecent", false);
- scrActions["fileRevert"]->setEnabled(false);
- scrActions["fileDocSetup150"]->setEnabled(false);
- scrActions["filePrint"]->setEnabled(false);
- scrActions["fileCollect"]->setEnabled(false);
- scrActions["fileSaveAs"]->setEnabled(false);
scrMenuMgr->setMenuEnabled("FileExport", false);
- scrActions["fileExportAsEPS"]->setEnabled(false);
- scrActions["fileExportAsPDF"]->setEnabled(false);
- scrActions["PrintPreview"]->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);
-#ifdef HAVE_OSG
- scrActions["toolsPDFAnnot3D"]->setEnabled(false);
-#endif
+
pagePalette->enablePalette(false);
layerPalette->setEnabled(false);
patternsDependingOnThis.clear();
@@ -8878,43 +8783,14 @@
doc->restartAutoSaveTimer();
}
slotSelect();
- scrActions["editMasterPages"]->setEnabled(true);
- scrActions["fileNew"]->setEnabled(true);
- scrActions["fileNewFromTemplate"]->setEnabled(true);
- scrActions["fileOpen"]->setEnabled(true);
- scrActions["fileClose"]->setEnabled(true);
+ appModeHelper.setSymbolEditMode(false, doc);
scrActions["fileClose"]->setToolTip( tr("Close"));
scrActions["fileClose"]->setIcon(loadIcon("22/close.png"));
- scrActions["fileSave"]->setEnabled(!doc->isConverted);
scrMenuMgr->setMenuEnabled("FileOpenRecent", true);
- scrActions["fileRevert"]->setEnabled(true);
- scrActions["fileDocSetup150"]->setEnabled(true);
- scrActions["filePrint"]->setEnabled(true);
- scrActions["fileCollect"]->setEnabled(true);
- scrActions["fileSaveAs"]->setEnabled(true);
scrMenuMgr->setMenuEnabled("FileExport", true);
- scrActions["fileExportAsEPS"]->setEnabled(true);
- scrActions["fileExportAsPDF"]->setEnabled(true);
+
if ( ScCore->haveGS() || ScCore->isWinGUI() )
scrActions["PrintPreview"]->setEnabled(true);
- scrActions["pageInsert"]->setEnabled(true);
- scrActions["pageCopy"]->setEnabled(true);
- scrActions["pageImport"]->setEnabled(true);
- scrActions["pageApplyMasterPage"]->setEnabled(true);
- scrActions["pageCopyToMasterPage"]->setEnabled(true);
- bool setter = doc->DocPages.count() > 1 ? true : false;
- scrActions["pageDelete"]->setEnabled(setter);
- scrActions["pageMove"]->setEnabled(setter);
- 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);
-#ifdef HAVE_OSG
- scrActions["toolsPDFAnnot3D"]->setEnabled(true);
-#endif
pagePalette->enablePalette(true);
pagePalette->rebuildMasters();
view->setScale(storedViewScale);
@@ -8952,40 +8828,11 @@
doc->stored_minCanvasCoordinate = doc->minCanvasCoordinate;
doc->stored_maxCanvasCoordinate = doc->maxCanvasCoordinate;
view->showInlinePage(id);
- scrActions["pageInsert"]->setEnabled(false);
- scrActions["pageImport"]->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);
- scrActions["fileOpen"]->setEnabled(false);
- scrActions["fileSave"]->setEnabled(false);
+ appModeHelper.setInlineEditMode(true, doc);
scrActions["fileClose"]->setToolTip( tr("Click here to leave inline frame edit mode."));
scrActions["fileClose"]->setIcon(loadIcon("22/exit.png"));
scrMenuMgr->setMenuEnabled("FileOpenRecent", false);
- scrActions["fileRevert"]->setEnabled(false);
- scrActions["fileDocSetup150"]->setEnabled(false);
- scrActions["filePrint"]->setEnabled(false);
- scrActions["fileCollect"]->setEnabled(false);
- scrActions["fileSaveAs"]->setEnabled(false);
scrMenuMgr->setMenuEnabled("FileExport", false);
- scrActions["fileExportAsEPS"]->setEnabled(false);
- scrActions["fileExportAsPDF"]->setEnabled(false);
- scrActions["PrintPreview"]->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);
-#ifdef HAVE_OSG
- scrActions["toolsPDFAnnot3D"]->setEnabled(false);
-#endif
pagePalette->enablePalette(false);
layerPalette->setEnabled(false);
inlinePalette->editingStart(id);
@@ -9007,43 +8854,11 @@
doc->restartAutoSaveTimer();
}
slotSelect();
- scrActions["editMasterPages"]->setEnabled(true);
- scrActions["fileNew"]->setEnabled(true);
- scrActions["fileNewFromTemplate"]->setEnabled(true);
- scrActions["fileOpen"]->setEnabled(true);
- scrActions["fileClose"]->setEnabled(true);
+ appModeHelper.setInlineEditMode(false, doc);
scrActions["fileClose"]->setToolTip( tr("Close"));
scrActions["fileClose"]->setIcon(loadIcon("22/close.png"));
- scrActions["fileSave"]->setEnabled(!doc->isConverted);
scrMenuMgr->setMenuEnabled("FileOpenRecent", true);
- scrActions["fileRevert"]->setEnabled(true);
- scrActions["fileDocSetup150"]->setEnabled(true);
- scrActions["filePrint"]->setEnabled(true);
- scrActions["fileCollect"]->setEnabled(true);
- scrActions["fileSaveAs"]->setEnabled(true);
scrMenuMgr->setMenuEnabled("FileExport", true);
- scrActions["fileExportAsEPS"]->setEnabled(true);
- scrActions["fileExportAsPDF"]->setEnabled(true);
- if ( ScCore->haveGS() || ScCore->isWinGUI() )
- scrActions["PrintPreview"]->setEnabled(true);
- scrActions["pageInsert"]->setEnabled(true);
- scrActions["pageCopy"]->setEnabled(true);
- scrActions["pageImport"]->setEnabled(true);
- scrActions["pageApplyMasterPage"]->setEnabled(true);
- scrActions["pageCopyToMasterPage"]->setEnabled(true);
- bool setter = doc->DocPages.count() > 1 ? true : false;
- scrActions["pageDelete"]->setEnabled(setter);
- scrActions["pageMove"]->setEnabled(setter);
- 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);
-#ifdef HAVE_OSG
- scrActions["toolsPDFAnnot3D"]->setEnabled(true);
-#endif
pagePalette->enablePalette(true);
pagePalette->rebuildMasters();
view->setScale(storedViewScale);
@@ -9062,7 +8877,7 @@
updateActiveWindowCaption(doc->DocName);
}
-void ScribusMainWindow::manageMasterPages(QString temp)
+void ScribusMainWindow::editMasterPagesStart(QString temp)
{
if (!HaveDoc)
return;
@@ -9099,40 +8914,14 @@
pagePalette->show();
scrActions["toolsPages"]->setChecked(true);
}
- scrActions["pageInsert"]->setEnabled(false);
- scrActions["pageImport"]->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);
- scrActions["fileOpen"]->setEnabled(false);
- scrActions["fileClose"]->setEnabled(true);
+ appModeHelper.setMasterPageEditMode(true, doc);
+ scrMenuMgr->setMenuEnabled("FileOpenRecent", false);
scrActions["fileClose"]->setToolTip( tr("Click here to leave master page edit mode."));
scrActions["fileClose"]->setIcon(loadIcon("22/exit.png"));
- scrMenuMgr->setMenuEnabled("FileOpenRecent", false);
- scrActions["fileRevert"]->setEnabled(false);
- scrActions["fileDocSetup150"]->setEnabled(false);
- scrActions["filePrint"]->setEnabled(false);
- scrActions["PrintPreview"]->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);
-#ifdef HAVE_OSG
- scrActions["toolsPDFAnnot3D"]->setEnabled(false);
-#endif
- scrActions["viewPreviewMode"]->setEnabled(false);
view->previewToolbarButton->setEnabled(false);
}
-void ScribusMainWindow::manageMasterPagesEnd()
+void ScribusMainWindow::editMasterPagesEnd()
{
view->setScale(storedViewScale);
doc->minCanvasCoordinate = doc->stored_minCanvasCoordinate;
@@ -9144,40 +8933,10 @@
doc->restartAutoSaveTimer();
}
slotSelect();
- scrActions["editMasterPages"]->setEnabled(true);
- scrActions["fileNew"]->setEnabled(true);
- scrActions["fileNewFromTemplate"]->setEnabled(true);
- scrActions["fileOpen"]->setEnabled(true);
- scrActions["fileClose"]->setEnabled(true);
+ appModeHelper.setMasterPageEditMode(false, doc);
scrActions["fileClose"]->setToolTip( tr("Close"));
scrActions["fileClose"]->setIcon(loadIcon("22/close.png"));
- scrActions["fileSave"]->setEnabled(!doc->isConverted);
scrMenuMgr->setMenuEnabled("FileOpenRecent", true);
- scrActions["fileRevert"]->setEnabled(true);
-// scrActions["fileDocSetup"]->setEnabled(true);
- scrActions["fileDocSetup150"]->setEnabled(true);
- scrActions["filePrint"]->setEnabled(true);
- if ( ScCore->haveGS() || ScCore->isWinGUI() )
- scrActions["PrintPreview"]->setEnabled(true);
- scrActions["pageInsert"]->setEnabled(true);
- scrActions["pageCopy"]->setEnabled(true);
- scrActions["pageImport"]->setEnabled(true);
- scrActions["pageApplyMasterPage"]->setEnabled(true);
- scrActions["pageCopyToMasterPage"]->setEnabled(true);
- bool setter = doc->DocPages.count() > 1 ? true : false;
- scrActions["pageDelete"]->setEnabled(setter);
- scrActions["pageMove"]->setEnabled(setter);
- 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);
-#ifdef HAVE_OSG
- scrActions["toolsPDFAnnot3D"]->setEnabled(true);
-#endif
- scrActions["viewPreviewMode"]->setEnabled(true);
view->previewToolbarButton->setEnabled(true);
uint pageCount=doc->DocPages.count();
for (uint c=0; c<pageCount; ++c)
@@ -9491,7 +9250,7 @@
{
PicStatus *dia = new PicStatus(this, doc);
connect(dia, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
- connect(dia, SIGNAL(selectMasterPage(QString)), this, SLOT(manageMasterPages(QString)));
+ connect(dia, SIGNAL(selectMasterPage(QString)), this, SLOT(editMasterPagesStart(QString)));
connect(dia, SIGNAL(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
// connect(dia, SIGNAL(refreshItem(PageItem*)), view, SLOT(RefreshItem(PageItem*)));
dia->exec();
@@ -9652,54 +9411,10 @@
view->setLayerMenuText(doc->activeLayerName());
view->DrawNew();
bool setter = !doc->layerLocked( doc->activeLayer() );
- scrActions["editPaste"]->setEnabled((ScMimeData::clipboardHasScribusData() || (scrapbookPalette->tempBView->objectMap.count() > 0)) && (setter));
scrMenuMgr->setMenuEnabled("EditPasteRecent", ((scrapbookPalette->tempBView->objectMap.count() > 0) && (setter)));
- scrActions["editSelectAll"]->setEnabled(setter);
- scrActions["editSelectAllOnLayer"]->setEnabled(setter);
- scrActions["editDeselectAll"]->setEnabled(false);
scrMenuMgr->setMenuEnabled("Insert", setter);
- 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);
- if (doc->masterPageMode())
- {
- 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);
-#ifdef HAVE_OSG
- scrActions["toolsPDFAnnot3D"]->setEnabled(false);
-#endif
- }
- else
- {
- scrActions["toolsPDFPushButton"]->setEnabled(setter);
- scrActions["toolsPDFRadioButton"]->setEnabled(setter);
- scrActions["toolsPDFTextField"]->setEnabled(setter);
- scrActions["toolsPDFCheckBox"]->setEnabled(setter);
- scrActions["toolsPDFComboBox"]->setEnabled(setter);
- scrActions["toolsPDFListBox"]->setEnabled(setter);
- scrActions["toolsPDFAnnotText"]->setEnabled(setter);
-#ifdef HAVE_OSG
- scrActions["toolsPDFAnnot3D"]->setEnabled(setter);
-#endif
- }
- scrActions["toolsPDFAnnotLink"]->setEnabled(setter);
scrMenuMgr->setMenuEnabled("ItemLayer", doc->layerCount() > 1);
+ appModeHelper.changeLayer(doc, (ScMimeData::clipboardHasScribusData() || (scrapbookPalette->tempHasContents())));
}
void ScribusMainWindow::showLayer()
@@ -10166,7 +9881,7 @@
return;
if(doc->masterPageMode())
{
- manageMasterPagesEnd();
+ editMasterPagesEnd();
qApp->processEvents();
}
}
/trunk/Scribus/scribus/scribus.h
58,6 → 58,7
#include "scribusview.h"
#include "scribusdoc.h"
#include "ui/customfdialog.h"
#include "appmodehelper.h"
 
class ActionManager;
class AlignDistributePalette;
232,6 → 233,7
ScribusWin* ActWin;
QClipboard *ClipB;
QString LoadEnc;
AppModeHelper appModeHelper;
 
QProcess *ExternalApp;
 
288,8 → 290,8
void editSymbolEnd();
void editInlineStart(int id);
void editInlineEnd();
void manageMasterPages(QString temp = "");
void manageMasterPagesEnd();
void editMasterPagesStart(QString temp = "");
void editMasterPagesEnd();
/** \brief generate a new document in the current view */
bool slotFileNew();
void newFileFromTemplate();
/trunk/Scribus/scribus/scribuswin.cpp
128,7 → 128,7
}
else if (m_Doc->masterPageMode())
{
m_MainWindow->manageMasterPagesEnd();
m_MainWindow->editMasterPagesEnd();
ce->ignore();
return;
}
/trunk/Scribus/scribus/ui/scrapbookpalette.cpp
863,6 → 863,11
return activeBView->objectMap.count();
}
 
bool Biblio::tempHasContents()
{
return (!tempBView->objectMap.isEmpty());
}
 
void Biblio::readOldContents(QString fileName, QString newName)
{
activeBView->ReadOldContents(fileName, newName);
/trunk/Scribus/scribus/ui/scrapbookpalette.h
83,6 → 83,7
void setScrapbookFileName(QString);
const QString getScrapbookFileName();
const int objectCount();
bool tempHasContents();
void readContents(QString);
void readTempContents(QString);
void readOldContents(QString, QString);