r15065 by cbradney - Add in PDF Export tabs to PDF preferences dialog for later reuse in export, disabled in prefs/doc setup 150

scribus-commit scribus-commit at lists.scribus.net
Fri May 14 00:00:33 CEST 2010


Revision: 15065
Author: cbradney
Date: 2010-05-13T21:59:25.820418Z
Commit message: Add in PDF Export tabs to PDF preferences dialog for later reuse in export, disabled in prefs/doc setup 150

Changeset: 
M  /trunk/Scribus/scribus/ui/prefs_pdfexport.h
M  /trunk/Scribus/scribus/ui/prefs_pdfexportbase.ui
M  /trunk/Scribus/scribus/ui/preferencesdialog.cpp
M  /trunk/Scribus/scribus/scribusdoc.h
M  /trunk/Scribus/scribus/ui/prefs_pdfexport.cpp

Diffs:
Index: scribus/scribusdoc.h
===================================================================
--- scribus/scribusdoc.h	(revision 15064)
+++ scribus/scribusdoc.h	(revision 15065)
@@ -217,6 +217,7 @@
 	void setDocumentInfo(DocumentInformation di) { docPrefsData.docInfo=di; }
 	DocumentSectionMap& sections() { return docPrefsData.docSectionMap; }
 	void setSections(DocumentSectionMap dsm) { docPrefsData.docSectionMap=dsm; }
+	const QMap<QString, int> & usedFonts() { return UsedFonts; }
 
 	const ApplicationPrefs& prefsData() { return docPrefsData; }
 	void setNewPrefs(const ApplicationPrefs& prefsData, const ApplicationPrefs& oldPrefsData);
Index: scribus/ui/prefs_pdfexport.cpp
===================================================================
--- scribus/ui/prefs_pdfexport.cpp	(revision 15064)
+++ scribus/ui/prefs_pdfexport.cpp	(revision 15065)
@@ -13,12 +13,14 @@
 #include "scribusdoc.h"
 #include "ui/scrspinbox.h"
 #include "units.h"
+#include "util.h"
 #include "util_icon.h"
 
 Prefs_PDFExport::Prefs_PDFExport(QWidget* parent, ScribusDoc* doc)
 	: Prefs_Pane(parent),
 	cmsEnabled(false),
