r14023 by cbradney - Start to reimplement prefs loading into new GUI. Loading only of some of display prefs right now

scribus-commit scribus-commit at lists.scribus.net
Mon Sep 21 23:50:19 CEST 2009


Revision: 14023
Author: cbradney
Date: 2009-09-21T21:51:00.348730Z
Commit message: Start to reimplement prefs loading into new GUI. Loading only of some of display prefs right now

Changeset: 
M  /trunk/Scribus/scribus/ui/preferencesdialog.cpp
M  /trunk/Scribus/scribus/ui/prefs_display.cpp
M  /trunk/Scribus/scribus/ui/prefs_display.h
M  /trunk/Scribus/scribus/ui/prefs_displaybase.ui

Diffs:
Index: scribus/ui/prefs_display.h
===================================================================
--- scribus/ui/prefs_display.h	(revision 14022)
+++ scribus/ui/prefs_display.h	(revision 14023)
@@ -18,6 +18,10 @@
 	public:
 		Prefs_Display(QWidget* parent=0);
 		~Prefs_Display();
+		void restoreDefaults(struct ApplicationPrefs *prefsData);
+
+	protected:
+		int docUnitIndex;
 };
 
 #endif // PREFS_DISPLAY_H
Index: scribus/ui/prefs_display.cpp
===================================================================
--- scribus/ui/prefs_display.cpp	(revision 14022)
+++ scribus/ui/prefs_display.cpp	(revision 14023)
@@ -7,14 +7,106 @@
 
 #include "prefs_display.h"
 
+#include "prefsstructs.h"
+#include "units.h"
+
 Prefs_Display::Prefs_Display(QWidget* parent)
 	: QWidget(parent)
 {
 	setupUi(this);
-
 }
 
 Prefs_Display::~Prefs_Display()
 {
 }
 
