r14248 by cbradney - First part of new colour management prefs pane..

scribus-commit scribus-commit at lists.scribus.net
Thu Oct 29 00:30:25 CET 2009


Revision: 14248
Author: cbradney
Date: 2009-10-28T19:16:14.596417Z
Commit message: First part of new colour management prefs pane.. 

Changeset: 
M  /trunk/Scribus/scribus/ui/prefs_colormanagement.h
M  /trunk/Scribus/scribus/ui/prefs_colormanagementbase.ui
M  /trunk/Scribus/scribus/ui/preferencesdialog.cpp
M  /trunk/Scribus/scribus/ui/prefs_colormanagement.cpp

Diffs:
Index: scribus/ui/prefs_colormanagement.cpp
===================================================================
--- scribus/ui/prefs_colormanagement.cpp	(revision 14247)
+++ scribus/ui/prefs_colormanagement.cpp	(revision 14248)
@@ -6,15 +6,98 @@
 */
 
 #include "prefs_colormanagement.h"
+#include "scribusstructs.h"
+#include "prefsstructs.h"
 
 Prefs_ColorManagement::Prefs_ColorManagement(QWidget* parent)
-	: QWidget(parent)
+	: Prefs_Pane(parent)
 {
 	setupUi(this);
-
+	languageChange();
 }
 
 Prefs_ColorManagement::~Prefs_ColorManagement()
 {
 }
 
+void Prefs_ColorManagement::languageChange()
+{
+}
+
+void Prefs_ColorManagement::restoreDefaults(struct ApplicationPrefs *prefsData)
+{
+	activateCMCheckBox->setChecked(prefsData->colorPrefs.DCMSset.CMSinUse);
+
+	QString tmp_mp[] = { tr("Perceptual"), tr("Relative Colorimetric"),
+		tr("Saturation"), tr("Absolute Colorimetric")};
+		size_t array = sizeof(tmp_mp) / sizeof(*tmp_mp);
+	imageRenderingIntentComboBox->clear();
+	for (uint prop = 0; prop < array; ++prop)
+		imageRenderingIntentComboBox->addItem(tmp_mp[prop]);
+	imageRenderingIntentComboBox->setCurrentIndex(prefsData->colorPrefs.DCMSset.DefaultIntentImages);
+	solidColorsRenderingIntentComboBox->clear();
+	for (uint prop = 0; prop < array; ++prop)
+		solidColorsRenderingIntentComboBox->addItem(tmp_mp[prop]);
+	solidColorsRenderingIntentComboBox->setCurrentIndex(prefsData->colorPrefs.DCMSset.DefaultIntentColors);
+
+	simulatePrinterOnScreenCheckBox->setChecked(prefsData->colorPrefs.DCMSset.SoftProofOn);
+	convertAllColorsToPrinterSpaceCheckBox->setChecked(prefsData->colorPrefs.DCMSset.SoftProofFullOn);
+	markColorsOutOfGamutCheckBox->setChecked(prefsData->colorPrefs.DCMSset.GamutCheck);
+	useBlackpointCompensationCheckBox->setChecked(prefsData->colorPrefs.DCMSset.BlackPoint);
+
+	simulatePrinterOnScreenCheckBox->setEnabled( activateCMCheckBox->isChecked() );
+	useBlackpointCompensationCheckBox->setEnabled( activateCMCheckBox->isChecked() );
+
+}
+
+void Prefs_ColorManagement::setProfiles(struct ApplicationPrefs *prefsData, ProfilesL *inputProfiles, ProfilesL *inputProfilesCMYK, ProfilesL *printerProfiles, ProfilesL *monitorProfiles)
+{
+	ProfilesL::Iterator it;
+	rgbImageProfileComboBox->clear();
+	for (it = inputProfiles->begin(); it != inputProfiles->end(); ++it)
+	{
+		rgbImageProfileComboBox->addItem(it.key());
+		if (it.key() == prefsData->colorPrefs.DCMSset.DefaultImageRGBProfile)
+			rgbImageProfileComboBox->setCurrentIndex(rgbImageProfileComboBox->count()-1);
+	}
+	cmykImageProfileComboBox->clear();
+	for (it = inputProfilesCMYK->begin(); it != inputProfilesCMYK->end(); ++it)
+	{
+		cmykImageProfileComboBox->addItem(it.key());
+		if (it.key() == prefsData->colorPrefs.DCMSset.DefaultImageCMYKProfile)
+			cmykImageProfileComboBox->setCurrentIndex(cmykImageProfileComboBox->count()-1);
+	}
+	rgbSolidProfileComboBox->clear();
+	for (it = inputProfiles->begin(); it != inputProfiles->end(); ++it)
+	{
+		rgbSolidProfileComboBox->addItem(it.key());
+		if (it.key() == prefsData->colorPrefs.DCMSset.DefaultSolidColorRGBProfile)
+			rgbSolidProfileComboBox->setCurrentIndex(rgbSolidProfileComboBox->count()-1);
+	}
+	cmykSolidProfileComboBox->clear();
+	for (it = inputProfilesCMYK->begin(); it != inputProfilesCMYK->end(); ++it)
+	{
+		cmykSolidProfileComboBox->addItem(it.key());
+		if (it.key() == prefsData->colorPrefs.DCMSset.DefaultSolidColorCMYKProfile)
+			cmykSolidProfileComboBox->setCurrentIndex(cmykSolidProfileComboBox->count()-1);
+	}
+	monitorProfileComboBox->clear();
+	for (it = monitorProfiles->begin(); it != monitorProfiles->end(); ++it)
+	{
+		monitorProfileComboBox->addItem(it.key());
+		if (it.key() == prefsData->colorPrefs.DCMSset.DefaultMonitorProfile)
+			monitorProfileComboBox->setCurrentIndex(monitorProfileComboBox->count()-1);
+	}
+	printerProfileComboBox->clear();
+	for (it = printerProfiles->begin(); it != printerProfiles->end(); ++it)
+	{
+		printerProfileComboBox->addItem(it.key());
+		if (it.key() == prefsData->colorPrefs.DCMSset.DefaultPrinterProfile)
+			printerProfileComboBox->setCurrentIndex(printerProfileComboBox->count()-1);
+	}
+}
+
+void Prefs_ColorManagement::saveGuiToPrefs(struct ApplicationPrefs *prefsData) const
+{
+}
+
Index: scribus/ui/prefs_colormanagement.h
===================================================================
--- scribus/ui/prefs_colormanagement.h	(revision 14247)
+++ scribus/ui/prefs_colormanagement.h	(revision 14248)
@@ -9,15 +9,25 @@
 #define PREFS_COLORMANAGEMENT_H
 
 #include "ui_prefs_colormanagementbase.h"