-	m_doc(NULL)
+	m_doc(doc),
+	exportingPDF(false)
 {
 	setupUi(this);
 	pageMirrorHorizontalToolButton->setIcon(QIcon(loadIcon("16/flip-object-horizontal.png")));
@@ -122,10 +124,11 @@
 {
 }
 
-void Prefs_PDFExport::restoreDefaults(struct ApplicationPrefs *prefsData, ScribusDoc* doc, const ProfilesL & PDFXProfiles,
-									  const QMap<QString, int> & DocFonts)
+void Prefs_PDFExport::restoreDefaults(struct ApplicationPrefs *prefsData, const ProfilesL & PDFXProfiles, bool exporting)
 {
-	m_doc=doc;
+	exportingPDF=exporting;
+	enablePDFExportTabs(exportingPDF);
+	AllFonts=prefsData->fontPrefs.AvailFonts;
 	int unitIndex = prefsData->docSetupPrefs.docUnitIndex;
 	unitRatio = unitGetRatioFromIndex(unitIndex);
 	unitChange(unitIndex);
@@ -171,64 +174,64 @@
 	maxResolutionLimitCheckBox->setChecked(prefsData->pdfPrefs.RecalcPic);
 	maxExportResolutionSpinBox->setValue(prefsData->pdfPrefs.PicRes);
 	maxExportResolutionSpinBox->setEnabled(prefsData->pdfPrefs.RecalcPic);
-	/*
-if (mdoc != 0 && exporting)
+
+	if (m_doc != 0 && exportingPDF)
 	{
 //	Build a list of all Fonts used in Annotations;
 		PageItem *pgit;
-		for (int c = 0; c < doc->FrameItems.count(); ++c)
+		for (int c = 0; c < m_doc->FrameItems.count(); ++c)
 		{
-			pgit = doc->FrameItems.at(c);
+			pgit=m_doc->FrameItems.at(c);
 			if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
 				AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
 		}
-		for (int c = 0; c < doc->MasterItems.count(); ++c)
+		for (int c = 0; c < m_doc->MasterItems.count(); ++c)
 		{
-			pgit = doc->MasterItems.at(c);
+			pgit=m_doc->MasterItems.at(c);
 			if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
 				AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
 		}
-		for (int c = 0; c < doc->DocItems.count(); ++c)
+		for (int c = 0; c < m_doc->DocItems.count(); ++c)
 		{
-			pgit = doc->DocItems.at(c);
+			pgit=m_doc->DocItems.at(c);
 			if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
 				AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
 		}
 		QMap<QString,int>::const_iterator it;
-		AvailFlist->clear();
-		for (it = DocFonts.constBegin(); it != DocFonts.constEnd(); ++it)
+		availableFontsListWidget->clear();
+		for (it = m_doc->usedFonts().constBegin(); it != m_doc->usedFonts().constEnd(); ++it)
 		{
 			if (AllFonts[it.key()].isReplacement())
-				new QListWidgetItem( QIcon(loadIcon("font_subst16.png")), it.key(), AvailFlist );
+				new QListWidgetItem( QIcon(loadIcon("font_subst16.png")), it.key(), availableFontsListWidget );
 			else if (AllFonts[it.key()].type() == ScFace::TYPE1)
-				new QListWidgetItem( QIcon(loadIcon("font_type1_16.png")), it.key(), AvailFlist );
+				new QListWidgetItem( QIcon(loadIcon("font_type1_16.png")), it.key(), availableFontsListWidget );
 			else if (AllFonts[it.key()].type() == ScFace::TTF)
-				new QListWidgetItem( QIcon(loadIcon("font_truetype16.png")), it.key(), AvailFlist );
+				new QListWidgetItem( QIcon(loadIcon("font_truetype16.png")), it.key(), availableFontsListWidget );
 			else if (AllFonts[it.key()].type() == ScFace::OTF)
-				new QListWidgetItem( QIcon(loadIcon("font_otf16.png")), it.key(), AvailFlist );
+				new QListWidgetItem( QIcon(loadIcon("font_otf16.png")), it.key(), availableFontsListWidget );
 		}
-		ToEmbed->setEnabled(false);
-		FromEmbed->setEnabled(false);
-		ToOutline->setEnabled(false);
-		FromOutline->setEnabled(false);
+		toEmbedButton->setEnabled(false);
+		fromEmbedButton->setEnabled(false);
+		toOutlineButton->setEnabled(false);
+		fromOutlineButton->setEnabled(false);
 		if ((Opts.EmbedList.count() == 0) && (Opts.SubsetList.count() == 0) && (Opts.firstUse))
 			EmbedAll();
 		else
 		{
-			EmbedList->clear();
+			embeddedFontsListWidget->clear();
 			FontsToEmbed.clear();
 			for (int fe = 0; fe < Opts.EmbedList.count(); ++fe)
 			{
-				EmbedList->addItem(Opts.EmbedList[fe]);
+				embeddedFontsListWidget->addItem(Opts.EmbedList[fe]);
 				FontsToEmbed.append(Opts.EmbedList[fe]);
 			}
 			if (Opts.SubsetList.count() != 0)
 			{
-				OutlineList->clear();
+				outlinedFontsListWidget->clear();
 				FontsToOutline.clear();
 				for (int fe = 0; fe < Opts.SubsetList.count(); ++fe)
 				{
-					OutlineList->addItem(Opts.SubsetList[fe]);
+					outlinedFontsListWidget->addItem(Opts.SubsetList[fe]);
 					FontsToOutline.append(Opts.SubsetList[fe]);
 				}
 			}
@@ -237,28 +240,28 @@
 			{
 				if (FontsToEmbed.contains(itAnn.key()) == 0)
 				{
-					EmbedList->addItem(itAnn.key());
-					EmbedList->item(EmbedList->count()-1)->setFlags(Qt::ItemIsEnabled);
+					embeddedFontsListWidget->addItem(itAnn.key());
+					embeddedFontsListWidget->item(embeddedFontsListWidget->count()-1)->setFlags(Qt::ItemIsEnabled);
 					FontsToEmbed.append(itAnn.key());
 				}
 				if (FontsToOutline.contains(itAnn.key()) != 0)
 				{
 					FontsToOutline.removeAll(itAnn.key());
-					QList<QListWidgetItem *> itR = OutlineList->findItems(itAnn.key(), Qt::MatchExactly);
-					delete OutlineList->takeItem(OutlineList->row(itR.at(0)));
+					QList<QListWidgetItem *> itR = outlinedFontsListWidget->findItems(itAnn.key(), Qt::MatchExactly);
+					delete outlinedFontsListWidget->takeItem(outlinedFontsListWidget->row(itR.at(0)));
 				}
 			}
 		}
-		CheckBox10->setChecked(Opts.PresentMode);
-		PagePrev->setChecked(false);
-		Pages->clear();
+		enabledEffectsCheckBox->setChecked(Opts.PresentMode);
+		showPagePreviewsCheckBox->setChecked(false);
+		effectsPageListWidget->clear();
 		QString tmp;
 		struct PDFPresentationData ef;
 		if (EffVal.count() != 0)
 		{
-			for (int pg2 = 0; pg2 < doc->Pages->count(); ++pg2)
+			for (int pg2 = 0; pg2 < m_doc->Pages->count(); ++pg2)
 			{
-				Pages->addItem( tr("Page")+" "+tmp.setNum(pg2+1));
+				effectsPageListWidget->addItem( tr("Page")+" "+tmp.setNum(pg2+1));
 				if (EffVal.count()-1 < pg2)
 				{
 					ef.pageEffectDuration = 1;
@@ -273,9 +276,9 @@
 		}
 		else
 		{
-			for (int pg = 0; pg < doc->Pages->count(); ++pg)
+			for (int pg = 0; pg < m_doc->Pages->count(); ++pg)
 			{
-				Pages->addItem( tr("Page")+" "+tmp.setNum(pg+1));
+				effectsPageListWidget->addItem( tr("Page")+" "+tmp.setNum(pg+1));
 				ef.pageEffectDuration = 1;
 				ef.pageViewDuration = 1;
 				ef.effectType = 0;
@@ -285,41 +288,41 @@
 				EffVal.append(ef);
 			}
 		}
-		PageTime->setValue(EffVal[0].pageViewDuration);
-		EffectTime->setValue(EffVal[0].pageEffectDuration);
+		displayDurationSpinBox->setValue(EffVal[0].pageViewDuration);
+		effectDurationSpinBox->setValue(EffVal[0].pageEffectDuration);
 		bool df = true;
 		if ((Opts.displayBookmarks) || (Opts.displayFullscreen) || (Opts.displayLayers) || (Opts.displayThumbs))
 			df = false;
 		if (df)
-			useViewDefault->setChecked(df);
-		useFullScreen->setChecked(Opts.displayFullscreen);
-		useBookmarks->setChecked(Opts.displayBookmarks);
-		useThumbnails->setChecked(Opts.displayThumbs);
-		useLayers2->setChecked(Opts.displayLayers);
-		hideToolBar->setChecked(Opts.hideToolBar);
-		hideMenuBar->setChecked(Opts.hideMenuBar);
-		fitWindow->setChecked(Opts.fitWindow);
+			useViewerDefaultsRadioButton->setChecked(df);
+		useFullScreenRadioButton->setChecked(Opts.displayFullscreen);
+		useBookmarksRadioButton->setChecked(Opts.displayBookmarks);
+		useThumbnailsRadioButton->setChecked(Opts.displayThumbs);
+		useLayersRadioButton->setChecked(Opts.displayLayers);
+		hideViewerToolBarCheckBox->setChecked(Opts.hideToolBar);
+		hideViewerMenuBarCheckBox->setChecked(Opts.hideMenuBar);
+		fitViewerWindowCheckBox->setChecked(Opts.fitWindow);
 		QMap<QString,QString>::Iterator itja;
-		actionCombo->clear();
-		actionCombo->addItem( tr("No Script"));
-		for (itja = doc->JavaScripts.begin(); itja != doc->JavaScripts.end(); ++itja)
-			actionCombo->addItem(itja.key());
-		if (doc->JavaScripts.contains(Opts.openAction))
-			setCurrentComboItem(actionCombo, Opts.openAction);
+		startupJavascriptComboBox->clear();
+		startupJavascriptComboBox->addItem( tr("No Script"));
+		for (itja = m_doc->JavaScripts.begin(); itja != m_doc->JavaScripts.end(); ++itja)
+			startupJavascriptComboBox->addItem(itja.key());
+		if (m_doc->JavaScripts.contains(Opts.openAction))
+			setCurrentComboItem(startupJavascriptComboBox, Opts.openAction);
 		if (Opts.PageLayout == PDFOptions::SinglePage)
-			singlePage->setChecked(true);
+			singlePageRadioButton->setChecked(true);
 		else if (Opts.PageLayout == PDFOptions::OneColumn)
-			continuousPages->setChecked(true);
+			continuousPagesRadioButton->setChecked(true);
 		else if (Opts.PageLayout == PDFOptions::TwoColumnLeft)
-			doublePageLeft->setChecked(true);
+			doublePageLeftRadioButton->setChecked(true);
 		else if (Opts.PageLayout == PDFOptions::TwoColumnRight)
-			doublePageRight->setChecked(true);
+			doublePageRightRadioButton->setChecked(true);
 		if ((Opts.Version == PDFOptions::PDFVersion_15) || (Opts.Version == PDFOptions::PDFVersion_X4))
-			useLayers2->setEnabled(true);
+			useLayersRadioButton->setEnabled(true);
 		else
-			useLayers2->setEnabled(false);
+			useLayersRadioButton->setEnabled(false);
 	}
-	*/
+
 	useEncryptionCheckBox->setChecked( prefsData->pdfPrefs.Encrypt );
 	passwordOwnerLineEdit->setText(prefsData->pdfPrefs.PassOwner);
 	passwordUserLineEdit->setText(prefsData->pdfPrefs.PassUser);
@@ -371,9 +374,9 @@
 	QString tp(prefsData->pdfPrefs.SolidProf);
 	if (!ScCore->InputProfiles.contains(tp))
 	{
-/*		if (m_doc != 0 && exporting)
-			tp = m_doc->CMSSettings.DefaultSolidColorRGBProfile;
-		else*/
+		if (m_doc != 0 && exportingPDF)
+			tp = m_doc->cmsSettings().DefaultSolidColorRGBProfile;
+		else
 			tp = defaultSolidColorRGBProfile;
 	}
 	ProfilesL::Iterator itp;
@@ -393,9 +396,9 @@
 	QString tp1 = Opts.ImageProf;
 	if (!ScCore->InputProfiles.contains(tp1))
 	{
-/*		if (m_doc != 0 && exporting)
-			tp1 = m_doc->CMSSettings.DefaultSolidColorRGBProfile;
-		else*/
+		if (m_doc != 0 && exportingPDF)
+			tp1 = m_doc->cmsSettings().DefaultSolidColorRGBProfile;
+		else
 			tp1 = defaultSolidColorRGBProfile;
 	}
 	ProfilesL::Iterator itp2;
@@ -423,9 +426,9 @@
 	QString tp3(Opts.PrintProf);
 	if (!PDFXProfiles.contains(tp3))
 	{
-/*		if (m_doc != 0 && exporting)
-			tp3 = m_doc->CMSSettings.DefaultPrinterProfile;
-		else*/
+		if (m_doc != 0 && exportingPDF)
+			tp3 = m_doc->cmsSettings().DefaultPrinterProfile;
+		else
 			tp3 = defaultPrinterProfile;
 	}
 	pdfx3OutputProfileComboBox->clear();
@@ -438,13 +441,13 @@
 	pdfx3InfoStringLineEdit->setText(Opts.Info);
 
 
-	/*
-	if (m_doc != 0 && exporting)
+
+	if (m_doc != 0 && exportingPDF)
 	{
-		docBleeds->setChecked(Opts.useDocBleeds);
+		useDocumentBleedsCheckBox->setChecked(Opts.useDocBleeds);
 		doDocBleeds();
 	}
-	*/
+
 	registrationMarkOffsetSpinBox->setValue(prefsData->pdfPrefs.markOffset*unitRatio);
 	printCropMarksCheckBox->setChecked(prefsData->pdfPrefs.cropMarks);
 	printBleedMarksCheckBox->setChecked(prefsData->pdfPrefs.bleedMarks);
@@ -461,52 +464,49 @@
 		enablePDFX(5);
 	else
 		enablePDFXWidgets(false);
-	/*
-	if (mdoc != 0  && exporting)
+
+	if (m_doc != 0  && exportingPDF)
 	{
-		EffectType->clear();
-		EffectType->addItem( tr("No Effect"));
-		EffectType->addItem( tr("Blinds"));
-		EffectType->addItem( tr("Box"));
-		EffectType->addItem( tr("Dissolve"));
-		EffectType->addItem( tr("Glitter"));
-		EffectType->addItem( tr("Split"));
-		EffectType->addItem( tr("Wipe"));
+		effectTypeComboBox->clear();
+		effectTypeComboBox->addItem( tr("No Effect"));
+		effectTypeComboBox->addItem( tr("Blinds"));
+		effectTypeComboBox->addItem( tr("Box"));
+		effectTypeComboBox->addItem( tr("Dissolve"));
+		effectTypeComboBox->addItem( tr("Glitter"));
+		effectTypeComboBox->addItem( tr("Split"));
+		effectTypeComboBox->addItem( tr("Wipe"));
 		if (Opts.Version == PDFOptions::PDFVersion_15)
 		{
-			EffectType->addItem( tr("Push"));
-			EffectType->addItem( tr("Cover"));
-			EffectType->addItem( tr("Uncover"));
-			EffectType->addItem( tr("Fade"));
+			effectTypeComboBox->addItem( tr("Push"));
+			effectTypeComboBox->addItem( tr("Cover"));
+			effectTypeComboBox->addItem( tr("Uncover"));
+			effectTypeComboBox->addItem( tr("Fade"));
 		}
 		PgSel = 0;
-		Pages->setCurrentRow(0);
+		effectsPageListWidget->setCurrentRow(0);
 		SetEffOpts(0);
-		Pages->setEnabled(false);
-		Effects->setEnabled(false);
-		PagePrev->setEnabled(false);
+		effectsPageListWidget->setEnabled(false);
+		enableEffects(false);
+		showPagePreviewsCheckBox->setEnabled(false);
 		DoEffects();
-		if (CheckBox10->isChecked())
+		if (enabledEffectsCheckBox->isChecked())
 		{
-			PageTime->setValue(EffVal[0].pageViewDuration);
-			EffectTime->setValue(EffVal[0].pageEffectDuration);
-			EffectType->setCurrentIndex(EffVal[0].effectType);
-			EDirection->setCurrentIndex(EffVal[0].Dm);
-			EDirection_2->setCurrentIndex(EffVal[0].M);
-			EDirection_2_2->setCurrentIndex(EffVal[0].Di);
-			SetEffOpts(EffectType->currentIndex());
+			displayDurationSpinBox->setValue(EffVal[0].pageViewDuration);
+			effectDurationSpinBox->setValue(EffVal[0].pageEffectDuration);
+			effectTypeComboBox->setCurrentIndex(EffVal[0].effectType);
+			effectMovingDirectionComboBox->setCurrentIndex(EffVal[0].Dm);
+			effectInOutComboBox->setCurrentIndex(EffVal[0].M);
+			effectDirectionComboBox->setCurrentIndex(EffVal[0].Di);
+			SetEffOpts(effectTypeComboBox->currentIndex());
 		}
-		if (mdoc->currentPageLayout != 0)
+		/* Using margin widget, is this necessary?
+		if (m_doc->currentPageLayout != 0)
 		{
 			BleedTxt3->setText( tr( "Inside:" ) );
 			BleedTxt4->setText( tr( "Outside:" ) );
 		}
-
+		*/
 	}
-	*/
-	//
-
-
 }
 
 
