r15105 by cbradney - #1990: Allow user selection of page sizes via new Preferences pane, Page Sizes

scribus-commit scribus-commit at lists.scribus.net
Tue May 25 02:10:55 CEST 2010


Revision: 15105
Author: cbradney
Date: 2010-05-25T00:02:01.388584Z
Commit message: #1990: Allow user selection of page sizes via new Preferences pane, Page Sizes

Changeset: 
A  /trunk/Scribus/scribus/ui/prefs_pagesizesbase.ui
M  /trunk/Scribus/scribus/CMakeLists.txt
M  /trunk/Scribus/scribus/ui/prefs_preflightverifier.cpp
M  /trunk/Scribus/scribus/ui/preferencesdialog.cpp
M  /trunk/Scribus/scribus/ui/prefs_documentsetupbase.ui
M  /trunk/Scribus/scribus/ui/inspage.cpp
M  /trunk/Scribus/scribus/ui/preferencesdialog.h
M  /trunk/Scribus/scribus/ui/newfile.cpp
A  /trunk/Scribus/scribus/ui/prefs_pagesizes.cpp
M  /trunk/Scribus/scribus/pagesize.cpp
M  /trunk/Scribus/scribus/prefsmanager.cpp
M  /trunk/Scribus/scribus/ui/margindialog.cpp
M  /trunk/Scribus/scribus/ui/prefs_documentsetup.cpp
A  /trunk/Scribus/scribus/ui/prefs_pagesizes.h
M  /trunk/Scribus/scribus/pagesize.h
M  /trunk/Scribus/scribus/prefsstructs.h
M  /trunk/Scribus/scribus/ui/prefs_pdfexportbase.ui
M  /trunk/Scribus/scribus/ui/prefs_documentsetup.h

Diffs:
Index: scribus/prefsmanager.cpp
===================================================================
--- scribus/prefsmanager.cpp	(revision 15104)
+++ scribus/prefsmanager.cpp	(revision 15105)
@@ -501,6 +501,8 @@
 	appPrefs.imageCachePrefs.maxCacheSizeMiB = 1000;
 	appPrefs.imageCachePrefs.maxCacheEntries = 1000;
 	appPrefs.imageCachePrefs.compressionLevel = 1;
+	appPrefs.activePageSizes.clear();
+	appPrefs.activePageSizes << "A4" << "Letter";
 
 	//Attribute setup
 	appPrefs.itemAttrPrefs.defaultItemAttributes.clear();
@@ -1750,6 +1752,11 @@
 	icElem.setAttribute("maxCacheEntries", appPrefs.imageCachePrefs.maxCacheEntries);
 	icElem.setAttribute("compressionLevel", appPrefs.imageCachePrefs.compressionLevel);
 	elem.appendChild(icElem);
+	// active page sizes
+	QDomElement apsElem = docu.createElement("ActivePageSizes");
+	apsElem.setAttribute("names", appPrefs.activePageSizes.join(","));
+	elem.appendChild(apsElem);
+
 	// write file
 	bool result = false;
 	QFile f(ho);
@@ -2492,6 +2499,13 @@
 			appPrefs.imageCachePrefs.maxCacheEntries = dc.attribute("maxCacheEntries", "1000").toInt();
 			appPrefs.imageCachePrefs.compressionLevel = dc.attribute("compressionLevel", "1").toInt();
 		}
+		// active page sizes
+		if (dc.tagName() == "ActivePageSizes")
+		{
+			appPrefs.activePageSizes = QString(dc.attribute("names", "")).split(",");
+		}
+
+		//
 		DOC=DOC.nextSibling();
 	}
 	// Some sanity checks
Index: scribus/pagesize.cpp
===================================================================
--- scribus/pagesize.cpp	(revision 15104)
+++ scribus/pagesize.cpp	(revision 15105)
@@ -20,7 +20,7 @@
  ***************************************************************************/
 
 #include "pagesize.h"
- 
+#include "prefsmanager.h"
 
 #include <QStringList>
 
@@ -100,7 +100,57 @@
 	return QStringList(pageSizes);
 }
 