+#include "prefs_pane.h"
 #include "scribusapi.h"
 
-class SCRIBUS_API Prefs_ColorManagement : public QWidget, Ui::Prefs_ColorManagement
+typedef QMap<QString,QString> ProfilesL;
+
+class SCRIBUS_API Prefs_ColorManagement : public Prefs_Pane, Ui::Prefs_ColorManagement
 {
 	Q_OBJECT
 
 	public:
 		Prefs_ColorManagement(QWidget* parent=0);
 		~Prefs_ColorManagement();
+		virtual void restoreDefaults(struct ApplicationPrefs *prefsData);
+		void setProfiles(struct ApplicationPrefs *prefsData, ProfilesL *inputProfiles, ProfilesL *inputProfilesCMYK, ProfilesL *printerProfiles, ProfilesL *monitorProfiles);
+		virtual void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const;
+
+	public slots:
+		void languageChange();
+
 };
 
 #endif // PREFS_COLORMANAGEMENT_H
Index: scribus/ui/prefs_colormanagementbase.ui
===================================================================
--- scribus/ui/prefs_colormanagementbase.ui	(revision 14247)
+++ scribus/ui/prefs_colormanagementbase.ui	(revision 14248)
@@ -53,35 +53,35 @@
       </property>
       <layout class="QVBoxLayout" name="verticalLayout_2">
        <item>
-        <widget class="QCheckBox" name="checkBox">
+        <widget class="QCheckBox" name="activateCMCheckBox">
          <property name="text">
           <string>Activate Color Management</string>
          </property>
         </widget>
        </item>
        <item>
-        <widget class="QCheckBox" name="checkBox_2">
+        <widget class="QCheckBox" name="simulatePrinterOnScreenCheckBox">
          <property name="text">
           <string>Simulate Printer on the Screen</string>
          </property>
         </widget>
        </item>
        <item>
-        <widget class="QCheckBox" name="checkBox_3">
+        <widget class="QCheckBox" name="convertAllColorsToPrinterSpaceCheckBox">
          <property name="text">
           <string>Convert all colors to printer space</string>
          </property>
         </widget>
        </item>
        <item>
-        <widget class="QCheckBox" name="checkBox_4">
+        <widget class="QCheckBox" name="markColorsOutOfGamutCheckBox">
          <property name="text">
           <string>Mark Colors out of Gamut</string>
          </property>
         </widget>
        </item>
        <item>
-        <widget class="QCheckBox" name="checkBox_5">
+        <widget class="QCheckBox" name="useBlackpointCompensationCheckBox">
          <property name="text">
           <string>Use Blackpoint Compensation</string>
          </property>
@@ -125,6 +125,9 @@
        </item>
        <item>
         <layout class="QFormLayout" name="formLayout">