+void Prefs_Display::restoreDefaults(struct ApplicationPrefs *prefsData)
+{
+	docUnitIndex = prefsData->docSetupPrefs.docUnitIndex;
+	double unitRatio = unitGetRatioFromIndex(docUnitIndex);
+	int decimals = unitGetPrecisionFromIndex(docUnitIndex);
+	QString unitSuffix = unitGetSuffixFromIndex(docUnitIndex);
+
+	showImagesCheckBox->setChecked(prefsData->guidesPrefs.showPic);
+	showControlCharsCheckBox->setChecked(prefsData->guidesPrefs.showControls);
+	showRulersRelativeToPageCheckBox->setChecked(prefsData->guidesPrefs.rulerMode);
+	showTextChainsCheckBox->setChecked(prefsData->guidesPrefs.linkShown);
+	showFramesCheckBox->setChecked(prefsData->guidesPrefs.framesShown);
+	showLayerIndicatorsCheckBox->setChecked(prefsData->guidesPrefs.layerMarkersShown);
+	showUnprintableAreaInMarginColorCheckBox->setChecked(prefsData->displayPrefs.marginColored);
+	showBleedAreaCheckBox->setChecked(prefsData->guidesPrefs.showBleed);
+	showPageShadowCheckBox->setChecked(prefsData->displayPrefs.showPageShadow);
+
+
+	scratchSpaceLeftSpinBox->setMaximum(1000);
+	scratchSpaceRightSpinBox->setMaximum(1000);
+	scratchSpaceTopSpinBox->setMaximum(1000);
+	scratchSpaceBottomSpinBox->setMaximum(1000);
+	pageGapHorizontalSpinBox->setMaximum(1000);
+	pageGapVerticalSpinBox->setMaximum(1000);
+	scratchSpaceLeftSpinBox->setNewUnit(docUnitIndex);
+	scratchSpaceRightSpinBox->setNewUnit(docUnitIndex);
+	scratchSpaceTopSpinBox->setNewUnit(docUnitIndex);
+	scratchSpaceBottomSpinBox->setNewUnit(docUnitIndex);
+	pageGapHorizontalSpinBox->setNewUnit(docUnitIndex);
+	pageGapVerticalSpinBox->setNewUnit(docUnitIndex);
+
+
+	scratchSpaceLeftSpinBox->setValue(prefsData->displayPrefs.scratch.Left * unitRatio);
+	scratchSpaceRightSpinBox->setValue(prefsData->displayPrefs.scratch.Right * unitRatio);
+	scratchSpaceTopSpinBox->setValue(prefsData->displayPrefs.scratch.Top * unitRatio);
+	scratchSpaceBottomSpinBox->setValue(prefsData->displayPrefs.scratch.Bottom * unitRatio);
+	pageGapHorizontalSpinBox->setValue(prefsData->displayPrefs.pageGapHorizontal);
+	pageGapVerticalSpinBox->setValue(prefsData->displayPrefs.pageGapVertical);
+
+	/*
+	DisScale = prefsData->displayPrefs.displayScale;
+
+	QPixmap pm(54, 14);
+	pm.fill(prefsData->displayPrefs.paperColor);
+	colorPaper = prefsData->displayPrefs.paperColor;
+	backColor->setIcon(pm);
+	backColor->setText( QString::null );
+	pm.fill(prefsData->displayPrefs.frameColor);
+	colorFrame = prefsData->displayPrefs.frameColor;
+	buttonFrameSelected->setText( QString::null );
+	buttonFrameSelected->setIcon(pm);
+	pm.fill(prefsData->displayPrefs.frameNormColor);
+	colorFrameNorm = prefsData->displayPrefs.frameNormColor;
+	buttonFrameNormal->setText( QString::null );
+	buttonFrameNormal->setIcon(pm);
+	pm.fill(prefsData->displayPrefs.frameGroupColor);
+	colorFrameGroup = prefsData->displayPrefs.frameGroupColor;
+	buttonFrameGrouped->setText( QString::null );
+	buttonFrameGrouped->setIcon(pm);
+	pm.fill(prefsData->displayPrefs.frameLinkColor);
+	colorFrameLinked = prefsData->displayPrefs.frameLinkColor;
+	buttonFrameLinked->setText( QString::null );
+	buttonFrameLinked->setIcon(pm);
+	pm.fill(prefsData->displayPrefs.frameLockColor);
+	colorFrameLocked = prefsData->displayPrefs.frameLockColor;
+	buttonFrameLocked->setText( QString::null );
+	buttonFrameLocked->setIcon(pm);
+	pm.fill(prefsData->displayPrefs.frameAnnotationColor);
+	colorFrameAnnotation = prefsData->displayPrefs.frameAnnotationColor;
+	buttonFrameAnnotation->setText( QString::null );
+	buttonFrameAnnotation->setIcon(pm);
+	pm.fill(prefsData->displayPrefs.pageBorderColor);
+	colorPageBorder = prefsData->displayPrefs.pageBorderColor;
+	buttonSelectedPage->setText( QString::null );
+	buttonSelectedPage->setIcon(pm);
+	pm.fill(prefsData->displayPrefs.controlCharColor);
+	colorControlChars = prefsData->displayPrefs.controlCharColor;
+	buttonControlChars->setText( QString::null );
+	buttonControlChars->setIcon(pm);
+
+
+	CaliSlider->setValue(qRound(100 * DisScale) - 150);
+	CaliAnz->setText(QString::number(qRound(DisScale*72.0))+ tr(" dpi"));
+	rulerUnitCombo->clear();
+	rulerUnitCombo->addItems(unitGetTextUnitList());
+	rulerUnitCombo->setCurrentIndex(docUnitIndex);
+	drawRuler();
+*/
+}
+
Index: scribus/ui/prefs_displaybase.ui
===================================================================
--- scribus/ui/prefs_displaybase.ui	(revision 14022)
+++ scribus/ui/prefs_displaybase.ui	(revision 14023)
@@ -44,9 +44,9 @@
       <property name="geometry">
        <rect>
         <x>0</x>
-        <y>-250</y>
+        <y>-254</y>
         <width>678</width>
-        <height>1122</height>
+        <height>1127</height>
        </rect>
       </property>
       <layout class="QVBoxLayout" name="verticalLayout_5">
@@ -73,63 +73,63 @@
        <item>
         <layout class="QVBoxLayout" name="verticalLayout_2">
          <item>
-          <widget class="QCheckBox" name="checkBox">
+          <widget class="QCheckBox" name="showImagesCheckBox">
            <property name="text">
             <string>Show Images</string>
            </property>
           </widget>
          </item>
          <item>
