r14871 by cbradney - Start to bring in new doc setup dialog, and start to align doc prefs storage with app prefs structs.

scribus-commit scribus-commit at lists.scribus.net
Thu Mar 11 23:50:33 CET 2010


Revision: 14871
Author: cbradney
Date: 2010-03-11T22:45:14.865284Z
Commit message: Start to bring in new doc setup dialog, and start to align doc prefs storage with app prefs structs.

Changeset: 
M  /trunk/Scribus/scribus/actionmanager.cpp
M  /trunk/Scribus/scribus/scribus.cpp
M  /trunk/Scribus/scribus/scribus.h
M  /trunk/Scribus/scribus/scribusdoc.cpp
M  /trunk/Scribus/scribus/scribusdoc.h

Diffs:
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp	(revision 14870)
+++ scribus/scribusdoc.cpp	(revision 14871)
@@ -158,12 +158,13 @@
 
 ScribusDoc::ScribusDoc() : UndoObject( tr("Document")), Observable<ScribusDoc>(NULL),
 	m_hasGUI(false),
-	prefsData(PrefsManager::instance()->appPrefs),
+	appPrefsData(PrefsManager::instance()->appPrefs),
+	docPrefsData(PrefsManager::instance()->appPrefs),
 	undoManager(UndoManager::instance()),
 	loading(false),
 	modified(false),
 	ActiveLayer(0),
-	docUnitIndex(prefsData.docSetupPrefs.docUnitIndex),
+	docUnitIndex(appPrefsData.docSetupPrefs.docUnitIndex),
 	docUnitRatio(unitGetRatioFromIndex(docUnitIndex)),
 	rotMode(0),
 	automaticTextFrames(0),
@@ -177,9 +178,9 @@
 	First(1), Last(0),
 	viewCount(0), viewID(0),
 	SnapGuides(false), GuideLock(false),
-	scratch(prefsData.displayPrefs.scratch),
-	GapHorizontal(prefsData.displayPrefs.pageGapHorizontal),
-	GapVertical(prefsData.displayPrefs.pageGapVertical),
+	scratch(appPrefsData.displayPrefs.scratch),
+	GapHorizontal(appPrefsData.displayPrefs.pageGapHorizontal),
+	GapVertical(appPrefsData.displayPrefs.pageGapVertical),
 // 	ScratchLeft(prefsData.ScratchLeft),
 // 	ScratchRight(prefsData.ScratchRight),
 // 	ScratchTop(prefsData.ScratchTop),
@@ -192,7 +193,7 @@
 	Items(0), MasterItems(), DocItems(), FrameItems(),
 	m_Selection(new Selection(this, true)),
 	pageWidth(0), pageHeight(0),
-	pageSets(prefsData.pageSets),
+	pageSets(appPrefsData.pageSets),
 	PageSp(1), PageSpa(0),
 	currentPageLayout(0),
 	PageOri(0), m_pageSize(0),
@@ -205,17 +206,17 @@
 	ValCount(0),
 	DocName( tr("Document")+"-"),
 	UsedFonts(),
-	AllFonts(&prefsData.fontPrefs.AvailFonts),
+	AllFonts(&appPrefsData.fontPrefs.AvailFonts),
 	AObjects(),
-	papColor(prefsData.displayPrefs.paperColor),
+	papColor(appPrefsData.displayPrefs.paperColor),
 	CurrentSel(-1),
 	nodeEdit(),
-	typographicSettings(prefsData.typoPrefs),
-	guidesSettings(prefsData.guidesPrefs),
-	itemToolPrefs(prefsData.itemToolPrefs),
-	opToolPrefs(prefsData.opToolPrefs),
-	checkerProfiles(prefsData.verifierPrefs.checkerPrefsList),
-	curCheckProfile(prefsData.verifierPrefs.curCheckProfile),
+	typographicSettings(appPrefsData.typoPrefs),
+	guidesSettings(appPrefsData.guidesPrefs),
+	itemToolPrefs(appPrefsData.itemToolPrefs),
+	opToolPrefs(appPrefsData.opToolPrefs),
+	checkerProfiles(appPrefsData.verifierPrefs.checkerPrefsList),
+	curCheckProfile(appPrefsData.verifierPrefs.curCheckProfile),
 	LastAuto(0), FirstAuto(0),
 	DraggedElem(0),
 	ElemToLink(0),
@@ -223,26 +224,26 @@
 	docParagraphStyles(),
 	docCharStyles(),
 	Layers(),
-	marginColored(prefsData.displayPrefs.marginColored),
+	marginColored(appPrefsData.displayPrefs.marginColored),
 	GroupCounter(1),
 	colorEngine(ScCore->defaultEngine),
 	JavaScripts(),
 	TotalItems(0),