+QStringList PageSize::activeSizeList(void) const
+{
+	QStringList pageSizes=sizeList();
+	if (PrefsManager::instance()->appPrefs.activePageSizes.count()==0)
+		return QStringList(pageSizes);
+	QStringList activePageSizes(PrefsManager::instance()->appPrefs.activePageSizes);
+	QStringList activeSizes;
+	for (int i = 0; i < activePageSizes.size(); ++i)
+	{
+		if (pageSizes.contains(activePageSizes.at(i)))
+			activeSizes << activePageSizes.at(i);
+	}
+	return QStringList(activeSizes);
+}
 
+QStringList PageSize::activeSizeTRList(void) const
+{
+	QStringList pageTRSizes=sizeTRList();
+	QStringList pageSizes=sizeList();
+	if (PrefsManager::instance()->appPrefs.activePageSizes.count()==0)
+		return QStringList(pageTRSizes);
+	QStringList activePageSizes(PrefsManager::instance()->appPrefs.activePageSizes);
+	QStringList activeTRSizes;
+	for (int i = 0; i < activePageSizes.size(); ++i)
+	{
+		int j=pageSizes.indexOf(activePageSizes.at(i));
+		if (j!=-1)
+		{
+			activeTRSizes << pageTRSizes.at(j);
+		}
+	}
+	return QStringList(activeTRSizes);
+}
+
+QStringList PageSize::untransPageSizeList(const QStringList &transList)
+{
+	QStringList pageTRSizes=sizeTRList();
+	QStringList pageSizes=sizeList();
+	QStringList untranslatedList;
+	for (int i = 0; i < transList.size(); ++i)
+	{
+		int j=pageTRSizes.indexOf(transList.at(i));
+		if (j!=-1)
+		{
+			untranslatedList << pageSizes.at(j);
+		}
+	}
+	return QStringList(untranslatedList);
+}
+
+
 void PageSize::generateSizeList()
 {
 	/*
Index: scribus/prefsstructs.h
===================================================================
--- scribus/prefsstructs.h	(revision 15104)
+++ scribus/prefsstructs.h	(revision 15105)
@@ -409,6 +409,7 @@
 	QList<ArrowDesc> arrowStyles;
 	QMap<QString, VGradient> defaultGradients;
 	QList<PageSet> pageSets;
+	QStringList activePageSizes;
 
 
 
Index: scribus/ui/prefs_pagesizes.h
===================================================================
--- scribus/ui/prefs_pagesizes.h	(revision 0)
+++ scribus/ui/prefs_pagesizes.h	(revision 15105)
@@ -0,0 +1,35 @@
+/*
+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 PREFS_PAGESIZES_H
+#define PREFS_PAGESIZES_H
+
+#include "ui_prefs_pagesizesbase.h"
+#include "prefs_pane.h"
+#include "scribusapi.h"
+
+class ScribusDoc;
+
+class SCRIBUS_API Prefs_PageSizes : public Prefs_Pane, Ui::Prefs_PageSizes
+{
+	Q_OBJECT
+
+	public:
+		Prefs_PageSizes(QWidget* parent, ScribusDoc* doc=NULL);
+		~Prefs_PageSizes();
+		virtual void restoreDefaults(struct ApplicationPrefs *prefsData);
+		virtual void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const;
+
+	public slots:
+		void languageChange();
+
+	protected slots:
+		void moveToActive();
+		void moveFromActive();
+};
+
+#endif // PREFS_PAGESIZES_H

Property changes on: scribus/ui/prefs_pagesizes.h
___________________________________________________________________
Added: svn:eol-style
   + native

Index: scribus/ui/newfile.cpp
===================================================================
--- scribus/ui/newfile.cpp	(revision 15104)
+++ scribus/ui/newfile.cpp	(revision 15105)
@@ -227,7 +227,7 @@
 	pageSizeGroupBoxLayout->addWidget( TextLabel1, 0, 1 );
 	PageSize ps(prefsManager->appPrefs.docSetupPrefs.pageSize);
 	pageSizeComboBox = new QComboBox( pageSizeGroupBox );
-	pageSizeComboBox->addItems(ps.sizeTRList());
+	pageSizeComboBox->addItems(ps.activeSizeTRList());
 	pageSizeComboBox->addItem( CommonStrings::trCustomPageSize );
 	pageSizeComboBox->setEditable(false);
 	TextLabel1->setBuddy(pageSizeComboBox);
@@ -269,7 +269,7 @@
 	marginGroup->setFacingPages(!(prefsManager->appPrefs.docSetupPrefs.pagePositioning == singlePage));
 	widthSpinBox->setValue(prefsManager->appPrefs.docSetupPrefs.pageWidth * m_unitRatio);
 	heightSpinBox->setValue(prefsManager->appPrefs.docSetupPrefs.pageHeight * m_unitRatio);
-	QStringList pageSizes=ps.sizeList();
+	QStringList pageSizes=ps.activeSizeTRList();
 	int sizeIndex=pageSizes.indexOf(ps.nameTR());
 	if (sizeIndex!=-1)
 		pageSizeComboBox->setCurrentIndex(sizeIndex);
Index: scribus/ui/prefs_documentsetup.cpp
===================================================================
--- scribus/ui/prefs_documentsetup.cpp	(revision 15104)
+++ scribus/ui/prefs_documentsetup.cpp	(revision 15105)
@@ -29,7 +29,13 @@
 		applySizesToAllMasterPagesCheckBox->hide();
 		applyMarginsToAllPagesCheckBox->hide();
 		applyMarginsToAllMasterPagesCheckBox->hide();
+		pageSizeLinkToolButton->hide(); //temp
+//		connect(pageSizeLinkToolButton, SIGNAL(clicked()), this, SLOT(emitSectionChange()));
 	}
+	else
+	{
+		pageSizeLinkToolButton->hide();
+	}
 
 	pageWidthSpinBox->setMaximum(16777215);
 	pageHeightSpinBox->setMaximum(16777215);
@@ -96,6 +102,7 @@
 	pageWidthSpinBox->setToolTip( "<qt>" + tr( "Width of document pages, editable if you have chosen a custom page size" ) + "</qt>" );
 	pageHeightSpinBox->setToolTip( "<qt>" + tr( "Height of document pages, editable if you have chosen a custom page size" ) + "</qt>" );
 	pageSizeComboBox->setToolTip( "<qt>" + tr( "Default page size, either a standard size or a custom size" ) + "</qt>" );
+	pageSizeLinkToolButton->setToolTip( "<qt>" + tr( "Enable or disable more page sizes by jumping to Page Size preferences" ) + "</qt>" );
 	pageOrientationComboBox->setToolTip( "<qt>" + tr( "Default orientation of document pages" ) + "</qt>" );
 	pageUnitsComboBox->setToolTip( "<qt>" + tr( "Default unit of measurement for document editing" ) + "</qt>" );
 	autosaveCheckBox->setToolTip( "<qt>" + tr( "When enabled, Scribus saves a backup copy of your file with the .bak extension each time the time period elapses" ) + "</qt>" );
@@ -113,14 +120,15 @@
 	pageSizeComboBox->blockSignals(true);
 
 	unitRatio = unitGetRatioFromIndex(prefsData->docSetupPrefs.docUnitIndex);
-	prefsPageSizeName = prefsData->docSetupPrefs.pageSize;
-	PageSize *ps=new PageSize(prefsPageSizeName);
-	pageSizeComboBox->addItems(ps->sizeTRList());
-	pageSizeComboBox->addItem( CommonStrings::trCustomPageSize );
-	if (prefsData->docSetupPrefs.pageSize == CommonStrings::customPageSize)
-		setCurrentComboItem(pageSizeComboBox, CommonStrings::trCustomPageSize);
-	else
-		setCurrentComboItem(pageSizeComboBox, prefsPageSizeName);
+	setupPageSizes(prefsData);
+//	prefsPageSizeName = prefsData->docSetupPrefs.pageSize;
+//	PageSize *ps=new PageSize(prefsPageSizeName);
+//	pageSizeComboBox->addItems(ps->activeSizeTRList());
+//	pageSizeComboBox->addItem( CommonStrings::trCustomPageSize );
+//	if (prefsData->docSetupPrefs.pageSize == CommonStrings::customPageSize)
+//		setCurrentComboItem(pageSizeComboBox, CommonStrings::trCustomPageSize);
+//	else
+//		setCurrentComboItem(pageSizeComboBox, prefsPageSizeName);
 
 	pageOrientationComboBox->setCurrentIndex(prefsData->docSetupPrefs.pageOrientation);
 	pageUnitsComboBox->setCurrentIndex(prefsData->docSetupPrefs.docUnitIndex);
@@ -157,12 +165,12 @@
 	marginsWidget->setup(prefsData->docSetupPrefs.margins, prefsData->docSetupPrefs.pagePositioning, prefsData->docSetupPrefs.docUnitIndex, true, true);
 	marginsWidget->setPageWidth(prefsData->docSetupPrefs.pageWidth);
 	marginsWidget->setPageHeight(prefsData->docSetupPrefs.pageHeight);
-	marginsWidget->setPageSize(prefsPageSizeName);
+//	marginsWidget->setPageSize(prefsPageSizeName);
 	marginsWidget->setMarginPreset(prefsData->docSetupPrefs.marginPreset);
 	bleedsWidget->setup(prefsData->docSetupPrefs.bleeds, prefsData->docSetupPrefs.pagePositioning, prefsData->docSetupPrefs.docUnitIndex, false, false);
 	bleedsWidget->setPageWidth(prefsData->docSetupPrefs.pageWidth);
 	bleedsWidget->setPageHeight(prefsData->docSetupPrefs.pageHeight);
-	bleedsWidget->setPageSize(prefsPageSizeName);
+//	bleedsWidget->setPageSize(prefsPageSizeName);
 	bleedsWidget->setMarginPreset(prefsData->docSetupPrefs.marginPreset);
 	saveCompressedCheckBox->setChecked(prefsData->docSetupPrefs.saveCompressed);
 	autosaveCheckBox->setChecked( prefsData->docSetupPrefs.AutoSave );
@@ -209,6 +217,21 @@
 	layoutFirstPageIsComboBox->setCurrentIndex(i<0?0:i);
 }
 
+void Prefs_DocumentSetup::setupPageSizes(struct ApplicationPrefs *prefsData)
+{
+	prefsPageSizeName = prefsData->docSetupPrefs.pageSize;
+	PageSize *ps=new PageSize(prefsPageSizeName);
+	pageSizeComboBox->clear();
+	pageSizeComboBox->addItems(ps->activeSizeTRList());
+	pageSizeComboBox->addItem( CommonStrings::trCustomPageSize );
+	if (prefsData->docSetupPrefs.pageSize == CommonStrings::customPageSize)
+		setCurrentComboItem(pageSizeComboBox, CommonStrings::trCustomPageSize);
+	else
+		setCurrentComboItem(pageSizeComboBox, prefsPageSizeName);
+	marginsWidget->setPageSize(prefsPageSizeName);
+	bleedsWidget->setPageSize(prefsPageSizeName);
+}
+
 void Prefs_DocumentSetup::pageLayoutChanged(int i)
 {
 	setupPageSets();
@@ -309,3 +332,7 @@
 	resizeMasterPageMargins=applyMarginsToAllMasterPagesCheckBox->isChecked();
 }
 
+void Prefs_DocumentSetup::emitSectionChange()
+{
+	emit changeToOtherSection("Prefs_PageSizes");
+}
Index: scribus/ui/prefs_pagesizes.cpp
===================================================================
--- scribus/ui/prefs_pagesizes.cpp	(revision 0)
+++ scribus/ui/prefs_pagesizes.cpp	(revision 15105)
@@ -0,0 +1,79 @@
+/*
+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 <QListWidget>
+#include <QStringList>
+#include "ui/prefs_pagesizes.h"
+#include "pagesize.h"
+#include "prefsmanager.h"
+#include "prefsstructs.h"
+#include "scribusdoc.h"
+#include "util_icon.h"
+
+Prefs_PageSizes::Prefs_PageSizes(QWidget* parent, ScribusDoc* doc)
+	: Prefs_Pane(parent)
+{
+	setupUi(this);
+	languageChange();
+	toActiveButton->setIcon(QIcon(loadIcon("22/go-next.png")));
+	fromActiveButton->setIcon(QIcon(loadIcon("22/go-previous.png")));
+	connect(toActiveButton, SIGNAL(clicked()), this, SLOT(moveToActive()));
+	connect(fromActiveButton, SIGNAL(clicked()), this, SLOT(moveFromActive()));
+}
+
+Prefs_PageSizes::~Prefs_PageSizes()
+{
+}
+
+void Prefs_PageSizes::languageChange()
+{
+}
+
+void Prefs_PageSizes::restoreDefaults(struct ApplicationPrefs *prefsData)
+{
+	PageSize ps(prefsData->docSetupPrefs.pageSize);
+	QStringList sl(ps.sizeTRList());
+	activeSizesListWidget->addItems(ps.activeSizeTRList());
+	for (int i = 0; i < sl.count(); ++i)
+	{
+		if (activeSizesListWidget->findItems(sl.at(i), Qt::MatchExactly).isEmpty())
+			availableSizesListWidget->addItem(sl.at(i));
+	}
+}
+
+void Prefs_PageSizes::saveGuiToPrefs(struct ApplicationPrefs *prefsData) const
+{
+	QStringList newActivePageSizes;
+	for (int i = 0; i < activeSizesListWidget->count(); ++i)
+		newActivePageSizes << activeSizesListWidget->item(i)->text();
+	PageSize ps(prefsData->docSetupPrefs.pageSize);
+	prefsData->activePageSizes=ps.untransPageSizeList(newActivePageSizes);
+}
+
+void Prefs_PageSizes::moveToActive()
+{
+	QList<QListWidgetItem *> si(availableSizesListWidget->selectedItems());
+	for (int i = 0; i < si.count(); ++i)
+	{
+		QListWidgetItem *it=availableSizesListWidget->takeItem(availableSizesListWidget->row(si.at(i)));
+		activeSizesListWidget->addItem(it);
+	}
+}
+
+void Prefs_PageSizes::moveFromActive()
+{
+	QList<QListWidgetItem *> si(activeSizesListWidget->selectedItems());
+	for (int i = 0; i < si.count(); ++i)
+	{
+		if (activeSizesListWidget->count()>1)
+		{
+			QListWidgetItem *it=activeSizesListWidget->takeItem(activeSizesListWidget->row(si.at(i)));
+			availableSizesListWidget->addItem(it);
+		}
+	}
+}
+

Property changes on: scribus/ui/prefs_pagesizes.cpp
___________________________________________________________________
Added: svn:eol-style
   + native

Index: scribus/ui/preferencesdialog.cpp
===================================================================
--- scribus/ui/preferencesdialog.cpp	(revision 15104)
+++ scribus/ui/preferencesdialog.cpp	(revision 15105)
@@ -71,6 +71,7 @@
 	}
 	prefs_DocumentSetup = new Prefs_DocumentSetup(prefsStackWidget, m_Doc);
 	addItem( tr("Document Setup"), loadIcon("scribusdoc.png"), prefs_DocumentSetup);
+	connect (prefs_DocumentSetup, SIGNAL(changeToOtherSection(const QString&)), this, SLOT(setNewItemSelected(const QString&)));
 	if (doc)
 	{
 		prefs_DocumentInformation = new Prefs_DocumentInformation(prefsStackWidget, m_Doc);
@@ -120,6 +121,8 @@
 		addItem( tr("External Tools"), loadIcon("externaltools.png"), prefs_ExternalTools);
 		prefs_Miscellaneous = new Prefs_Miscellaneous(prefsStackWidget, m_Doc);
 		addItem( tr("Miscellaneous"), loadIcon("misc.png"), prefs_Miscellaneous);
+		prefs_PageSizes = new Prefs_PageSizes(prefsStackWidget, m_Doc);
+		addItem( tr("Page Sizes"), loadIcon("16/page-simple.png"), prefs_PageSizes);
 		prefs_Plugins = new Prefs_Plugins(prefsStackWidget, m_Doc);
 		addItem( tr("Plugins"), loadIcon("plugins.png"), prefs_Plugins);
 		prefs_ImageCache = new Prefs_ImageCache(prefsStackWidget, m_Doc);
@@ -201,6 +204,8 @@
 		prefs_Plugins->restoreDefaults(&localPrefs);
 	if (prefs_Miscellaneous)
 		prefs_Miscellaneous->restoreDefaults(&localPrefs);
+	if (prefs_PageSizes)
+		prefs_PageSizes->restoreDefaults(&localPrefs);
 	if (prefs_ImageCache)
 		prefs_ImageCache->restoreDefaults(&localPrefs);
 }
@@ -240,6 +245,8 @@
 		prefs_Plugins->saveGuiToPrefs(&localPrefs);
 	if (prefs_Miscellaneous)
 		prefs_Miscellaneous->saveGuiToPrefs(&localPrefs);
+	if (prefs_PageSizes)
+		prefs_PageSizes->saveGuiToPrefs(&localPrefs);
 	if (prefs_ImageCache)
 		prefs_ImageCache->saveGuiToPrefs(&localPrefs);
 }
@@ -301,6 +308,8 @@
 	{
 		//emit aboutToShow(prefsWidgets->widget(itemMap[ic]));
 		prefsStackWidget->setCurrentIndex(stackWidgetMap[ic]);
+		if (prefsStackWidget->currentWidget()==dynamic_cast<QWidget*>(prefs_DocumentSetup))
+			prefs_DocumentSetup->setupPageSizes(&localPrefs);
 		if (prefsStackWidget->currentWidget()==dynamic_cast<QWidget*>(prefs_ItemTools))
 			prefs_ItemTools->enableFontPreview(true);
 		if (prefsStackWidget->currentWidget()==dynamic_cast<QWidget*>(prefs_TableOfContents))
@@ -310,6 +319,16 @@
 	}
 }
 
+void PreferencesDialog::setNewItemSelected(const QString &s)
+{
+	if (s=="Prefs_PageSizes" && prefs_PageSizes!=NULL)
+	{
+		int i=prefsStackWidget->indexOf(prefs_PageSizes);
+		if (i!=-1)
+			preferencesTypeList->setCurrentRow(i);
+	}
+}
+
 void PreferencesDialog::changeEvent(QEvent *e)
 {
 	if (e->type() == QEvent::LanguageChange)
Index: scribus/ui/prefs_preflightverifier.cpp
===================================================================
--- scribus/ui/prefs_preflightverifier.cpp	(revision 15104)
+++ scribus/ui/prefs_preflightverifier.cpp	(revision 15105)
@@ -5,7 +5,7 @@
 for which a new license (GPL+exception) is in place.
 */
 
-#include "prefs_preflightverifier.h"
+#include "ui/prefs_preflightverifier.h"
 #include "prefsstructs.h"
 #include "util.h"
 
Index: scribus/ui/prefs_pagesizesbase.ui
===================================================================
--- scribus/ui/prefs_pagesizesbase.ui	(revision 0)
+++ scribus/ui/prefs_pagesizesbase.ui	(revision 15105)
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Prefs_PageSizes</class>
+ <widget class="QWidget" name="Prefs_PageSizes">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>657</width>
+    <height>358</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_4">
+   <item>
+    <widget class="QLabel" name="label">
+     <property name="font">
+      <font>
+       <pointsize>14</pointsize>
+       <weight>75</weight>
+       <bold>true</bold>
+      </font>
+     </property>
+     <property name="text">
+      <string>Page Sizes</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="Line" name="line">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <item>
+        <widget class="QLabel" name="label_2">
+         <property name="text">
+          <string>Available Sizes</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QListWidget" name="availableSizesListWidget">
+         <property name="alternatingRowColors">
+          <bool>false</bool>
+         </property>
+         <property name="selectionMode">
+          <enum>QAbstractItemView::ExtendedSelection</enum>
+         </property>
+         <property name="sortingEnabled">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <item>
+        <spacer name="verticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QPushButton" name="toActiveButton">
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="fromActiveButton">
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_2">
+         <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_3">
+       <item>
+        <widget class="QLabel" name="label_3">
+         <property name="text">
+          <string>Active Sizes</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QListWidget" name="activeSizesListWidget">
+         <property name="selectionMode">
+          <enum>QAbstractItemView::ExtendedSelection</enum>
+         </property>
+         <property name="sortingEnabled">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Index: scribus/ui/preferencesdialog.h
===================================================================
--- scribus/ui/preferencesdialog.h	(revision 15104)
+++ scribus/ui/preferencesdialog.h	(revision 15105)
@@ -29,6 +29,7 @@
 #include "ui/prefs_printer.h"
 #include "ui/prefs_hyphenator.h"
 #include "ui/prefs_miscellaneous.h"
+#include "ui/prefs_pagesizes.h"
 #include "ui/prefs_plugins.h"
 #include "ui/prefs_preflightverifier.h"
 #include "ui/prefs_scrapbook.h"
@@ -68,6 +69,7 @@
 		void restoreDefaults();
 		void setupGui();
 		void saveGuiToPrefs();
+		void setNewItemSelected(const QString &s);
 
 	protected slots:
 		virtual void languageChange();
@@ -107,6 +109,7 @@
 		Prefs_PDFExport *prefs_PDFExport;
 		Prefs_DocumentItemAttributes *prefs_DocumentItemAttributes;
 		Prefs_ImageCache *prefs_ImageCache;
+		Prefs_PageSizes *prefs_PageSizes;
 
 		QMap<QListWidgetItem*, int> stackWidgetMap;
 		int counter;
Index: scribus/ui/margindialog.cpp
===================================================================
--- scribus/ui/margindialog.cpp	(revision 15104)
+++ scribus/ui/margindialog.cpp	(revision 15105)
@@ -46,8 +46,8 @@
 	PageSize *ps=new PageSize(doc->currentPage()->m_pageSize);
 	sizeQComboBox = new QComboBox( dsGroupBox7 );
 	sizeQComboBox->setEditable(false);
-	QStringList pageSizes=ps->sizeList();
-	sizeQComboBox->addItems(ps->sizeTRList());
+	QStringList pageSizes=ps->activeSizeList();
+	sizeQComboBox->addItems(ps->activeSizeTRList());
 	sizeQComboBox->addItem( CommonStrings::trCustomPageSize );
 	prefsPageSizeName=ps->name();
 	int sizeIndex = pageSizes.indexOf(ps->nameTR());
Index: scribus/ui/prefs_documentsetup.h
===================================================================
--- scribus/ui/prefs_documentsetup.h	(revision 15104)
+++ scribus/ui/prefs_documentsetup.h	(revision 15105)
@@ -25,13 +25,13 @@
 		virtual void restoreDefaults(struct ApplicationPrefs *prefsData);
 		virtual void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const;
 		void getResizeDocumentPages(bool &resizePages, bool &resizeMasterPages, bool &resizePageMargins, bool &resizeMasterPageMargins);
+		void setupPageSizes(struct ApplicationPrefs *prefsData);
 
-
 	public slots:
 		void languageChange();
 		void pageLayoutChanged(int);
 
-	private slots:
+	protected slots:
 		void setPageWidth(double);
 		/*!
 		\author Franz Schmid
@@ -54,6 +54,7 @@
 		void setPageSize();
 		void slotUndo(bool);
 		void unitChange();
+		void emitSectionChange();
 
 	protected:
 		void setupPageSets();
@@ -65,7 +66,10 @@
 		double pageH;
 		QString prefsPageSizeName;
 		QList<PageSet> pageSets;
-};
 
+	signals:
+		void changeToOtherSection(const QString&);
+	};
+
 #endif // PREFS_DOCUMENTSETUP_H
 
Index: scribus/ui/prefs_pdfexportbase.ui
===================================================================
--- scribus/ui/prefs_pdfexportbase.ui	(revision 15104)
+++ scribus/ui/prefs_pdfexportbase.ui	(revision 15105)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>671</width>
-    <height>585</height>
+    <width>631</width>
+    <height>553</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -675,7 +675,7 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>602</width>
+            <width>562</width>
             <height>638</height>
            </rect>
           </property>
Index: scribus/ui/prefs_documentsetupbase.ui
===================================================================
--- scribus/ui/prefs_documentsetupbase.ui	(revision 15104)
+++ scribus/ui/prefs_documentsetupbase.ui	(revision 15105)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>485</width>
-    <height>567</height>
+    <height>601</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -79,7 +79,21 @@
           </widget>
          </item>
          <item row="0" column="1">
-          <widget class="QComboBox" name="pageSizeComboBox"/>
+          <layout class="QHBoxLayout" name="horizontalLayout_3">
+           <item>
+            <widget class="QComboBox" name="pageSizeComboBox"/>
+           </item>
+           <item>
+            <widget class="QToolButton" name="pageSizeLinkToolButton">
+             <property name="text">
+              <string>...</string>
+             </property>
+             <property name="arrowType">
+              <enum>Qt::NoArrow</enum>
+             </property>
+            </widget>
+           </item>
+          </layout>
          </item>
          <item row="1" column="0">
           <widget class="QLabel" name="pageOrientatioLabel">
Index: scribus/ui/inspage.cpp
===================================================================
--- scribus/ui/inspage.cpp	(revision 15104)
+++ scribus/ui/inspage.cpp	(revision 15105)
@@ -213,8 +213,8 @@
 	dsGroupBox7Layout->addWidget( TextLabel1, 0, 0);
 	PageSize *ps=new PageSize(currentDoc->pageSize());
 	sizeQComboBox = new QComboBox(dsGroupBox7);
-	QStringList pageSizes=ps->sizeList();
-	sizeQComboBox->addItems(ps->sizeTRList());
+	QStringList pageSizes=ps->activeSizeList();
+	sizeQComboBox->addItems(ps->activeSizeTRList());
 	sizeQComboBox->addItem(CommonStrings::trCustomPageSize);
 	prefsPageSizeName=ps->name();
 	int sizeIndex = pageSizes.indexOf(ps->nameTR());
Index: scribus/CMakeLists.txt
===================================================================
--- scribus/CMakeLists.txt	(revision 15104)
+++ scribus/CMakeLists.txt	(revision 15105)
@@ -109,6 +109,7 @@
   ui/prefs_keyboardshortcutsbase.ui
   ui/prefs_miscellaneousbase.ui
   ui/prefs_pathsbase.ui
+  ui/prefs_pagesizesbase.ui
   ui/prefs_pluginsbase.ui
   ui/prefs_preflightverifierbase.ui
   ui/prefs_printerbase.ui
@@ -302,6 +303,7 @@
   ui/prefs_imagecache.h
   ui/prefs_keyboardshortcuts.h
   ui/prefs_miscellaneous.h
+  ui/prefs_pagesizes.h
   ui/prefs_paths.h
   ui/prefs_pane.h
   ui/prefs_plugins.h
@@ -625,6 +627,7 @@
   ui/prefs_imagecache.cpp
   ui/prefs_keyboardshortcuts.cpp
   ui/prefs_miscellaneous.cpp
+  ui/prefs_pagesizes.cpp
   ui/prefs_paths.cpp
   ui/prefs_plugins.cpp
   ui/prefs_preflightverifier.cpp
Index: scribus/pagesize.h
===================================================================
--- scribus/pagesize.h	(revision 15104)
+++ scribus/pagesize.h	(revision 15105)
@@ -51,8 +51,11 @@
 	double originalHeight() const { return m_height*unitGetRatioFromIndex(m_pageUnitIndex); }
 	QStringList sizeList() const;
 	QStringList sizeTRList() const;
+	QStringList activeSizeList() const;
+	QStringList activeSizeTRList() const;
 	void generateSizeList();
 	void printSizeList();
+	QStringList untransPageSizeList(const QStringList &transList);
 
 private:
 	QMap<QString, PageSizeInfo > pageSizeList;




More information about the scribus-commit mailing list