-          <widget class="QCheckBox" name="checkBox_2">
+          <widget class="QCheckBox" name="showControlCharsCheckBox">
            <property name="text">
             <string>Show Text Control Characters</string>
            </property>
           </widget>
          </item>
          <item>
-          <widget class="QCheckBox" name="checkBox_3">
+          <widget class="QCheckBox" name="showRulersRelativeToPageCheckBox">
            <property name="text">
-            <string>Rulers Relative to Page</string>
+            <string>Show Rulers Relative to Page</string>
            </property>
           </widget>
          </item>
          <item>
-          <widget class="QCheckBox" name="checkBox_5">
+          <widget class="QCheckBox" name="showTextChainsCheckBox">
            <property name="text">
             <string>Show Text Chains</string>
            </property>
           </widget>
          </item>
          <item>
-          <widget class="QCheckBox" name="checkBox_10">
+          <widget class="QCheckBox" name="showFramesCheckBox">
            <property name="text">
             <string>Show Frames</string>
            </property>
           </widget>
          </item>
          <item>
-          <widget class="QCheckBox" name="checkBox_11">
+          <widget class="QCheckBox" name="showLayerIndicatorsCheckBox">
            <property name="text">
             <string>Show Layer Indicators</string>
            </property>
           </widget>
          </item>
          <item>
-          <widget class="QCheckBox" name="checkBox_9">
+          <widget class="QCheckBox" name="showUnprintableAreaInMarginColorCheckBox">
            <property name="text">
-            <string>Display Unprintable Area in Margin Color</string>
+            <string>Show Unprintable Area in Margin Color</string>
            </property>
           </widget>
          </item>
          <item>
-          <widget class="QCheckBox" name="checkBox_8">
+          <widget class="QCheckBox" name="showBleedAreaCheckBox">
            <property name="text">
             <string>Show Bleed Area</string>
            </property>
           </widget>
          </item>
          <item>
-          <widget class="QCheckBox" name="checkBox_7">
+          <widget class="QCheckBox" name="showPageShadowCheckBox">
            <property name="text">
             <string>Show Page Shadow</string>
            </property>
@@ -207,16 +207,16 @@
           </widget>
          </item>
          <item row="0" column="1">
-          <widget class="ScrSpinBox" name="spinBox"/>
+          <widget class="ScrSpinBox" name="scratchSpaceLeftSpinBox"/>
          </item>
          <item row="1" column="1">
-          <widget class="ScrSpinBox" name="spinBox_2"/>
+          <widget class="ScrSpinBox" name="scratchSpaceRightSpinBox"/>
          </item>
          <item row="2" column="1">
-          <widget class="ScrSpinBox" name="spinBox_3"/>
+          <widget class="ScrSpinBox" name="scratchSpaceTopSpinBox"/>
          </item>
          <item row="3" column="1">
-          <widget class="ScrSpinBox" name="spinBox_4"/>
+          <widget class="ScrSpinBox" name="scratchSpaceBottomSpinBox"/>
          </item>
         </layout>
        </item>
@@ -272,7 +272,7 @@
           </widget>
          </item>
          <item row="0" column="1">
-          <widget class="ScrSpinBox" name="spinBox_5"/>
+          <widget class="ScrSpinBox" name="pageGapHorizontalSpinBox"/>
          </item>
          <item row="1" column="0">
           <widget class="QLabel" name="label_10">
@@ -282,7 +282,7 @@
           </widget>
          </item>
          <item row="1" column="1">
-          <widget class="ScrSpinBox" name="spinBox_6"/>
+          <widget class="ScrSpinBox" name="pageGapVerticalSpinBox"/>
          </item>
         </layout>
        </item>
@@ -325,7 +325,7 @@
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout">
          <item>
-          <widget class="QSlider" name="CaliSlider">
+          <widget class="QSlider" name="adjustDisplaySlider">
            <property name="minimum">
             <number>-150</number>
            </property>
@@ -365,7 +365,7 @@
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_2">
          <item>
-          <widget class="QLabel" name="CaliRuler">
+          <widget class="QLabel" name="displaySizeRuler">
            <property name="sizePolicy">
             <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
              <horstretch>0</horstretch>
@@ -425,12 +425,12 @@
          <item row="0" column="0">
           <widget class="QLabel" name="label_15">
            <property name="text">
-            <string>Page Fill Color:</string>
+            <string>Page Fill:</string>
            </property>
           </widget>
          </item>
          <item row="0" column="1">