-	MinWordLen(prefsData.hyphPrefs.MinWordLen),
-	HyCount(prefsData.hyphPrefs.HyCount),
-	Language(prefsData.hyphPrefs.Language),
-	Automatic(prefsData.hyphPrefs.Automatic),
-	AutoCheck(prefsData.hyphPrefs.AutoCheck),
-	PDF_Options(prefsData.pdfPrefs),
+	MinWordLen(appPrefsData.hyphPrefs.MinWordLen),
+	HyCount(appPrefsData.hyphPrefs.HyCount),
+	Language(appPrefsData.hyphPrefs.Language),
+	Automatic(appPrefsData.hyphPrefs.Automatic),
+	AutoCheck(appPrefsData.hyphPrefs.AutoCheck),
+	PDF_Options(appPrefsData.pdfPrefs),
 	RePos(false),
 	BookMarks(),
 	OldBM(false),
 	hasName(false),
-	AutoSave(prefsData.docSetupPrefs.AutoSave),
-	AutoSaveTime(prefsData.docSetupPrefs.AutoSaveTime),
+	AutoSave(appPrefsData.docSetupPrefs.AutoSave),
+	AutoSaveTime(appPrefsData.docSetupPrefs.AutoSaveTime),
 	autoSaveTimer(new QTimer(this)),
 	MLineStyles(),
-	arrowStyles(prefsData.arrowStyles),
+	arrowStyles(appPrefsData.arrowStyles),
 	WinHan(0),
 	DoDrawing(true),
 	OpenNodes(),
@@ -250,8 +251,8 @@
 	docLayerErrors(),
 	docItemErrors(),
 	masterItemErrors(),
-	docItemAttributes(prefsData.itemAttrPrefs.defaultItemAttributes),
-	docToCSetups(prefsData.tocPrefs.defaultToCSetups),
+	docItemAttributes(appPrefsData.itemAttrPrefs.defaultItemAttributes),
+	docToCSetups(appPrefsData.tocPrefs.defaultToCSetups),
 	// sections
 	symReturn(), symNewLine(), symTab(), symNonBreak(), symNewCol(), symNewFrame(),
 	docHyphenator(0),