@@ -535,7 +535,7 @@
 	prefsData->pdfPrefs.colorMarks = printColorBarsCheckBox->isChecked();
 	prefsData->pdfPrefs.docInfoMarks = printPageInfoCheckBox->isChecked();
 	prefsData->pdfPrefs.markOffset = registrationMarkOffsetSpinBox->value() / unitRatio;
-	//TODO for export: prefsData->pdfPrefs.useDocBleeds = docBleeds->isChecked();
+	prefsData->pdfPrefs.useDocBleeds = useDocumentBleedsCheckBox->isChecked();
 	prefsData->pdfPrefs.bleeds=bleedsWidget->margins();
 	prefsData->pdfPrefs.doClip = clipToPrinterMarginsCheckBox->isChecked();
 	if (useEncryptionCheckBox->isChecked())
@@ -628,6 +628,16 @@
 	enableProfiles(1);
 }
 
+void Prefs_PDFExport::enablePDFExportTabs(bool enabled)
+{
+	if (!enabled)
+	{
+		tabWidget->removeTab(tabWidget->indexOf(tabFonts));//Fonts
+		tabWidget->removeTab(tabWidget->indexOf(tabExtras));//Extras
+		tabWidget->removeTab(tabWidget->indexOf(tabViewer));//Viewer
+	}
+}
+
 void Prefs_PDFExport::createPageNumberRange()
 {
 	if (m_doc!=0)
@@ -810,48 +820,47 @@
 void Prefs_PDFExport::enablePDFX(int i)
 {
 	includeLayersCheckBox->setEnabled((i == 2) || (i == 5));
-	/*
-	if (useLayers2)
-		useLayers2->setEnabled((i == 2) || (i == 5));
-	if (doc != 0 && pdfExport)
+	if (useLayersRadioButton)
+		useLayersRadioButton->setEnabled((i == 2) || (i == 5));
+	if (m_doc != 0 && exportingPDF)
 	{
-		int currentEff = EffectType->currentIndex();
-		disconnect(EffectType, SIGNAL(activated(int)), this, SLOT(SetEffOpts(int)));
-		EffectType->clear();
-		EffectType->addItem( tr("No Effect"));
-		EffectType->addItem( tr("Blinds"));
-		EffectType->addItem( tr("Box"));
-		EffectType->addItem( tr("Dissolve"));
-		EffectType->addItem( tr("Glitter"));
-		EffectType->addItem( tr("Split"));
-		EffectType->addItem( tr("Wipe"));
+		int currentEff = effectTypeComboBox->currentIndex();
+		disconnect(effectTypeComboBox, SIGNAL(activated(int)), this, SLOT(SetEffOpts(int)));
+		effectTypeComboBox->clear();
+		effectTypeComboBox->addItem( tr("No Effect"));
+		effectTypeComboBox->addItem( tr("Blinds"));
+		effectTypeComboBox->addItem( tr("Box"));
+		effectTypeComboBox->addItem( tr("Dissolve"));
+		effectTypeComboBox->addItem( tr("Glitter"));
+		effectTypeComboBox->addItem( tr("Split"));
+		effectTypeComboBox->addItem( tr("Wipe"));
 		if (i == 2)
 		{
-			EffectType->addItem( tr("Push"));
-			EffectType->addItem( tr("Cover"));
-			EffectType->addItem( tr("Uncover"));
-			EffectType->addItem( tr("Fade"));
-			EffectType->setCurrentIndex(currentEff);
+			effectTypeComboBox->addItem( tr("Push"));
+			effectTypeComboBox->addItem( tr("Cover"));
+			effectTypeComboBox->addItem( tr("Uncover"));
+			effectTypeComboBox->addItem( tr("Fade"));
+			effectTypeComboBox->setCurrentIndex(currentEff);
 		}
 		else
 		{
 			if (currentEff > 6)
 			{
 				currentEff = 0;
-				EffectType->setCurrentIndex(0);
+				effectTypeComboBox->setCurrentIndex(0);
 				SetEffOpts(0);
-				for (int pg = 0; pg < doc->Pages->count(); ++pg)
+				for (int pg = 0; pg<m_doc->Pages->count(); ++pg)
 				{
 					if (EffVal[pg].effectType > 6)
 						EffVal[pg].effectType = 0;
 				}
 			}
 			else
-				EffectType->setCurrentIndex(currentEff);
+				effectTypeComboBox->setCurrentIndex(currentEff);
 		}
-		connect(EffectType, SIGNAL(activated(int)), this, SLOT(SetEffOpts(int)));
+		connect(effectTypeComboBox, SIGNAL(activated(int)), this, SLOT(SetEffOpts(int)));
 	}
-	*/
+
 	if (i < 3)  // not PDF/X
 	{
 		enablePDFXWidgets(false);
@@ -859,16 +868,15 @@
 		outputIntentionComboBox->setEnabled(true);
 		useImageProfileCheckBox->setEnabled(true);
 		emit hasInfo();
-		/*
-		if (m_doc != 0 && pdfExport)
+		if (m_doc != 0 && exportingPDF)
 		{
-			CheckBox10->setEnabled(true);
-			EmbedFonts->setEnabled(true);
-			if (EmbedList->count() != 0)
-				FromEmbed->setEnabled(true);
-			ToEmbed->setEnabled(true);
+			enabledEffectsCheckBox->setEnabled(true);
+			embedAllButton->setEnabled(true);
+			if (embeddedFontsListWidget->count() != 0)
+				fromEmbedButton->setEnabled(true);
+			toEmbedButton->setEnabled(true);
 		}
-		*/
+
 		return;
 	}
 	// PDF/X is selected
@@ -881,22 +889,20 @@
 		useImageProfileCheckBox->setChecked(true);
 		useImageProfileCheckBox->setEnabled(false);
 	}
-	/*
-	if (m_doc != 0 && pdfExport)
+	if (m_doc != 0 && exportingPDF)
 	{
 //		EmbedFonts->setChecked(true);
 		EmbedAll();
-		CheckBox10->setChecked(false);
-		CheckBox10->setEnabled(false);
+		enabledEffectsCheckBox->setChecked(false);
+		enabledEffectsCheckBox->setEnabled(false);
 //		EmbedFonts->setEnabled(false);
-		FromEmbed->setEnabled(false);
-		ToEmbed->setEnabled(false);
-		if (InfoString->text().isEmpty())
+		fromEmbedButton->setEnabled(false);
+		toEmbedButton->setEnabled(false);
+		if (pdfx3InfoStringLineEdit->text().isEmpty())
 			emit noInfo();
 		else
 			emit hasInfo();
 	}
-	*/
 	enablePGI();
 	pdfx3OutputProfileComboBox->setEnabled(true);
 	pdfx3InfoStringLineEdit->setEnabled(true);
@@ -923,3 +929,22 @@
 	pdfVersionComboBox->setCurrentIndex(i);
 	connect(pdfVersionComboBox, SIGNAL(activated(int)), this, SLOT(enablePDFX(int)));
 }