-          <widget class="QPushButton" name="pushButton_8">
+          <widget class="QPushButton" name="pageFillColorButton">
            <property name="text">
             <string>PushButton</string>
            </property>
@@ -444,7 +444,7 @@
           </widget>
          </item>
          <item row="1" column="1">
-          <widget class="QPushButton" name="pushButton_7">
+          <widget class="QPushButton" name="selectedPageBorderButton">
            <property name="text">
             <string>PushButton</string>
            </property>
@@ -458,7 +458,7 @@
           </widget>
          </item>
          <item row="2" column="1">
-          <widget class="QPushButton" name="pushButton_10">
+          <widget class="QPushButton" name="frameColorButton">
            <property name="text">
             <string>PushButton</string>
            </property>
@@ -472,7 +472,7 @@
           </widget>
          </item>
          <item row="3" column="1">
-          <widget class="QPushButton" name="pushButton_9">
+          <widget class="QPushButton" name="frameLockedColorButton">
            <property name="text">
             <string>PushButton</string>
            </property>
@@ -486,19 +486,26 @@
           </widget>
          </item>
          <item row="4" column="1">
-          <widget class="QPushButton" name="pushButton_6">
+          <widget class="QPushButton" name="frameSelectedColorButton">
            <property name="text">
             <string>PushButton</string>
            </property>
           </widget>
          </item>
-         <item row="8" column="0">
-          <widget class="QLabel" name="label_29">
+         <item row="5" column="0">
+          <widget class="QLabel" name="label_31">
            <property name="text">
-            <string>Annotation Frames:</string>
+            <string>Linked Frames:</string>
            </property>
           </widget>
          </item>
+         <item row="5" column="1">
+          <widget class="QPushButton" name="frameLinkedColorButton">
+           <property name="text">
+            <string>PushButton</string>
+           </property>
+          </widget>
+         </item>
          <item row="6" column="0">
           <widget class="QLabel" name="label_30">
            <property name="text">
@@ -506,48 +513,41 @@
            </property>
           </widget>
          </item>
-         <item row="5" column="0">
-          <widget class="QLabel" name="label_31">
+         <item row="6" column="1">
+          <widget class="QPushButton" name="frameGroupedColorButton">
            <property name="text">
-            <string>Linked Frames:</string>
+            <string>PushButton</string>
            </property>
           </widget>
          </item>
          <item row="7" column="0">
-          <widget class="QLabel" name="label_32">
+          <widget class="QLabel" name="label_29">
            <property name="text">
-            <string>Text Control Characters:</string>
+            <string>Annotation Frames:</string>
            </property>
           </widget>
          </item>
-         <item row="8" column="1">
-          <widget class="QPushButton" name="pushButton">
+         <item row="8" column="0">
+          <widget class="QLabel" name="label_32">
            <property name="text">
-            <string>PushButton</string>
+            <string>Text Control Characters:</string>
            </property>
           </widget>
          </item>
          <item row="7" column="1">
-          <widget class="QPushButton" name="pushButton_2">
+          <widget class="QPushButton" name="frameAnnotationColorButton">
            <property name="text">
             <string>PushButton</string>
            </property>
           </widget>
          </item>
-         <item row="6" column="1">
-          <widget class="QPushButton" name="pushButton_3">
+         <item row="8" column="1">
+          <widget class="QPushButton" name="textControlCharsButton">
            <property name="text">
             <string>PushButton</string>
            </property>
           </widget>
          </item>
-         <item row="5" column="1">
-          <widget class="QPushButton" name="pushButton_4">
-           <property name="text">
-            <string>PushButton</string>
-           </property>
-          </widget>
-         </item>
         </layout>
        </item>
       </layout>
Index: scribus/ui/preferencesdialog.cpp
===================================================================
--- scribus/ui/preferencesdialog.cpp	(revision 14022)
+++ scribus/ui/preferencesdialog.cpp	(revision 14023)
@@ -82,6 +82,8 @@
 	connect(preferencesTypeList, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(itemSelected(QListWidgetItem* )));
 
 	initPreferenceValues();
+
+	prefs_Display->restoreDefaults(&(prefsManager->appPrefs));
 }
 
 PreferencesDialog::~PreferencesDialog()




More information about the scribus-commit mailing list