@@ -262,7 +263,7 @@
 	m_docUpdater(NULL)
 {
 	init();
-	bleeds = prefsData.docSetupPrefs.bleeds;
+	bleeds = appPrefsData.docSetupPrefs.bleeds;
 	PDF_Options.bleeds = bleeds;
 	PDF_Options.useDocBleeds = true;
 	Print_Options.firstUse = true;
@@ -271,7 +272,8 @@
 
 ScribusDoc::ScribusDoc(const QString& docName, int unitindex, const PageSize& pagesize, const MarginStruct& margins, const DocPagesSetup& pagesSetup) : UndoObject( tr("Document")),
 	m_hasGUI(false),
-	prefsData(PrefsManager::instance()->appPrefs),
+	appPrefsData(PrefsManager::instance()->appPrefs),
+	docPrefsData(PrefsManager::instance()->appPrefs),
 	undoManager(UndoManager::instance()),
 	loading(false),
 	modified(false),
@@ -290,9 +292,9 @@
 	First(1), Last(0),
 	viewCount(0), viewID(0),
 	SnapGuides(false), GuideLock(false),
-	scratch(prefsData.displayPrefs.scratch),
-	GapHorizontal(prefsData.displayPrefs.pageGapHorizontal),
-	GapVertical(prefsData.displayPrefs.pageGapVertical),
+	scratch(appPrefsData.displayPrefs.scratch),
+	GapHorizontal(appPrefsData.displayPrefs.pageGapHorizontal),
+	GapVertical(appPrefsData.displayPrefs.pageGapVertical),
 // 	ScratchLeft(prefsData.ScratchLeft),
 // 	ScratchRight(prefsData.ScratchRight),
 // 	ScratchTop(prefsData.ScratchTop),
@@ -306,8 +308,8 @@
 	m_Selection(new Selection(this, true)),
 	pageWidth(pagesize.width()), pageHeight(pagesize.height()),
 	pageMargins(margins),
-	marginPreset(prefsData.docSetupPrefs.marginPreset),
-	pageSets(prefsData.pageSets),
+	marginPreset(appPrefsData.docSetupPrefs.marginPreset),
+	pageSets(appPrefsData.pageSets),
 	PageSp(pagesSetup.columnCount), PageSpa(pagesSetup.columnDistance),
 	currentPageLayout(pagesSetup.pageArrangement),
 	PageOri(pagesSetup.orientation), m_pageSize(pagesize.name()),
@@ -320,17 +322,17 @@
 	ValCount(0),
 	DocName(docName),
 	UsedFonts(),
-	AllFonts(&prefsData.fontPrefs.AvailFonts),
+	AllFonts(&appPrefsData.fontPrefs.AvailFonts),
 	AObjects(),
-	papColor(prefsData.displayPrefs.paperColor),
+	papColor(appPrefsData.displayPrefs.paperColor),
 	CurrentSel(-1),
 	nodeEdit(),
-	typographicSettings(prefsData.typoPrefs),
-	guidesSettings(prefsData.guidesPrefs),
-	itemToolPrefs(prefsData.itemToolPrefs),
-	opToolPrefs(prefsData.opToolPrefs),
-	checkerProfiles(prefsData.verifierPrefs.checkerPrefsList),
-	curCheckProfile(prefsData.verifierPrefs.curCheckProfile),
+	typographicSettings(appPrefsData.typoPrefs),
+	guidesSettings(appPrefsData.guidesPrefs),
+	itemToolPrefs(appPrefsData.itemToolPrefs),
+	opToolPrefs(appPrefsData.opToolPrefs),
+	checkerProfiles(appPrefsData.verifierPrefs.checkerPrefsList),
+	curCheckProfile(appPrefsData.verifierPrefs.curCheckProfile),
 	LastAuto(0), FirstAuto(0),
 	DraggedElem(0),
 	ElemToLink(0),
@@ -338,26 +340,26 @@
 	docParagraphStyles(),
 	docCharStyles(),
 	Layers(),
-	marginColored(prefsData.displayPrefs.marginColored),
+	marginColored(appPrefsData.displayPrefs.marginColored),
 	GroupCounter(1),
 	colorEngine(ScCore->defaultEngine),
 	JavaScripts(),
 	TotalItems(0),
-	MinWordLen(prefsData.hyphPrefs.MinWordLen),
-	HyCount(prefsData.hyphPrefs.HyCount),
-	Language(prefsData.hyphPrefs.Language),
-	Automatic(prefsData.hyphPrefs.Automatic),
-	AutoCheck(prefsData.hyphPrefs.AutoCheck),
-	PDF_Options(prefsData.pdfPrefs),
+	MinWordLen(appPrefsData.hyphPrefs.MinWordLen),
+	HyCount(appPrefsData.hyphPrefs.HyCount),
+	Language(appPrefsData.hyphPrefs.Language),
+	Automatic(appPrefsData.hyphPrefs.Automatic),
+	AutoCheck(appPrefsData.hyphPrefs.AutoCheck),
+	PDF_Options(appPrefsData.pdfPrefs),
 	RePos(false),
 	BookMarks(),
 	OldBM(false),
 	hasName(false),
-	AutoSave(prefsData.docSetupPrefs.AutoSave),
-	AutoSaveTime(prefsData.docSetupPrefs.AutoSaveTime),
+	AutoSave(appPrefsData.docSetupPrefs.AutoSave),
+	AutoSaveTime(appPrefsData.docSetupPrefs.AutoSaveTime),
 	autoSaveTimer(new QTimer(this)),
 	MLineStyles(),
-	arrowStyles(prefsData.arrowStyles),
+	arrowStyles(appPrefsData.arrowStyles),
 	WinHan(0),
 	DoDrawing(true),
 	OpenNodes(),
@@ -365,8 +367,8 @@
 	docLayerErrors(),
 	docItemErrors(),
 	masterItemErrors(),
-	docItemAttributes(prefsData.itemAttrPrefs.defaultItemAttributes),
-	docToCSetups(prefsData.tocPrefs.defaultToCSetups),
+	docItemAttributes(appPrefsData.itemAttrPrefs.defaultItemAttributes),
+	docToCSetups(appPrefsData.tocPrefs.defaultToCSetups),
 	// sections
 	symReturn(), symNewLine(), symTab(), symNonBreak(), symNewCol(), symNewFrame(),
 	docHyphenator(0),
@@ -378,7 +380,7 @@
 {
 	pageSets[pagesSetup.pageArrangement].FirstPage = pagesSetup.firstPageLocation;
 	init();
-	bleeds = prefsData.docSetupPrefs.bleeds;
+	bleeds = appPrefsData.docSetupPrefs.bleeds;
 	PDF_Options.bleeds = bleeds;
 	PDF_Options.useDocBleeds = true;
 	Print_Options.firstUse = true;
@@ -416,38 +418,38 @@
 	PDF_Options.Intent = CMSSettings.DefaultIntentColors;
 	PDF_Options.Intent2 = CMSSettings.DefaultIntentImages;
 
-	AddFont(prefsData.itemToolPrefs.textFont);//, prefsData.AvailFonts[prefsData.itemToolPrefs.textFont]->Font);
-	itemToolPrefs.textFont = prefsData.itemToolPrefs.textFont;
-	itemToolPrefs.textSize = prefsData.itemToolPrefs.textSize;
-	itemToolPrefs.textTabFillChar = prefsData.itemToolPrefs.textTabFillChar;
-	opToolPrefs.dispX = prefsData.opToolPrefs.dispX;
-	opToolPrefs.dispY = prefsData.opToolPrefs.dispY;
-	opToolPrefs.constrain = prefsData.opToolPrefs.constrain;
+	AddFont(appPrefsData.itemToolPrefs.textFont);//, prefsData.AvailFonts[prefsData.itemToolPrefs.textFont]->Font);
+	itemToolPrefs.textFont = appPrefsData.itemToolPrefs.textFont;
+	itemToolPrefs.textSize = appPrefsData.itemToolPrefs.textSize;
+	itemToolPrefs.textTabFillChar = appPrefsData.itemToolPrefs.textTabFillChar;
+	opToolPrefs.dispX = appPrefsData.opToolPrefs.dispX;
+	opToolPrefs.dispY = appPrefsData.opToolPrefs.dispY;
+	opToolPrefs.constrain = appPrefsData.opToolPrefs.constrain;
 
 	PageColors.ensureBlackAndWhite();
-	if (prefsData.itemToolPrefs.shapeLineColor != CommonStrings::None)
-		PageColors.insert(prefsData.itemToolPrefs.shapeLineColor, prefsData.colorPrefs.DColors[prefsData.itemToolPrefs.shapeLineColor]);
-	itemToolPrefs.shapeLineColor = prefsData.itemToolPrefs.shapeLineColor;
-	if (prefsData.itemToolPrefs.lineColor != CommonStrings::None)
-		PageColors.insert(prefsData.itemToolPrefs.lineColor, prefsData.colorPrefs.DColors[prefsData.itemToolPrefs.lineColor]);
-	itemToolPrefs.lineColor = prefsData.itemToolPrefs.lineColor;
-	if (prefsData.itemToolPrefs.textColor != CommonStrings::None)
-		PageColors.insert(prefsData.itemToolPrefs.textColor, prefsData.colorPrefs.DColors[prefsData.itemToolPrefs.textColor]);
-	itemToolPrefs.textColor = prefsData.itemToolPrefs.textColor;
-	if (prefsData.itemToolPrefs.textStrokeColor != CommonStrings::None)
-		PageColors.insert(prefsData.itemToolPrefs.textStrokeColor, prefsData.colorPrefs.DColors[prefsData.itemToolPrefs.textStrokeColor]);
-	itemToolPrefs.textStrokeColor = prefsData.itemToolPrefs.textStrokeColor;
-	if (prefsData.itemToolPrefs.shapeFillColor != CommonStrings::None)
-		PageColors.insert(prefsData.itemToolPrefs.shapeFillColor, prefsData.colorPrefs.DColors[prefsData.itemToolPrefs.shapeFillColor]);
-	itemToolPrefs.shapeFillColor = prefsData.itemToolPrefs.shapeFillColor;
-	if (prefsData.itemToolPrefs.imageFillColor != CommonStrings::None)
-		PageColors.insert(prefsData.itemToolPrefs.imageFillColor, prefsData.colorPrefs.DColors[prefsData.itemToolPrefs.imageFillColor]);
-	itemToolPrefs.imageFillColor = prefsData.itemToolPrefs.imageFillColor;
-	if (prefsData.itemToolPrefs.textFillColor != CommonStrings::None)
-		PageColors.insert(prefsData.itemToolPrefs.textFillColor, prefsData.colorPrefs.DColors[prefsData.itemToolPrefs.textFillColor]);
-	itemToolPrefs.textFillColor = prefsData.itemToolPrefs.textFillColor;
-	if (prefsData.itemToolPrefs.textLineColor != CommonStrings::None)
-		PageColors.insert(prefsData.itemToolPrefs.textLineColor, prefsData.colorPrefs.DColors[prefsData.itemToolPrefs.textLineColor]);
+	if (appPrefsData.itemToolPrefs.shapeLineColor != CommonStrings::None)
+		PageColors.insert(appPrefsData.itemToolPrefs.shapeLineColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.shapeLineColor]);
+	itemToolPrefs.shapeLineColor = appPrefsData.itemToolPrefs.shapeLineColor;
+	if (appPrefsData.itemToolPrefs.lineColor != CommonStrings::None)
+		PageColors.insert(appPrefsData.itemToolPrefs.lineColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.lineColor]);
+	itemToolPrefs.lineColor = appPrefsData.itemToolPrefs.lineColor;
+	if (appPrefsData.itemToolPrefs.textColor != CommonStrings::None)
+		PageColors.insert(appPrefsData.itemToolPrefs.textColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.textColor]);
+	itemToolPrefs.textColor = appPrefsData.itemToolPrefs.textColor;
+	if (appPrefsData.itemToolPrefs.textStrokeColor != CommonStrings::None)
+		PageColors.insert(appPrefsData.itemToolPrefs.textStrokeColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.textStrokeColor]);
+	itemToolPrefs.textStrokeColor = appPrefsData.itemToolPrefs.textStrokeColor;
+	if (appPrefsData.itemToolPrefs.shapeFillColor != CommonStrings::None)
+		PageColors.insert(appPrefsData.itemToolPrefs.shapeFillColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.shapeFillColor]);
+	itemToolPrefs.shapeFillColor = appPrefsData.itemToolPrefs.shapeFillColor;
+	if (appPrefsData.itemToolPrefs.imageFillColor != CommonStrings::None)
+		PageColors.insert(appPrefsData.itemToolPrefs.imageFillColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.imageFillColor]);
+	itemToolPrefs.imageFillColor = appPrefsData.itemToolPrefs.imageFillColor;
+	if (appPrefsData.itemToolPrefs.textFillColor != CommonStrings::None)
+		PageColors.insert(appPrefsData.itemToolPrefs.textFillColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.textFillColor]);
+	itemToolPrefs.textFillColor = appPrefsData.itemToolPrefs.textFillColor;
+	if (appPrefsData.itemToolPrefs.textLineColor != CommonStrings::None)
+		PageColors.insert(appPrefsData.itemToolPrefs.textLineColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.textLineColor]);
 
 	
 	ParagraphStyle pstyle;