+
+
+void Prefs_PDFExport::enableEffects(bool enabled)
+{
+	effectsPageListWidget->setEnabled(enabled);
+	showPagePreviewsCheckBox->setEnabled(enabled);
+	displayDurationSpinBox->setEnabled(enabled);
+	effectDurationSpinBox->setEnabled(enabled);
+	effectTypeComboBox->setEnabled(enabled);
+	if (enabled)
+		SetEffOpts(effectTypeComboBox->currentIndex());
+	else
+	{
+		effectMovingDirectionComboBox->setEnabled(false);
+		effectInOutComboBox->setEnabled(false);
+		effectDirectionComboBox->setEnabled(false);
+		applyEffectToAllPagesPushButton->setEnabled(false);
+	}
+}
Index: scribus/ui/prefs_pdfexport.h
===================================================================
--- scribus/ui/prefs_pdfexport.h	(revision 15064)
+++ scribus/ui/prefs_pdfexport.h	(revision 15065)
@@ -10,6 +10,7 @@
 
 #include "ui_prefs_pdfexportbase.h"
 #include "prefs_pane.h"
+#include "scfonts.h"
 #include "scribusapi.h"
 
 #include "pdfoptions.h"
@@ -23,8 +24,8 @@
 		Prefs_PDFExport(QWidget* parent, ScribusDoc* doc=NULL);
 		~Prefs_PDFExport();
 		virtual void restoreDefaults(struct ApplicationPrefs *prefsData);