+         <property name="fieldGrowthPolicy">
+          <enum>QFormLayout::FieldsStayAtSizeHint</enum>
+         </property>
          <property name="formAlignment">
           <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
          </property>
@@ -139,7 +142,7 @@
           </widget>
          </item>
          <item row="0" column="1">
-          <widget class="QComboBox" name="comboBox"/>
+          <widget class="QComboBox" name="rgbImageProfileComboBox"/>
          </item>
          <item row="1" column="0">
           <widget class="QLabel" name="textLabel8">
@@ -152,7 +155,7 @@
           </widget>
          </item>
          <item row="1" column="1">
-          <widget class="QComboBox" name="comboBox_2"/>
+          <widget class="QComboBox" name="cmykImageProfileComboBox"/>
          </item>
          <item row="2" column="0">
           <widget class="QLabel" name="textLabel9">
@@ -165,7 +168,7 @@
           </widget>
          </item>
          <item row="2" column="1">
-          <widget class="QComboBox" name="comboBox_3"/>
+          <widget class="QComboBox" name="rgbSolidProfileComboBox"/>
          </item>
          <item row="3" column="0">
           <widget class="QLabel" name="textLabel10">
@@ -178,28 +181,28 @@
           </widget>
          </item>
          <item row="3" column="1">
-          <widget class="QComboBox" name="comboBox_4"/>
+          <widget class="QComboBox" name="cmykSolidProfileComboBox"/>
          </item>
-         <item row="4" column="0">
-          <widget class="QLabel" name="label_2">
+         <item row="5" column="0">
+          <widget class="QLabel" name="label_3">
            <property name="text">
-            <string>Monitor:</string>
+            <string>Printer:</string>
            </property>
           </widget>
          </item>
+         <item row="5" column="1">
+          <widget class="QComboBox" name="printerProfileComboBox"/>
+         </item>
          <item row="4" column="1">
-          <widget class="QComboBox" name="comboBox_5"/>
+          <widget class="QComboBox" name="monitorProfileComboBox"/>
          </item>
-         <item row="5" column="0">
-          <widget class="QLabel" name="label_3">
+         <item row="4" column="0">
+          <widget class="QLabel" name="label_2">
            <property name="text">
-            <string>Printer:</string>
+            <string>Monitor:</string>
            </property>
           </widget>
          </item>
-         <item row="5" column="1">
-          <widget class="QComboBox" name="comboBox_6"/>
-         </item>
         </layout>
        </item>
        <item>
@@ -251,7 +254,7 @@
           </widget>
          </item>
          <item row="0" column="1">
-          <widget class="QComboBox" name="comboBox_7"/>
+          <widget class="QComboBox" name="imageRenderingIntentComboBox"/>
          </item>
          <item row="1" column="0">
           <widget class="QLabel" name="label_6">
@@ -261,7 +264,7 @@
           </widget>
          </item>
          <item row="1" column="1">
-          <widget class="QComboBox" name="comboBox_8"/>
+          <widget class="QComboBox" name="solidColorsRenderingIntentComboBox"/>
          </item>
         </layout>
        </item>
Index: scribus/ui/preferencesdialog.cpp
===================================================================
--- scribus/ui/preferencesdialog.cpp	(revision 14247)
+++ scribus/ui/preferencesdialog.cpp	(revision 14248)
@@ -16,6 +16,7 @@
 #include "commonstrings.h"
 #include "prefsmanager.h"
 #include "scribus.h"
+#include "scribuscore.h"
 #include "units.h"
 #include "util_icon.h"
 
@@ -107,6 +108,8 @@
 	prefs_UserInterface->restoreDefaults(&localPrefs);
 	prefs_Paths->restoreDefaults(&localPrefs);
 	prefs_DocumentSetup->restoreDefaults(&localPrefs);
+	prefs_ColorManagement->restoreDefaults(&localPrefs);
+	prefs_ColorManagement->setProfiles(&localPrefs, &ScCore->InputProfiles, &ScCore->InputProfilesCMYK, &ScCore->PrinterProfiles, &ScCore->MonitorProfiles);
 	prefs_Scrapbook->restoreDefaults(&localPrefs);
 	prefs_Display->restoreDefaults(&localPrefs);
 }
@@ -240,6 +243,7 @@
 	prefs_UserInterface->saveGuiToPrefs(&localPrefs);
 	prefs_Paths->saveGuiToPrefs(&localPrefs);
 	prefs_DocumentSetup->saveGuiToPrefs(&localPrefs);
+	prefs_ColorManagement->saveGuiToPrefs(&localPrefs);
 	prefs_Scrapbook->saveGuiToPrefs(&localPrefs);
 	prefs_Display->saveGuiToPrefs(&localPrefs);
 }




More information about the scribus-commit mailing list