@@ -469,7 +471,7 @@
 	CharStyle cstyle;
 	cstyle.setDefaultStyle(true);
 	cstyle.setName(CommonStrings::DefaultCharacterStyle);
-	cstyle.setFont(prefsData.fontPrefs.AvailFonts[itemToolPrefs.textFont]);
+	cstyle.setFont(appPrefsData.fontPrefs.AvailFonts[itemToolPrefs.textFont]);
 	cstyle.setFontSize(itemToolPrefs.textSize);
 	cstyle.setFeatures(QStringList(CharStyle::INHERIT));
 	cstyle.setFillColor(itemToolPrefs.textColor);
@@ -503,7 +505,7 @@
 	
 	Layers.addLayer( tr("Background") );
 	// Fixme: Check PDF version input
-	PDF_Options.Version = (PDFOptions::PDFVersion)prefsData.pdfPrefs.Version;
+	PDF_Options.Version = (PDFOptions::PDFVersion)appPrefsData.pdfPrefs.Version;
 
 	PDF_Options.firstUse = true;
 	docPatterns.clear();
@@ -3630,7 +3632,7 @@
 						ScriXmlDoc *ss = new ScriXmlDoc();
 						QString dataS = ss->WriteElem(this, &tempSelection);
 						setCurrentPage(targetPage);