-		virtual void restoreDefaults(struct ApplicationPrefs *prefsData, ScribusDoc* doc, const ProfilesL & PDFXProfiles,
-									 const QMap<QString, int> & DocFonts);
+		virtual void restoreDefaults(struct ApplicationPrefs *prefsData, const ProfilesL & PDFXProfiles,
+									 bool exporting=false);
 		virtual void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const;
 		void enableCMS(bool);
 
@@ -39,6 +40,7 @@
 	protected slots:
 		void enableRangeControls(bool);
 		void enableSecurityControls(bool);
+		void enablePDFExportTabs(bool);
 		void createPageNumberRange();
 		void setMaximumResolution();
 		void enableProfiles(int);
@@ -48,6 +50,12 @@
 		void enablePGI2();
 		void enablePDFX(int);
 
+		void EmbedAll();
+		void OutlineAll();
+		void doDocBleeds();
+		void DoEffects();
+		void SetEffOpts(int nr);
+
 	protected:
 		void setCustomRenderingWidgetsShown(bool);
 		void setSolidsImagesWidgetsShown(bool);
@@ -55,12 +63,21 @@
 		void enableSolidsImagesWidgets(bool);
 		void enablePDFXWidgets(bool);
 		void addPDFVersions(bool);
+		void enableEffects(bool);
 		bool cmsEnabled;
 		double unitRatio;
 		ScribusDoc* m_doc;
 		QString defaultSolidColorRGBProfile;
 		QString defaultPrinterProfile;
 		PDFOptions Opts;
