r18918 by craig - Move action enable functions for when last or next to last doc is closed to AppModeHelper
scribus-commit
scribus-commit at lists.scribus.net
Mon Mar 17 21:44:56 UTC 2014
Author: craig
Date: Mon Mar 17 21:44:55 2014
New Revision: 18918
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18918
Log:
Move action enable functions for when last or next to last doc is closed to AppModeHelper
Modified:
trunk/Scribus/scribus/appmodehelper.cpp
trunk/Scribus/scribus/appmodehelper.h
trunk/Scribus/scribus/scribus.cpp
Modified: trunk/Scribus/scribus/appmodehelper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18918&path=/trunk/Scribus/scribus/appmodehelper.cpp
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.cpp (original)
+++ trunk/Scribus/scribus/appmodehelper.cpp Mon Mar 17 21:44:55 2014
@@ -400,6 +400,122 @@
}
}
+void AppModeHelper::mainWindowCloseLastDoc()
+{
+ (*scrActions)["fileDocSetup150"]->setEnabled(false);
+ (*scrActions)["filePrint"]->setEnabled(false);
+ (*scrActions)["fileSave"]->setEnabled(false);
+ (*scrActions)["fileSaveAs"]->setEnabled(false);
+ (*scrActions)["fileRevert"]->setEnabled(false);
+ (*scrActions)["fileCollect"]->setEnabled(false);
+ (*scrActions)["fileClose"]->setEnabled(false);
+ (*scrActions)["PrintPreview"]->setEnabled(false);
+ if ((*scrActions)["SaveAsDocumentTemplate"])
+ (*scrActions)["SaveAsDocumentTemplate"]->setEnabled(false);
+ (*scrActions)["fileExportAsPDF"]->setEnabled(false);
+ (*scrActions)["fileExportText"]->setEnabled(false);
+ (*scrActions)["fileExportAsEPS"]->setEnabled(false);
+ (*scrActions)["fileImportText"]->setEnabled(false);
+ (*scrActions)["fileImportText2"]->setEnabled(false);
+ (*scrActions)["fileImportImage"]->setEnabled(false);
+ (*scrActions)["fileImportAppendText"]->setEnabled(false);
+ (*scrActions)["pageInsert"]->setEnabled(false);
+ (*scrActions)["pageImport"]->setEnabled(false);
+ (*scrActions)["pageDelete"]->setEnabled(false);
+ (*scrActions)["pageImport"]->setEnabled(false);
+ (*scrActions)["pageMove"]->setEnabled(false);
+ (*scrActions)["pageCopy"]->setEnabled(false);
+ (*scrActions)["pageApplyMasterPage"]->setEnabled(false);
+ (*scrActions)["pageCopyToMasterPage"]->setEnabled(false);
+ (*scrActions)["pageManageGuides"]->setEnabled(false);
+ (*scrActions)["pageManageMargins"]->setEnabled(false);
+ (*scrActions)["editUndoAction"]->setEnabled(false);
+ (*scrActions)["editRedoAction"]->setEnabled(false);
+ (*scrActions)["editCut"]->setEnabled(false);
+ (*scrActions)["editCopy"]->setEnabled(false);
+ (*scrActions)["editPaste"]->setEnabled(false);
+ (*scrActions)["editClearContents"]->setEnabled(false);
+ (*scrActions)["editSelectAll"]->setEnabled(false);
+ (*scrActions)["editSelectAllOnLayer"]->setEnabled(false);
+ (*scrActions)["editDeselectAll"]->setEnabled(false);
+ (*scrActions)["editReplaceColors"]->setEnabled(false);
+ (*scrActions)["editStyles"]->setEnabled(false);
+ (*scrActions)["editMarks"]->setEnabled(false);
+ (*scrActions)["editNotesStyles"]->setEnabled(false);
+ (*scrActions)["editSearchReplace"]->setEnabled(false);
+ (*scrActions)["editMasterPages"]->setEnabled(false);
+ (*scrActions)["editJavascripts"]->setEnabled(false);
+ (*scrActions)["editEditWithImageEditor"]->setEnabled(false);
+ (*scrActions)["editEditRenderSource"]->setEnabled(false);
+ (*scrActions)["extrasHyphenateText"]->setEnabled(false);
+ (*scrActions)["extrasDeHyphenateText"]->setEnabled(false);
+ (*scrActions)["viewFitInWindow"]->setEnabled(false);
+ (*scrActions)["viewFitWidth"]->setEnabled(false);
+ (*scrActions)["viewFit50"]->setEnabled(false);
+ (*scrActions)["viewFit75"]->setEnabled(false);
+ (*scrActions)["viewFit100"]->setEnabled(false);
+ (*scrActions)["viewFit200"]->setEnabled(false);
+ (*scrActions)["viewFit400"]->setEnabled(false);
+ (*scrActions)["viewSnapToGuides"]->setChecked(false);
+ (*scrActions)["viewSnapToElements"]->setChecked(false);
+ (*scrActions)["viewSnapToGrid"]->setChecked(false);
+ (*scrActions)["viewShowRulers"]->setEnabled(false);
+ (*scrActions)["insertFrame"]->setEnabled(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)["itemSendToPattern"]->setEnabled(false);
+ (*scrActions)["itemSendToInline"]->setEnabled(false);
+ (*scrActions)["itemAdjustFrameToImage"]->setEnabled(false);
+ (*scrActions)["itemAdjustImageToFrame"]->setEnabled(false);
+ (*scrActions)["itemExtendedImageProperties"]->setEnabled(false);
+ (*scrActions)["itemUpdateImage"]->setEnabled(false);
+ (*scrActions)["itemPreviewLow"]->setEnabled(false);
+ (*scrActions)["itemPreviewNormal"]->setEnabled(false);
+ (*scrActions)["itemPreviewFull"]->setEnabled(false);
+ (*scrActions)["itemAttributes"]->setEnabled(false);
+ (*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)["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)["toolsInsertTable"]->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
+}
+
void AppModeHelper::enableTextActions(bool enabled, const QString& fontName)
{
(*scrActions)["insertGlyph"]->setEnabled(enabled);
Modified: trunk/Scribus/scribus/appmodehelper.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18918&path=/trunk/Scribus/scribus/appmodehelper.h
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.h (original)
+++ trunk/Scribus/scribus/appmodehelper.h Mon Mar 17 21:44:55 2014
@@ -41,6 +41,7 @@
void changeLayer(ScribusDoc *doc, bool clipScrapHaveData);
void mainWindowHasNewDoc(ScribusDoc *doc, bool clipScrapHaveData);
void mainWindowSwitchWin(ScribusDoc *doc);
+ void mainWindowCloseLastDoc();
//! \brief enable or disable the unicode actions and their menus
void enableTextActions(bool enabled, const QString& fontName=QString::null);
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18918&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Mon Mar 17 21:44:55 2014
@@ -4707,138 +4707,8 @@
{
PluginManager& pluginManager(PluginManager::instance());
pluginManager.enableOnlyStartupPluginActions(this);
-// scrActions["fileDocSetup"]->setEnabled(false);
- scrActions["fileDocSetup150"]->setEnabled(false);
- scrActions["filePrint"]->setEnabled(false);
- scrActions["fileSave"]->setEnabled(false);
- scrActions["fileSaveAs"]->setEnabled(false);
- scrActions["fileRevert"]->setEnabled(false);
- scrActions["fileCollect"]->setEnabled(false);
- scrActions["fileClose"]->setEnabled(false);
- scrActions["PrintPreview"]->setEnabled(false);
- if (scrActions["SaveAsDocumentTemplate"])
- scrActions["SaveAsDocumentTemplate"]->setEnabled(false);
- scrMenuMgr->setMenuEnabled("FileImport", false);
- scrMenuMgr->setMenuEnabled("FileExport", false);
- scrActions["fileExportAsPDF"]->setEnabled(false);
- scrActions["fileExportText"]->setEnabled(false);
- scrActions["fileExportAsEPS"]->setEnabled(false);
- scrActions["fileImportText"]->setEnabled(false);
- scrActions["fileImportText2"]->setEnabled(false);
- scrActions["fileImportImage"]->setEnabled(false);
- scrActions["fileImportAppendText"]->setEnabled(false);
- // scrMenuMgr->setMenuEnabled("Page", false);
- scrActions["pageInsert"]->setEnabled(false);
- scrActions["pageImport"]->setEnabled(false);
- scrActions["pageDelete"]->setEnabled(false);
- scrActions["pageImport"]->setEnabled(false);
- scrActions["pageMove"]->setEnabled(false);
- scrActions["pageCopy"]->setEnabled(false);
- scrActions["pageApplyMasterPage"]->setEnabled(false);
- scrActions["pageCopyToMasterPage"]->setEnabled(false);
- scrActions["pageManageGuides"]->setEnabled(false);
- scrActions["pageManageMargins"]->setEnabled(false);
-
- scrActions["editUndoAction"]->setEnabled(false);
- scrActions["editRedoAction"]->setEnabled(false);
- scrActions["editCut"]->setEnabled(false);
- scrActions["editCopy"]->setEnabled(false);
- scrActions["editPaste"]->setEnabled(false);
- scrMenuMgr->setMenuEnabled("EditPasteRecent", false);
- scrActions["editClearContents"]->setEnabled(false);
- scrActions["editSelectAll"]->setEnabled(false);
- scrActions["editSelectAllOnLayer"]->setEnabled(false);
- scrActions["editDeselectAll"]->setEnabled(false);
- scrActions["editReplaceColors"]->setEnabled(false);
-// scrActions["editPatterns"]->setEnabled(false);
-// scrActions["editGradients"]->setEnabled(false);
- scrActions["editStyles"]->setEnabled(false);
- scrActions["editMarks"]->setEnabled(false);
- scrActions["editNotesStyles"]->setEnabled(false);
- scrActions["editSearchReplace"]->setEnabled(false);
- scrActions["editMasterPages"]->setEnabled(false);
- scrActions["editJavascripts"]->setEnabled(false);
- scrActions["editEditWithImageEditor"]->setEnabled(false);
- scrActions["editEditRenderSource"]->setEnabled(false);
- //scrActions["toolsPreflightVerifier"]->setEnabled(false);
-
- scrActions["extrasHyphenateText"]->setEnabled(false);
- scrActions["extrasDeHyphenateText"]->setEnabled(false);
-// scrMenuMgr->setMenuEnabled("View", false);
- scrActions["viewFitInWindow"]->setEnabled(false);
- scrActions["viewFitWidth"]->setEnabled(false);
- scrActions["viewFit50"]->setEnabled(false);
- scrActions["viewFit75"]->setEnabled(false);
- scrActions["viewFit100"]->setEnabled(false);
- scrActions["viewFit200"]->setEnabled(false);
- scrActions["viewFit400"]->setEnabled(false);
- //scrMenuMgr->setMenuEnabled("Windows", false);
- scrActions["viewSnapToGuides"]->setChecked(false);
- scrActions["viewSnapToElements"]->setChecked(false);
- scrActions["viewSnapToGrid"]->setChecked(false);
- scrActions["viewShowRulers"]->setEnabled(false);
-
- scrMenuMgr->setMenuEnabled("Insert", false);
- scrActions["insertFrame"]->setEnabled(false);
-
- //scrMenuMgr->setMenuEnabled("Extras", 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["itemPreviewLow"]->setEnabled(false);
- scrActions["itemPreviewNormal"]->setEnabled(false);
- scrActions["itemPreviewFull"]->setEnabled(false);
- scrActions["itemAttributes"]->setEnabled(false);
-
- 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["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["toolsInsertTable"]->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
+ appModeHelper.mainWindowCloseLastDoc();
+
//CB dont need this until we have a doc...
//propertiesPalette->Cpal->setColors(prefsManager->colorSet());
mainWindowStatusLabel->setText( tr("Ready"));
More information about the scribus-commit
mailing list