-						ss->ReadElemToLayer(dataS, prefsData.fontPrefs.AvailFonts, this, targetPage->xOffset(), targetPage->yOffset(), false, true, prefsData.fontPrefs.GFontSub, it->ID);
+						ss->ReadElemToLayer(dataS, appPrefsData.fontPrefs.AvailFonts, this, targetPage->xOffset(), targetPage->yOffset(), false, true, appPrefsData.fontPrefs.GFontSub, it->ID);
 						delete ss;
 						setMasterPageMode(false);
 					}
@@ -3659,7 +3661,7 @@
 				QString dataS = ss->WriteElem(this, &tempSelection);
 				setMasterPageMode(true);
 				setCurrentPage(targetPage);
-				ss->ReadElemToLayer(dataS, prefsData.fontPrefs.AvailFonts, this, targetPage->xOffset(), targetPage->yOffset(), false, true, prefsData.fontPrefs.GFontSub, it->ID);
+				ss->ReadElemToLayer(dataS, appPrefsData.fontPrefs.AvailFonts, this, targetPage->xOffset(), targetPage->yOffset(), false, true, appPrefsData.fontPrefs.GFontSub, it->ID);
 				delete ss;
 				setMasterPageMode(false);
 			}
@@ -5584,7 +5586,7 @@
 					if ((lcount < itemBuffer.count()) && !itemBuffer[lcount].isEmpty())
 					{
 						ScriXmlDoc *ss = new ScriXmlDoc();
-						ss->ReadElemToLayer(itemBuffer[lcount], prefsData.fontPrefs.AvailFonts, this, destination->xOffset(), destination->yOffset(), false, true, prefsData.fontPrefs.GFontSub,(*it).ID);
+						ss->ReadElemToLayer(itemBuffer[lcount], appPrefsData.fontPrefs.AvailFonts, this, destination->xOffset(), destination->yOffset(), false, true, appPrefsData.fontPrefs.GFontSub,(*it).ID);
 						delete ss;
 					}
 					lcount++;
Index: scribus/scribusdoc.h
===================================================================
--- scribus/scribusdoc.h	(revision 14870)
+++ scribus/scribusdoc.h	(revision 14871)
@@ -922,7 +922,8 @@
 protected:
 	void addSymbols();
 	bool m_hasGUI;
-	ApplicationPrefs& prefsData;
+	ApplicationPrefs& appPrefsData;
+	ApplicationPrefs docPrefsData;
 	UndoManager * const undoManager;
 	bool loading;
 	bool modified;
Index: scribus/actionmanager.cpp
===================================================================
--- scribus/actionmanager.cpp	(revision 14870)
+++ scribus/actionmanager.cpp	(revision 14871)
@@ -139,6 +139,8 @@
 	//Rest of File Menu
 	name="fileDocSetup";
 	scrActions->insert(name, new ScrAction(loadIcon("16/document-properties.png"), loadIcon("22/document-properties.png"), "", defaultKey(name), mainWindow));
+	name="fileDocSetup150";
+	scrActions->insert(name, new ScrAction(loadIcon("16/document-properties.png"), loadIcon("22/document-properties.png"), "", defaultKey(name), mainWindow));
 	name="filePreferences";
 	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
 	(*scrActions)[name]->setMenuRole(QAction::PreferencesRole);
@@ -163,6 +165,7 @@
 	connect( (*scrActions)["fileSave"], SIGNAL(triggered()), mainWindow, SLOT(slotFileSave()) );
 	connect( (*scrActions)["fileSaveAs"], SIGNAL(triggered()), mainWindow, SLOT(slotFileSaveAs()) );
 	connect( (*scrActions)["fileDocSetup"], SIGNAL(triggered()), mainWindow, SLOT(slotDocSetup()) );