+		QMap<QString, QString> AnnotationFonts;
+
+		QList<PDFPresentationData> EffVal;
+		QList<QString> FontsToEmbed;
+		QList<QString> FontsToOutline;
+		int PgSel;
+		SCFonts AllFonts;
+		bool exportingPDF;
 };
 
 #endif // PREFS_PDFEXPORT_H
Index: scribus/ui/prefs_pdfexportbase.ui
===================================================================
--- scribus/ui/prefs_pdfexportbase.ui	(revision 15064)
+++ scribus/ui/prefs_pdfexportbase.ui	(revision 15065)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>671</width>
-    <height>568</height>
+    <height>585</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -31,7 +31,7 @@
    <item>
     <widget class="QTabWidget" name="tabWidget">
      <property name="currentIndex">
-      <number>1</number>
+      <number>0</number>
      </property>
      <widget class="QWidget" name="tabPages">
       <attribute name="title">
@@ -667,9 +667,9 @@
           <property name="geometry">
            <rect>
             <x>0</x>
-            <y>-201</y>
-            <width>601</width>
-            <height>641</height>
+            <y>0</y>
+            <width>602</width>
+            <height>638</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_8">
@@ -1114,6 +1114,13 @@
         </layout>
        </item>
        <item>
+        <widget class="QCheckBox" name="useDocumentBleedsCheckBox">
+         <property name="text">
+          <string>Use Document Bleeds</string>
+         </property>
+        </widget>
+       </item>
+       <item>
         <spacer name="bleedSettingsVerticalSpacer">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