+	connect( (*scrActions)["fileDocSetup150"], SIGNAL(triggered()), mainWindow, SLOT(slotDocSetup150()) );
 	connect( (*scrActions)["filePreferences"], SIGNAL(triggered()), mainWindow, SLOT(slotPrefsOrg()) );
 	connect( (*scrActions)["filePreferences150"], SIGNAL(triggered()), mainWindow, SLOT(slotPrefs150Org()) );
 	connect( (*scrActions)["fileRevert"], SIGNAL(triggered()), mainWindow, SLOT(slotFileRevert()) );
@@ -1281,6 +1284,7 @@
 	(*scrActions)["fileExportAsEPS"]->setTexts( tr("Save as &EPS..."));
 	(*scrActions)["fileExportAsPDF"]->setTexts( tr("Save as P&DF..."));
 	(*scrActions)["fileDocSetup"]->setTexts( tr("Document &Setup..."));
+	(*scrActions)["fileDocSetup150"]->setTexts( tr("Document &Setup 150..."));
 	(*scrActions)["filePreferences"]->setTexts( tr("P&references..."));
 	(*scrActions)["filePreferences150"]->setTexts( tr("P&references 150..."));
 	(*scrActions)["filePrint"]->setTexts( tr("&Print..."));
@@ -1745,7 +1749,7 @@
 	//File
 	itmenu->second << "fileNew" << "fileNewFromTemplate" << "fileOpen" << "fileClose" << "fileSave" << "fileSaveAs" << "fileRevert" << "fileCollect";
 	itmenu->second << "fileImportText" << "fileImportText2" << "fileImportAppendText" << "fileImportImage" << "fileImportVector" << "fileExportText" << "fileExportAsEPS" << "fileExportAsPDF";
-	itmenu->second << "fileDocSetup" << "filePreferences" << "filePreferences150" << "filePrint" << "PrintPreview" << "fileQuit";
+	itmenu->second << "fileDocSetup" << "fileDocSetup150" << "filePreferences" << "filePreferences150" << "filePrint" << "PrintPreview" << "fileQuit";
 	++itmenu;
 	//Edit
 	itmenu->second << "editUndoAction" << "editRedoAction" << "editActionMode" << "editCut" << "editCopy" << "editPaste" << "editCopyContents" << "editPasteContents" << "editPasteContentsAbs" << "editClearContents" << "editSelectAll" << "editSelectAllOnLayer" << "editDeselectAll" << "editSearchReplace" << "toolsEditWithStoryEditor" << "editEditWithImageEditor" << "editEditRenderSource" << "editExtendedImageProperties" << "editColors" << "editReplaceColors" << "editPatterns" << "editGradients" << "editStyles" << "editMasterPages" << "editJavascripts";
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(revision 14870)
+++ scribus/scribus.cpp	(revision 14871)
@@ -636,6 +636,7 @@
 	scrMenuMgr->addMenuItem(scrActions["fileExportAsPDF"], "FileExport", false);
 	scrMenuMgr->addMenuSeparator("File");
 	scrMenuMgr->addMenuItem(scrActions["fileDocSetup"], "File", false);
+	//scrMenuMgr->addMenuItem(scrActions["fileDocSetup150"], "File", false);
 	scrMenuMgr->addMenuItem(scrActions["filePreferences"], "File", true);
 	scrMenuMgr->addMenuItem(scrActions["filePreferences150"], "File", true);
 	scrMenuMgr->addMenuSeparator("File");
@@ -2224,70 +2225,7 @@
 	newActWin(windowWidget);
 }
 
-void ScribusMainWindow::docSetup(ReformDoc* dia)
-{
-	slotChangeUnit(dia->getSelectedUnit(), false);
-	dia->updateDocumentSettings();
-	if (dia->imageResolutionChanged())
-	{
-		setStatusBarInfoText( tr("Updating Images"));
-		mainWindowProgressBar->reset();
-		qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
-		qApp->processEvents();
-		doc->recalcPicturesRes(true);
-		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
-		setStatusBarInfoText("");
-		mainWindowProgressBar->reset();
-		view->previewQualitySwitcher->blockSignals(true);
-		view->previewQualitySwitcher->setCurrentIndex(doc->itemToolPrefs.imageLowResType);
-		view->previewQualitySwitcher->blockSignals(false);
-	}
-	propertiesPalette->Fonts->RebuildList(doc);
-	scrActions["viewShowMargins"]->setChecked(doc->guidesSettings.marginsShown);
-	scrActions["viewShowBleeds"]->setChecked(doc->guidesSettings.showBleed);
-	scrActions["viewShowFrames"]->setChecked(doc->guidesSettings.framesShown);
-	scrActions["viewShowLayerMarkers"]->setChecked(doc->guidesSettings.layerMarkersShown);
-	scrActions["viewShowGrid"]->setChecked(doc->guidesSettings.gridShown);
-	scrActions["viewShowGuides"]->setChecked(doc->guidesSettings.guidesShown);
-	scrActions["viewShowColumnBorders"]->setChecked(doc->guidesSettings.colBordersShown);
-	scrActions["viewShowBaseline"]->setChecked(doc->guidesSettings.baselineGridShown);
-	scrActions["viewShowImages"]->setChecked(doc->guidesSettings.showPic);
-	scrActions["viewShowTextChain"]->setChecked(doc->guidesSettings.linkShown);
-	scrActions["viewShowTextControls"]->setChecked(doc->guidesSettings.showControls);
-	scrActions["viewShowRulers"]->setChecked(doc->guidesSettings.rulersShown);
-	scrActions["viewRulerMode"]->setChecked(doc->guidesSettings.rulerMode);
-	scrActions["extrasGenerateTableOfContents"]->setEnabled(doc->hasTOCSetup());
-	view->cmsToolbarButton->setChecked(doc->HasCMS);
-	//doc emits changed() via this
-	doc->setMasterPageMode(true);
-	view->reformPages();
-	doc->setMasterPageMode(false);
-/*	doc->setLoading(true);
-	uint pageCount=doc->DocPages.count();
-	for (uint c=0; c<pageCount; ++c)
-		Apply_MasterPage(doc->DocPages.at(c)->MPageNam, c, false);
-	doc->setLoading(false); */
-	view->reformPages();
-	view->GotoPage(doc->currentPage()->pageNr());
-	view->DrawNew();
-	propertiesPalette->ShowCMS();
-	pagePalette->rebuildPages();
-}
 
-bool ScribusMainWindow::slotDocSetup()
-{
-	bool ret = false;
-	ReformDoc* dia = new ReformDoc(this, doc);
-	Q_CHECK_PTR(dia);
-	if (dia->exec())
-	{
-		docSetup(dia);
-		ret = true;
-	}
-	delete dia;
-	return ret;
-}
-
 void ScribusMainWindow::SwitchWin()
 {
 	updateActiveWindowCaption(doc->DocName);
@@ -2391,6 +2329,7 @@
  	scrActions["fileSave"]->setEnabled(true);
 	scrActions["fileClose"]->setEnabled(true);
 	scrActions["fileDocSetup"]->setEnabled(true);
+	scrActions["fileDocSetup150"]->setEnabled(true);
 	scrActions["fileRevert"]->setEnabled(false);
 	scrActions["fileCollect"]->setEnabled(true);
 	scrActions["fileSaveAs"]->setEnabled(true);
@@ -4460,6 +4399,7 @@
 		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);
@@ -7577,9 +7517,6 @@
 		struct ApplicationPrefs newPrefs(prefsDialog.prefs());
 		prefsManager->setNewPrefs(newPrefs);
 		prefsManager->applyLoadedShortCuts();
-		// TODO:
-		// CB: Hoping to clean this into a nicer function
-		//
 
 		//TODO: and the other dirs?
 		DocDir = prefsManager->documentDir();
@@ -7608,6 +7545,29 @@
 			mdiArea->setViewMode(QMdiArea::TabbedView);
 		else
 			mdiArea->setViewMode(QMdiArea::SubWindowView);
+		bool shadowChanged = oldPrefs.displayPrefs.showPageShadow != prefsManager->showPageShadow();
+		QList<QMdiSubWindow *> windows = mdiArea->subWindowList();
+		if (!windows.isEmpty())
+		{
+			int windowCount=static_cast<int>(windows.count());
+			for ( int i = 0; i < windowCount; ++i )
+			{
+				QWidget* w = windows.at(i)->widget();
+				ScribusWin* scw = (ScribusWin*) w;
+				ScribusView* scw_v = scw->view();
+				if (oldPrefs.displayPrefs.displayScale != prefsManager->displayScale())
+				{
+					int x = qRound(qMax(scw_v->contentsX() / scw_v->scale(), 0.0));
+					int y = qRound(qMax(scw_v->contentsY() / scw_v->scale(), 0.0));
+					int w = qRound(qMin(scw_v->visibleWidth() / scw_v->scale(), scw->doc()->currentPage()->width()));
+					int h = qRound(qMin(scw_v->visibleHeight() / scw_v->scale(), scw->doc()->currentPage()->height()));
+					scw_v->rememberOldZoomLocation(w / 2 + x,h / 2 + y);
+					scw_v->zoom((scw_v->scale() / oldPrefs.displayPrefs.displayScale) * prefsManager->displayScale());
+				}
+				if (shadowChanged)
+					scw->view()->DrawNew();
+			}
+		}
 
 		QString newMonitorProfile = newPrefs.colorPrefs.DCMSset.DefaultMonitorProfile;
 		if (oldMonitorProfile != newMonitorProfile)
@@ -7644,6 +7604,83 @@
 	}
 }
 