@@ -1191,6 +1198,540 @@
        </item>
       </layout>
      </widget>
+     <widget class="QWidget" name="tabFonts">
+      <attribute name="title">
+       <string>Fonts</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_12">
+       <item>
+        <widget class="QLabel" name="label_20">
+         <property name="font">
+          <font>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="text">
+          <string>Export Range</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="Line" name="line_10">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_8">
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_11">
+           <item>
+            <widget class="QLabel" name="availableListLabel">
+             <property name="text">
+              <string>Available Fonts</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QListWidget" name="availableFontsListWidget"/>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_10">
+           <item>
+            <widget class="QPushButton" name="embedAllButton">
+             <property name="text">
+              <string>Embed All</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QPushButton" name="outlineAllButton">
+             <property name="text">
+              <string>Outline All</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QPushButton" name="toEmbedButton">
+             <property name="text">
+              <string/>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QPushButton" name="fromEmbedButton">
+             <property name="text">
+              <string/>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="verticalSpacer_14">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>20</width>
+               <height>40</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_9">
+           <item>
+            <widget class="QLabel" name="embedListLabel">
+             <property name="text">
+              <string>Fonts to Embed</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QListWidget" name="embeddedFontsListWidget"/>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_7">
+             <item>
+              <spacer name="horizontalSpacer_7">
+               <property name="orientation">
+                <enum>Qt::Horizontal</enum>
+               </property>
+               <property name="sizeHint" stdset="0">
+                <size>
+                 <width>40</width>
+                 <height>20</height>
+                </size>
+               </property>
+              </spacer>
+             </item>
+             <item>
+              <widget class="QPushButton" name="fromOutlineButton">
+               <property name="font">
+                <font>
+                 <stylestrategy>PreferDefault</stylestrategy>
+                </font>
+               </property>
+               <property name="text">
+                <string/>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="toOutlineButton">
+               <property name="text">
+                <string/>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <spacer name="horizontalSpacer_8">
+               <property name="orientation">
+                <enum>Qt::Horizontal</enum>
+               </property>
+               <property name="sizeHint" stdset="0">
+                <size>
+                 <width>40</width>
+                 <height>20</height>
+                </size>
+               </property>
+              </spacer>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <widget class="QLabel" name="outlineListLabel">
+             <property name="text">
+              <string>Fonts to Outline</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QListWidget" name="outlinedFontsListWidget"/>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tabExtras">
+      <attribute name="title">
+       <string>Extras</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_17">
+       <item>
+        <widget class="QCheckBox" name="enabledEffectsCheckBox">
+         <property name="text">
+          <string>Enable Presentation Effects</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_10">
+         <item>
+          <widget class="QListWidget" name="effectsPageListWidget"/>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_16">
+           <item>
+            <layout class="QFormLayout" name="formLayout_11">
+             <property name="fieldGrowthPolicy">
+              <enum>QFormLayout::FieldsStayAtSizeHint</enum>
+             </property>
+             <item row="0" column="0">
+              <widget class="QLabel" name="label_37">
+               <property name="text">
+                <string>Display Duration:</string>
+               </property>
+              </widget>
+             </item>
+             <item row="1" column="0">
+              <widget class="QLabel" name="label_38">
+               <property name="text">
+                <string>Effect Duration:</string>
+               </property>
+              </widget>
+             </item>
+             <item row="2" column="0">
+              <widget class="QLabel" name="label_39">
+               <property name="text">
+                <string>Effect Type:</string>
+               </property>
+              </widget>
+             </item>
+             <item row="2" column="1">
+              <widget class="QComboBox" name="effectTypeComboBox"/>
+             </item>
+             <item row="3" column="0">
+              <widget class="QLabel" name="label_40">
+               <property name="text">
+                <string>Moving Lines:</string>
+               </property>
+              </widget>
+             </item>
+             <item row="3" column="1">
+              <widget class="QComboBox" name="effectMovingDirectionComboBox"/>
+             </item>
+             <item row="4" column="0">
+              <widget class="QLabel" name="label_41">
+               <property name="text">
+                <string>From the:</string>
+               </property>
+              </widget>
+             </item>
+             <item row="4" column="1">
+              <widget class="QComboBox" name="effectInOutComboBox"/>
+             </item>
+             <item row="5" column="0">
+              <widget class="QLabel" name="label_42">
+               <property name="text">
+                <string>Direction:</string>
+               </property>
+              </widget>
+             </item>
+             <item row="5" column="1">
+              <widget class="QComboBox" name="effectDirectionComboBox"/>
+             </item>
+             <item row="0" column="1">
+              <widget class="QSpinBox" name="displayDurationSpinBox">
+               <property name="suffix">
+                <string> s</string>
+               </property>
+               <property name="maximum">
+                <number>3600</number>
+               </property>
+              </widget>
+             </item>
+             <item row="1" column="1">
+              <widget class="QSpinBox" name="effectDurationSpinBox">
+               <property name="suffix">
+                <string> s</string>
+               </property>
+               <property name="minimum">
+                <number>1</number>
+               </property>
+               <property name="maximum">
+                <number>3600</number>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <widget class="QPushButton" name="applyEffectToAllPagesPushButton">
+             <property name="text">
+              <string>Apply Effect to All Pages</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="verticalSpacer_19">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>20</width>
+               <height>0</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="showPagePreviewsCheckBox">
+         <property name="text">
+          <string>Show Page Previews</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tabViewer">
+      <attribute name="title">
+       <string>Viewer</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_15">
+       <item>
+        <widget class="QLabel" name="label_21">
+         <property name="font">
+          <font>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="text">
+          <string>Document Layout</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="Line" name="line_11">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QRadioButton" name="singlePageRadioButton">
+         <property name="text">
+          <string>Single Page</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QRadioButton" name="continuousPagesRadioButton">
+         <property name="text">
+          <string>Continuous</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QRadioButton" name="doublePageLeftRadioButton">
+         <property name="text">
+          <string>Double Page Left</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QRadioButton" name="doublePageRightRadioButton">
+         <property name="text">
+          <string>Double Page Right</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_15">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_34">
+         <property name="font">
+          <font>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="text">
+          <string>Visual Appearance</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="Line" name="line_12">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_9">
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_14">
+           <item>
+            <widget class="QRadioButton" name="useViewerDefaultsRadioButton">
+             <property name="text">
+              <string>Use Viewer's Default</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QRadioButton" name="useFullScreenRadioButton">
+             <property name="text">
+              <string>Use Full Screen Mode</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QRadioButton" name="useBookmarksRadioButton">
+             <property name="text">
+              <string>Display Bookmarks Tab</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QRadioButton" name="useThumbnailsRadioButton">
+             <property name="text">
+              <string>Display Thumbnails</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QRadioButton" name="useLayersRadioButton">
+             <property name="text">
+              <string>Display Layers Tab</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_13">
+           <item>
+            <widget class="QCheckBox" name="hideViewerMenuBarCheckBox">
+             <property name="text">
+              <string>Hide Viewer's Menu Bar</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QCheckBox" name="hideViewerToolBarCheckBox">
+             <property name="text">
+              <string>Hide Viewer's Tool Bar</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QCheckBox" name="fitViewerWindowCheckBox">
+             <property name="text">
+              <string>Zoom Pages to fit Viewer Window</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="verticalSpacer_18">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>0</width>
+               <height>0</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_16">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_35">
+         <property name="font">
+          <font>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="text">
+          <string>Special Actions</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="Line" name="line_13">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QFormLayout" name="formLayout_10">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_36">
+           <property name="text">
+            <string>Javascript to be executed when PDF document is opened:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QComboBox" name="startupJavascriptComboBox"/>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_17">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>60</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
     </widget>
    </item>
   </layout>
Index: scribus/ui/preferencesdialog.cpp
===================================================================
--- scribus/ui/preferencesdialog.cpp	(revision 15064)
+++ scribus/ui/preferencesdialog.cpp	(revision 15065)
@@ -181,8 +181,7 @@
 	prefs_Hyphenator->restoreDefaults(&localPrefs);
 	prefs_Fonts->restoreDefaults(&localPrefs);
 	prefs_Printer->restoreDefaults(&localPrefs);
-	QMap<QString, int> DocFonts;
-	prefs_PDFExport->restoreDefaults(&localPrefs, NULL, ScCore->PDFXProfiles, DocFonts);
+	prefs_PDFExport->restoreDefaults(&localPrefs, ScCore->PDFXProfiles);
 	prefs_PreflightVerifier->restoreDefaults(&localPrefs);
 	prefs_DocumentItemAttributes->restoreDefaults(&localPrefs);
 	prefs_TableOfContents->restoreDefaults(&localPrefs);




More information about the scribus-commit mailing list