+
+void ScribusMainWindow::docSetup(ReformDoc* dia)
+{
+	slotChangeUnit(dia->getSelectedUnit(), false);
+	dia->updateDocumentSettings();
+	if (dia->imageResolutionChanged())
+	{
+		setStatusBarInfoText( tr("Updating Images"));
+		mainWindowProgressBar->reset();
+		qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+		qApp->processEvents();
+		doc->recalcPicturesRes(true);
+		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+		setStatusBarInfoText("");
+		mainWindowProgressBar->reset();
+		view->previewQualitySwitcher->blockSignals(true);
+		view->previewQualitySwitcher->setCurrentIndex(doc->itemToolPrefs.imageLowResType);
+		view->previewQualitySwitcher->blockSignals(false);
+	}
+	propertiesPalette->Fonts->RebuildList(doc);
+	scrActions["viewShowMargins"]->setChecked(doc->guidesSettings.marginsShown);
+	scrActions["viewShowBleeds"]->setChecked(doc->guidesSettings.showBleed);
+	scrActions["viewShowFrames"]->setChecked(doc->guidesSettings.framesShown);
+	scrActions["viewShowLayerMarkers"]->setChecked(doc->guidesSettings.layerMarkersShown);
+	scrActions["viewShowGrid"]->setChecked(doc->guidesSettings.gridShown);
+	scrActions["viewShowGuides"]->setChecked(doc->guidesSettings.guidesShown);
+	scrActions["viewShowColumnBorders"]->setChecked(doc->guidesSettings.colBordersShown);
+	scrActions["viewShowBaseline"]->setChecked(doc->guidesSettings.baselineGridShown);
+	scrActions["viewShowImages"]->setChecked(doc->guidesSettings.showPic);
+	scrActions["viewShowTextChain"]->setChecked(doc->guidesSettings.linkShown);
+	scrActions["viewShowTextControls"]->setChecked(doc->guidesSettings.showControls);
+	scrActions["viewShowRulers"]->setChecked(doc->guidesSettings.rulersShown);
+	scrActions["viewRulerMode"]->setChecked(doc->guidesSettings.rulerMode);
+	scrActions["extrasGenerateTableOfContents"]->setEnabled(doc->hasTOCSetup());
+	view->cmsToolbarButton->setChecked(doc->HasCMS);
+	//doc emits changed() via this
+	doc->setMasterPageMode(true);
+	view->reformPages();
+	doc->setMasterPageMode(false);
+/*	doc->setLoading(true);
+	uint pageCount=doc->DocPages.count();
+	for (uint c=0; c<pageCount; ++c)
+		Apply_MasterPage(doc->DocPages.at(c)->MPageNam, c, false);
+	doc->setLoading(false); */
+	view->reformPages();
+	view->GotoPage(doc->currentPage()->pageNr());
+	view->DrawNew();
+	propertiesPalette->ShowCMS();
+	pagePalette->rebuildPages();
+}
+
+bool ScribusMainWindow::slotDocSetup()
+{
+	bool ret = false;
+	ReformDoc* dia = new ReformDoc(this, doc);
+	Q_CHECK_PTR(dia);
+	if (dia->exec())
+	{
+		docSetup(dia);
+		ret = true;
+	}
+	delete dia;
+	return ret;
+}
+
+void ScribusMainWindow::slotDocSetup150()
+{
+	if (!doc)
+		return;
+	//struct ApplicationPrefs oldDocPrefs(doc->docPrefsData);
+	PreferencesDialog prefsDialog(this);
+	int prefsResult=prefsDialog.exec();
+	if (prefsResult==QDialog::Accepted)
+	{
+	//	struct ApplicationPrefs newPrefs(prefsDialog.prefs());
+	}
+}
 void ScribusMainWindow::ShowSubs()
 {
 	QString mess;
@@ -8265,6 +8302,7 @@
 			scrMenuMgr->setMenuEnabled("FileOpenRecent", false);
 			scrActions["fileRevert"]->setEnabled(false);
 			scrActions["fileDocSetup"]->setEnabled(false);
+			scrActions["fileDocSetup150"]->setEnabled(false);
 			scrActions["filePrint"]->setEnabled(false);
 			scrActions["PrintPreview"]->setEnabled(false);
 			scrActions["toolsPDFPushButton"]->setEnabled(false);
@@ -8297,6 +8335,7 @@
 	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);
Index: scribus/scribus.h
===================================================================
--- scribus/scribus.h	(revision 14870)
+++ scribus/scribus.h	(revision 14871)
@@ -475,16 +475,11 @@
 	void duplicateItem();
 	/** Multiple duplicate current item*/
 	void duplicateItemMulti();
-	/** \brief Refromat the document when user click "OK" in ReformDoc dialog.
-	See docSetup() for more info. */
-	bool slotDocSetup();
+
 	void objectAttributes();
 	void getImageInfo();
 	void generateTableOfContents();
-	/*! \brief Change Preferences dialog.
-	See prefsOrg for more info. It's very similar to docSetup/slotDocSetup. */
-	void slotPrefsOrg();
-	void slotPrefs150Org();
+
 //	void saveStyles(StilFormate *dia); //still required for style save from SE
 	void setNewAlignment(int a);
 	void setNewParStyle(const QString& name);
@@ -539,6 +534,14 @@
 	It's called from this->slotPrefsOrg() or from Preferences directly.
 	\param dia a reference to the Preferences dialog */
 	void prefsOrg(Preferences* dia);
+	/*! \brief Change Preferences dialog.
+	See prefsOrg for more info. It's very similar to docSetup/slotDocSetup. */
+	void slotPrefsOrg();
+	void slotPrefs150Org();
+	/** \brief Refromat the document when user click "OK" in ReformDoc dialog.
+	See docSetup() for more info. */
+	bool slotDocSetup();
+	void slotDocSetup150();
 	//! \brief Insert a frame friendly dialog
 	void slotInsertFrame();
 	//! \brief manages the documents patterns




More information about the scribus-commit mailing list