r14281 by jghali - Make monitor profile an application setting. Monitor profile was previously specific to a document. When opened on another workstation than the one which created it, user had to enter doc setup to change monitor profile in order to get an accurate display of colors. Now monitor profile is taken directly from application making that step useless. An ScColorProfile display profile member is kept for now in document as default rgb profile is still used in place of monitor profile when color management is disabled for a specific doc. Not sure if that gonna be kept as is. Given current limitation of our color management, monitor profile can only be changed when no document are opened. Avoid user waiting that all image in all opened docs are updated...

scribus-commit scribus-commit at lists.scribus.net
Wed Nov 11 21:10:52 CET 2009


Revision: 14281
Author: jghali
Date: 2009-11-11T13:05:15.130925Z
Commit message: Make monitor profile an application setting.
Monitor profile was previously specific to a document. When opened on another workstation than the one which created it, user had to enter doc setup to change monitor profile in order to get an accurate display of colors. Now monitor profile is taken directly from application making that step useless. An ScColorProfile display profile member is kept for now in document as default rgb profile is still used in place of monitor profile when color management is disabled for a specific doc. Not sure if that gonna be kept as is.
Given current limitation of our color management, monitor profile can only be changed when no document are opened. Avoid user waiting that all image in all opened docs are updated...

Changeset: 
M  /trunk/Scribus/scribus/scribuscore.h
M  /trunk/Scribus/scribus/scribus.cpp
M  /trunk/Scribus/scribus/ui/prefs_colormanagement.h
M  /trunk/Scribus/scribus/ui/prefs_colormanagementbase.ui
M  /trunk/Scribus/scribus/ui/preview.cpp
M  /trunk/Scribus/scribus/ui/cmsprefs.cpp
M  /trunk/Scribus/scribus/cmsettings.cpp
M  /trunk/Scribus/scribus/scribusdoc.cpp
M  /trunk/Scribus/scribus/scribuscore.cpp
M  /trunk/Scribus/scribus/ui/cmsprefs.h
M  /trunk/Scribus/scribus/colormngt/sclcmscolormngtengineimpl.cpp
M  /trunk/Scribus/scribus/scribusdoc.h
M  /trunk/Scribus/scribus/ui/cmsprefsbase.ui
M  /trunk/Scribus/scribus/ui/prefs_colormanagement.cpp

Diffs:
Index: scribus/scribuscore.h
===================================================================
--- scribus/scribuscore.h	(revision 14280)
+++ scribus/scribuscore.h	(revision 14281)
@@ -114,6 +114,7 @@
 	ProfilesL PDFXProfiles;
 
 	ScColorMngtEngine defaultEngine;
+	ScColorProfile   monitorProfile;
 	ScColorProfile   defaultRGBProfile;
 	ScColorProfile   defaultCMYKProfile;
 	ScColorTransform defaultRGBToScreenSolidTrans;
Index: scribus/scribuscore.cpp
===================================================================
--- scribus/scribuscore.cpp	(revision 14280)
+++ scribus/scribuscore.cpp	(revision 14281)
@@ -445,24 +445,51 @@
 
 void ScribusCore::InitDefaultColorTransforms(void)
 {
+	QString defaultRGBString  = "sRGB IEC61966-2.1";
+	QString defaultCMYKString = "Fogra27L CMYK Coated Press";
+
 	// Ouvre le profile RGB par d�fault
-	if (InputProfiles.contains("sRGB IEC61966-2.1"))
-		defaultRGBProfile = defaultEngine.openProfileFromFile(InputProfiles["sRGB IEC61966-2.1"]);
+	if (InputProfiles.contains(defaultRGBString))
+		defaultRGBProfile = defaultEngine.openProfileFromFile(InputProfiles[defaultRGBString]);
 	else
 		defaultRGBProfile = defaultEngine.createProfile_sRGB();
 
 	// Ouvre le profile CMYK par d�faut
-	if (InputProfilesCMYK.contains("Fogra27L CMYK Coated Press"))
+	if (InputProfilesCMYK.contains(defaultCMYKString))
 	{
-		defaultCMYKProfile = defaultEngine.openProfileFromFile(InputProfilesCMYK["Fogra27L CMYK Coated Press"]);
+		defaultCMYKProfile = defaultEngine.openProfileFromFile(InputProfilesCMYK[defaultCMYKString]);
 	}
 
+	// Keep all chance to have monitor profile set
+	monitorProfile = defaultRGBProfile;
+
 	if (!defaultRGBProfile || !defaultCMYKProfile)
 	{
 		ResetDefaultColorTransforms();
 		return;
 	}
 
+	// Default rgb profile may be a memory profile, if it is the case add it to the lists of 
+	// rgb profiles (input and monitor) so that it can be used later in prefs
+	if (!InputProfiles.contains(defaultRGBString))
+		InputProfiles.insert(defaultRGBString, defaultRGBProfile.profilePath());
+	if (!MonitorProfiles.contains(defaultRGBString))
+		MonitorProfiles.insert(defaultRGBString, defaultRGBProfile.profilePath());
+
+	// Open monitor profile as defined by user preferences
+	if (prefsManager->appPrefs.colorPrefs.DCMSset.CMSinUse)
+	{
+		QString displayProfile = prefsManager->appPrefs.colorPrefs.DCMSset.DefaultMonitorProfile;
+		if (MonitorProfiles.contains(displayProfile))
+			monitorProfile = defaultEngine.openProfileFromFile( MonitorProfiles[displayProfile] );
+	}
+	if (monitorProfile.isNull())
+	{
+		prefsManager->appPrefs.colorPrefs.DCMSset.DefaultMonitorProfile = defaultRGBString;
+		monitorProfile = defaultRGBProfile;
+	}
+
+	// Now create default color transforms (used mainly when color management is "disabled")
 	int dcmsFlags        = Ctf_BlackPointCompensation;
 	eRenderIntent intent = Intent_Relative_Colorimetric;
 
@@ -502,32 +529,44 @@
 		ProfilesL::Iterator ip;
 		if ((prefsManager->appPrefs.colorPrefs.DCMSset.DefaultImageRGBProfile.isEmpty()) || (!InputProfiles.contains(prefsManager->appPrefs.colorPrefs.DCMSset.DefaultImageRGBProfile)))
 		{
-			ip = InputProfiles.begin();
+			ip = InputProfiles.find("sRGB IEC61966-2.1");
+			if (ip == InputProfiles.end())
+				ip = InputProfiles.begin();
 			prefsManager->appPrefs.colorPrefs.DCMSset.DefaultImageRGBProfile = ip.key();
 		}
 		if ((prefsManager->appPrefs.colorPrefs.DCMSset.DefaultImageCMYKProfile.isEmpty()) || (!InputProfilesCMYK.contains(prefsManager->appPrefs.colorPrefs.DCMSset.DefaultImageCMYKProfile)))
 		{
-			ip = InputProfilesCMYK.begin();
+			ip = InputProfilesCMYK.find("Fogra27L CMYK Coated Press");
+			if (ip == InputProfilesCMYK.end())
+				ip = InputProfilesCMYK.begin();
 			prefsManager->appPrefs.colorPrefs.DCMSset.DefaultImageCMYKProfile = ip.key();
 		}
 		if ((prefsManager->appPrefs.colorPrefs.DCMSset.DefaultSolidColorRGBProfile.isEmpty()) || (!InputProfiles.contains(prefsManager->appPrefs.colorPrefs.DCMSset.DefaultSolidColorRGBProfile)))
 		{
-			ip = InputProfiles.begin();
+			ip = InputProfiles.find("sRGB IEC61966-2.1");
+			if (ip == InputProfiles.end())
+				ip = InputProfiles.begin();
 			prefsManager->appPrefs.colorPrefs.DCMSset.DefaultSolidColorRGBProfile = ip.key();
 		}
 		if ((prefsManager->appPrefs.colorPrefs.DCMSset.DefaultSolidColorCMYKProfile.isEmpty()) || (!InputProfilesCMYK.contains(prefsManager->appPrefs.colorPrefs.DCMSset.DefaultSolidColorCMYKProfile)))
 		{
-			ip = InputProfilesCMYK.begin();
+			ip = InputProfilesCMYK.find("Fogra27L CMYK Coated Press");
+			if (ip == InputProfilesCMYK.end())
+				ip = InputProfilesCMYK.begin();
 			prefsManager->appPrefs.colorPrefs.DCMSset.DefaultSolidColorCMYKProfile = ip.key();
 		}
 		if ((prefsManager->appPrefs.colorPrefs.DCMSset.DefaultMonitorProfile.isEmpty()) || (!MonitorProfiles.contains(prefsManager->appPrefs.colorPrefs.DCMSset.DefaultMonitorProfile)))
 		{
-			ip = MonitorProfiles.begin();
+			ip = MonitorProfiles.find("sRGB IEC61966-2.1");
+			if (ip == MonitorProfiles.end())
+				ip = MonitorProfiles.begin();
 			prefsManager->appPrefs.colorPrefs.DCMSset.DefaultMonitorProfile = ip.key();
 		}
 		if ((prefsManager->appPrefs.colorPrefs.DCMSset.DefaultPrinterProfile.isEmpty()) || (!PrinterProfiles.contains(prefsManager->appPrefs.colorPrefs.DCMSset.DefaultPrinterProfile)))
 		{
-			ip = PrinterProfiles.begin();
+			ip = PrinterProfiles.find("Fogra27L CMYK Coated Press");
+			if (ip == PrinterProfiles.end())
+				ip = PrinterProfiles.begin();
 			prefsManager->appPrefs.colorPrefs.DCMSset.DefaultPrinterProfile = ip.key();
 		}
 		InitDefaultColorTransforms();
Index: scribus/colormngt/sclcmscolormngtengineimpl.cpp
===================================================================
--- scribus/colormngt/sclcmscolormngtengineimpl.cpp	(revision 14280)
+++ scribus/colormngt/sclcmscolormngtengineimpl.cpp	(revision 14281)
@@ -200,7 +200,11 @@
 
 ScColorProfile ScLcmsColorMngtEngineImpl::createProfile_sRGB(ScColorMngtEngine& engine)
 {
-	ScColorProfile profile;
+	QString internalProfilePath("memprofile://Internal sRGB profile");
+	ScColorProfile profile = m_profileCache->profile(internalProfilePath);
+	if (!profile.isNull())
+		return profile;
+
 	cmsHPROFILE lcmsProf = NULL;
 	cmsSetErrorHandler(&cmsErrorHandler);
 	try
@@ -209,8 +213,9 @@
 		if (lcmsProf)
 		{
 			ScLcmsColorProfileImpl* profData = new ScLcmsColorProfileImpl(engine, lcmsProf);
-			profData->m_profilePath = QString("memprofile://Internal sRGB profile");
+			profData->m_profilePath = internalProfilePath;
 			profile = ScColorProfile(dynamic_cast<ScColorProfileData*>(profData));
+			m_profileCache->addProfile(profile);
 		}
 		if (profile.isNull() && lcmsProf)
 		{
@@ -231,7 +236,11 @@
 
 ScColorProfile ScLcmsColorMngtEngineImpl::createProfile_Lab(ScColorMngtEngine& engine)
 {
-	ScColorProfile profile;
+	QString internalProfilePath("memprofile://Internal Lab profile");
+	ScColorProfile profile = m_profileCache->profile(internalProfilePath);
+	if (!profile.isNull())
+		return profile;
+
 	cmsHPROFILE lcmsProf = NULL;
 	cmsSetErrorHandler(&cmsErrorHandler);
 	try
@@ -240,8 +249,9 @@
 		if (lcmsProf)
 		{
 			ScLcmsColorProfileImpl* profData = new ScLcmsColorProfileImpl(engine, lcmsProf);
-			profData->m_profilePath = QString("memprofile://Internal Lab profile");
+			profData->m_profilePath = internalProfilePath;
 			profile = ScColorProfile(dynamic_cast<ScColorProfileData*>(profData));
+			m_profileCache->addProfile(profile);
 		}
 		if (profile.isNull() && lcmsProf)
 		{
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp	(revision 14280)
+++ scribus/scribusdoc.cpp	(revision 14281)
@@ -631,7 +631,7 @@
 	DocInputCMYKProf      = ScCore->defaultCMYKProfile;
 	DocInputImageRGBProf  = ScCore->defaultRGBProfile;
 	DocInputImageCMYKProf = ScCore->defaultCMYKProfile;
-	DocOutputProf         = ScCore->defaultRGBProfile;
+	DocDisplayProf        = ScCore->defaultRGBProfile;
 	DocPrinterProf        = ScCore->defaultCMYKProfile;
 	stdTransRGBMon        = ScCore->defaultRGBToScreenSolidTrans;
 	stdTransCMYKMon       = ScCore->defaultCMYKToRGBTrans;
@@ -657,13 +657,13 @@
 	colorStrategy.useBlackPreservation      = false;
 	colorEngine.setStrategy(colorStrategy);
 
+	DocDisplayProf   = ScCore->monitorProfile;
 	DocInputRGBProf  = colorEngine.openProfileFromFile( InPo[CMSSettings.DefaultSolidColorRGBProfile] );
 	DocInputCMYKProf = colorEngine.openProfileFromFile( InPoCMYK[CMSSettings.DefaultSolidColorCMYKProfile] );
-	DocOutputProf    = colorEngine.openProfileFromFile( MoPo[CMSSettings.DefaultMonitorProfile] );
 	DocPrinterProf   = colorEngine.openProfileFromFile( PrPo[CMSSettings.DefaultPrinterProfile] );
 	DocInputImageRGBProf  = colorEngine.openProfileFromFile( InPo[CMSSettings.DefaultImageRGBProfile] );
 	DocInputImageCMYKProf = colorEngine.openProfileFromFile( InPoCMYK[CMSSettings.DefaultImageCMYKProfile] );
-	if ((!DocInputRGBProf) || (!DocInputCMYKProf) || (!DocOutputProf) || (!DocPrinterProf) || (!DocInputImageCMYKProf) || (!DocInputImageRGBProf))
+	if ((!DocDisplayProf) || (!DocInputRGBProf) || (!DocInputCMYKProf) || (!DocPrinterProf) || (!DocInputImageCMYKProf) || (!DocInputImageRGBProf))
 	{
 		CMSSettings.CMSinUse = false;
 		return false;
@@ -679,20 +679,20 @@
 		dcmsFlagsGC |= Ctf_BlackPointCompensation;
 	}
 	stdTransRGBMon  = colorEngine.createTransform(DocInputRGBProf, Format_RGB_16,
-										DocOutputProf, Format_RGB_16,
+										DocDisplayProf, Format_RGB_16,
 										IntentColors, dcmsFlags);
 	stdTransCMYKMon = colorEngine.createTransform(DocInputCMYKProf, Format_CMYK_16,
-										DocOutputProf, Format_RGB_16,
+										DocDisplayProf, Format_RGB_16,
 										IntentColors, dcmsFlags);
 	// TODO : check input profiles used for images
 	stdProofImg = colorEngine.createProofingTransform(DocInputImageRGBProf, Format_RGBA_8,
-	                  DocOutputProf, Format_RGBA_8, DocPrinterProf,
+	                  DocDisplayProf, Format_RGBA_8, DocPrinterProf,
 	                  IntentImages, Intent_Relative_Colorimetric, dcmsFlagsGC);
 	stdProofImgCMYK = colorEngine.createProofingTransform(DocInputImageCMYKProf, Format_CMYK_8,
-	                  DocOutputProf, Format_RGBA_8, DocPrinterProf,
+	                  DocDisplayProf, Format_RGBA_8, DocPrinterProf,
 	                  IntentImages, Intent_Relative_Colorimetric, dcmsFlagsGC);
 	stdTransImg = colorEngine.createTransform(DocInputRGBProf, Format_RGBA_8,
-	                  DocOutputProf, Format_RGBA_8, 
+	                  DocDisplayProf, Format_RGBA_8, 
 					  IntentImages, dcmsFlags);
 	stdTransRGB = colorEngine.createTransform(DocInputCMYKProf, Format_CMYK_16,
 					  DocInputRGBProf, Format_RGB_16,
@@ -716,20 +716,20 @@
 		inputProfCMYK = DocInputCMYKProf;
 	}
 	stdProof = colorEngine.createProofingTransform(inputProfRGB, Format_RGB_16,
-	                    DocOutputProf, Format_RGB_16,
+	                    DocDisplayProf, Format_RGB_16,
 	                    DocPrinterProf,
 	                    IntentColors,
 	                    Intent_Relative_Colorimetric, dcmsFlags);
 	stdProofGC = colorEngine.createProofingTransform(inputProfRGB, Format_RGB_16,
-	                    DocOutputProf, Format_RGB_16,
+	                    DocDisplayProf, Format_RGB_16,
 	                    DocPrinterProf, IntentColors,
 	                    Intent_Relative_Colorimetric, dcmsFlags| Ctf_GamutCheck);
 	stdProofCMYK = colorEngine.createProofingTransform(inputProfCMYK, Format_CMYK_16,
-						DocOutputProf, Format_RGB_16,
+						DocDisplayProf, Format_RGB_16,
 						DocPrinterProf, IntentColors,
 						Intent_Relative_Colorimetric, dcmsFlags);
 	stdProofCMYKGC = colorEngine.createProofingTransform(inputProfCMYK, Format_CMYK_16,
-						DocOutputProf, Format_RGB_16,
+						DocDisplayProf, Format_RGB_16,
 						DocPrinterProf,
 						IntentColors,
 						Intent_Relative_Colorimetric, dcmsFlags | Ctf_GamutCheck);
Index: scribus/cmsettings.cpp
===================================================================
--- scribus/cmsettings.cpp	(revision 14280)
+++ scribus/cmsettings.cpp	(revision 14281)
@@ -125,7 +125,7 @@
 ScColorProfile CMSettings::monitorProfile() const
 {
 	if (m_Doc)
-		return m_Doc->DocOutputProf;
+		return m_Doc->DocDisplayProf;
 	return ScColorProfile();
 }
 
Index: scribus/scribusdoc.h
===================================================================
--- scribus/scribusdoc.h	(revision 14280)
+++ scribus/scribusdoc.h	(revision 14281)
@@ -1033,7 +1033,7 @@
 	ScColorProfile DocInputImageCMYKProf;
 	ScColorProfile DocInputRGBProf;
 	ScColorProfile DocInputCMYKProf;
-	ScColorProfile DocOutputProf;
+	ScColorProfile DocDisplayProf;
 	ScColorProfile DocPrinterProf;
 	ScColorTransform stdTransRGBMon;
 	ScColorTransform stdTransCMYKMon;
Index: scribus/ui/preview.cpp
===================================================================
--- scribus/ui/preview.cpp	(revision 14280)
+++ scribus/ui/preview.cpp	(revision 14281)
@@ -1065,7 +1065,7 @@
 					QRgb alphaFF = qRgba(0,0,0,255);
 					QRgb alphaOO = qRgba(255,255,255,0);
 					ScColorMngtEngine engine = doc->colorEngine;
-					ScColorTransform transCMYK = engine.createTransform(doc->DocPrinterProf, Format_YMCK_8, doc->DocOutputProf, Format_BGRA_8, Intent_Relative_Colorimetric, 0);
+					ScColorTransform transCMYK = engine.createTransform(doc->DocPrinterProf, Format_YMCK_8, doc->DocDisplayProf, Format_BGRA_8, Intent_Relative_Colorimetric, 0);
 					for( int yi=0; yi < h2; ++yi )
 					{
 						uchar* ptr = image.scanLine( yi );
@@ -1127,7 +1127,7 @@
 					QRgb alphaFF = qRgba(0,0,0,255);
 					QRgb alphaOO = qRgba(255,255,255,0);
 					ScColorMngtEngine engine = doc->colorEngine;
-					ScColorTransform transCMYK = engine.createTransform(doc->DocPrinterProf, Format_YMCK_8, doc->DocOutputProf, Format_BGRA_8, Intent_Relative_Colorimetric, 0);
+					ScColorTransform transCMYK = engine.createTransform(doc->DocPrinterProf, Format_YMCK_8, doc->DocDisplayProf, Format_BGRA_8, Intent_Relative_Colorimetric, 0);
 					for (int y=0; y < h2; ++y )
 					{
 						uchar* ptr = image.scanLine( y );
Index: scribus/ui/prefs_colormanagement.cpp
===================================================================
--- scribus/ui/prefs_colormanagement.cpp	(revision 14280)
+++ scribus/ui/prefs_colormanagement.cpp	(revision 14281)
@@ -6,16 +6,23 @@
 */
 
 #include "prefs_colormanagement.h"
+#include "prefsstructs.h"
 #include "scribusstructs.h"
-#include "prefsstructs.h"
+#include "scribuscore.h"
 
 Prefs_ColorManagement::Prefs_ColorManagement(QWidget* parent)
 	: Prefs_Pane(parent)
 {
+	m_canChangeMonitorProfile = !ScCore->primaryMainWindow()->HaveDoc; 
 	setupUi(this);
 	languageChange();
 	connect(activateCMCheckBox, SIGNAL(clicked(bool)), this, SLOT(cmActivated(bool)));
 	connect(simulatePrinterOnScreenCheckBox, SIGNAL(clicked(bool)), this, SLOT(simulatePrinter(bool)));
+	if (!m_canChangeMonitorProfile)
+	{
+		monitorProfileComboBox->setVisible(false);
+		monitorLabel->setText( tr("Monitor profile can only be changed when no document are currently opened.") );
+	}
 }
 
 Prefs_ColorManagement::~Prefs_ColorManagement()
@@ -112,8 +119,12 @@
 	prefsData->colorPrefs.DCMSset.DefaultImageCMYKProfile = cmykImageProfileComboBox->currentText();
 	prefsData->colorPrefs.DCMSset.DefaultSolidColorRGBProfile = rgbSolidProfileComboBox->currentText();
 	prefsData->colorPrefs.DCMSset.DefaultSolidColorCMYKProfile = cmykSolidProfileComboBox->currentText();
-	prefsData->colorPrefs.DCMSset.DefaultMonitorProfile = monitorProfileComboBox->currentText();
 	prefsData->colorPrefs.DCMSset.DefaultPrinterProfile = printerProfileComboBox->currentText();
+
+	if (m_canChangeMonitorProfile)
+	{
+		prefsData->colorPrefs.DCMSset.DefaultMonitorProfile = monitorProfileComboBox->currentText();
+	}
 }
 
 void Prefs_ColorManagement::cmActivated(bool active)
@@ -128,7 +139,7 @@
 	cmykImageProfileComboBox->setEnabled( active );
 	rgbSolidProfileComboBox->setEnabled( active );
 	cmykSolidProfileComboBox->setEnabled( active );
-	monitorProfileComboBox->setEnabled( active );
+	monitorProfileComboBox->setEnabled( m_canChangeMonitorProfile );
 	printerProfileComboBox->setEnabled( active );
 }
 
Index: scribus/ui/prefs_colormanagement.h
===================================================================
--- scribus/ui/prefs_colormanagement.h	(revision 14280)
+++ scribus/ui/prefs_colormanagement.h	(revision 14281)
@@ -25,6 +25,9 @@
 		void setProfiles(struct ApplicationPrefs *prefsData, ProfilesL *inputProfiles, ProfilesL *inputProfilesCMYK, ProfilesL *printerProfiles, ProfilesL *monitorProfiles);
 		virtual void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const;
 
+	protected:
+		bool m_canChangeMonitorProfile;
+
 	public slots:
 		void languageChange();
 
Index: scribus/ui/cmsprefsbase.ui
===================================================================
--- scribus/ui/cmsprefsbase.ui	(revision 14280)
+++ scribus/ui/cmsprefsbase.ui	(revision 14281)
@@ -1,208 +1,164 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>CMSPrefsBase</class>
- <widget class="QWidget" name="CMSPrefsBase" >
-  <property name="geometry" >
+ <widget class="QWidget" name="CMSPrefsBase">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>327</width>
-    <height>421</height>
+    <width>308</width>
+    <height>467</height>
    </rect>
   </property>
-  <property name="sizePolicy" >
-   <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>Form</string>
   </property>
-  <layout class="QVBoxLayout" >
-   <property name="spacing" >
+  <layout class="QVBoxLayout">
+   <property name="spacing">
     <number>5</number>
    </property>
-   <property name="leftMargin" >
+   <property name="margin">
     <number>0</number>
    </property>
-   <property name="topMargin" >
-    <number>0</number>
-   </property>
-   <property name="rightMargin" >
-    <number>0</number>
-   </property>
-   <property name="bottomMargin" >
-    <number>0</number>
-   </property>
    <item>
-    <widget class="QCheckBox" name="checkBox1" >
-     <property name="text" >
+    <widget class="QCheckBox" name="checkBox1">
+     <property name="text">
       <string>&amp;Activate Color Management</string>
      </property>
     </widget>
    </item>
    <item>
-    <widget class="QGroupBox" name="sysProfiles" >
-     <property name="enabled" >
+    <widget class="QGroupBox" name="docProfiles">
+     <property name="enabled">
       <bool>false</bool>
      </property>
-     <property name="title" >
-      <string>System Profiles</string>
+     <property name="title">
+      <string>Document Profiles</string>
      </property>
-     <layout class="QGridLayout" >
-      <property name="leftMargin" >
+     <layout class="QGridLayout">
+      <property name="margin">
        <number>10</number>
       </property>
-      <property name="topMargin" >
-       <number>10</number>
-      </property>
-      <property name="rightMargin" >
-       <number>10</number>
-      </property>
-      <property name="bottomMargin" >
-       <number>10</number>
-      </property>
-      <property name="horizontalSpacing" >
+      <property name="spacing">
        <number>5</number>
       </property>
-      <property name="verticalSpacing" >
-       <number>5</number>
-      </property>
-      <item row="0" column="0" >
-       <widget class="QLabel" name="text1" >
-        <property name="text" >
+      <item row="0" column="0">
+       <widget class="QLabel" name="text1">
+        <property name="text">
          <string>&amp;RGB Images:</string>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>inputPRGBIm</cstring>
         </property>
        </widget>
       </item>
-      <item row="0" column="1" >
-       <widget class="QComboBox" name="inputPRGBIm" >
-        <property name="minimumSize" >
+      <item row="0" column="1">
+       <widget class="QComboBox" name="inputPRGBIm">
+        <property name="minimumSize">
          <size>
           <width>190</width>
           <height>0</height>
          </size>
         </property>
-        <property name="toolTip" >
+        <property name="toolTip">
          <string>Default color profile for imported RGB images</string>
         </property>
        </widget>
       </item>
-      <item row="1" column="0" >
-       <widget class="QLabel" name="text1CMYK" >
-        <property name="text" >
+      <item row="1" column="0">
+       <widget class="QLabel" name="text1CMYK">
+        <property name="text">
          <string>&amp;CMYK Images:</string>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>inputPCMYKIm</cstring>
         </property>
        </widget>
       </item>
-      <item row="1" column="1" >
-       <widget class="QComboBox" name="inputPCMYKIm" >
-        <property name="minimumSize" >
+      <item row="1" column="1">
+       <widget class="QComboBox" name="inputPCMYKIm">
+        <property name="minimumSize">
          <size>
           <width>190</width>
           <height>0</height>
          </size>
         </property>
-        <property name="toolTip" >
+        <property name="toolTip">
          <string>Default color profile for imported CMYK images</string>
         </property>
        </widget>
       </item>
-      <item row="2" column="0" >
-       <widget class="QLabel" name="text4" >
-        <property name="text" >
+      <item row="2" column="0">
+       <widget class="QLabel" name="text4">
+        <property name="text">
          <string>&amp;RGB Solid Colors:</string>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>inputPRGB</cstring>
         </property>
        </widget>
       </item>
-      <item row="2" column="1" >
-       <widget class="QComboBox" name="inputPRGB" >
-        <property name="minimumSize" >
+      <item row="2" column="1">
+       <widget class="QComboBox" name="inputPRGB">
+        <property name="minimumSize">
          <size>
           <width>190</width>
           <height>0</height>
          </size>
         </property>
-        <property name="toolTip" >
+        <property name="toolTip">
          <string>Default color profile for solid RGB colors on the page</string>
         </property>
        </widget>
       </item>
-      <item row="3" column="0" >
-       <widget class="QLabel" name="text5" >
-        <property name="text" >
+      <item row="3" column="0">
+       <widget class="QLabel" name="text5">
+        <property name="text">
          <string>&amp;CMYK Solid Colors:</string>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>inputPCMYK</cstring>
         </property>
        </widget>
       </item>
-      <item row="3" column="1" >
-       <widget class="QComboBox" name="inputPCMYK" >
-        <property name="minimumSize" >
+      <item row="3" column="1">
+       <widget class="QComboBox" name="inputPCMYK">
+        <property name="minimumSize">
          <size>
           <width>190</width>
           <height>0</height>
          </size>
         </property>
-        <property name="toolTip" >
+        <property name="toolTip">
          <string>Default color profile for solid CMYK colors on the page</string>
         </property>
        </widget>
       </item>
-      <item row="4" column="0" >
-       <widget class="QLabel" name="text2" >
-        <property name="text" >
-         <string>&amp;Monitor:</string>
-        </property>
-        <property name="buddy" >
-         <cstring>monitorP</cstring>
-        </property>
-       </widget>
-      </item>
-      <item row="4" column="1" >
-       <widget class="QComboBox" name="monitorP" >
-        <property name="minimumSize" >
-         <size>
-          <width>190</width>
-          <height>0</height>
-         </size>
-        </property>
-        <property name="toolTip" >
-         <string>Color profile that you have generated or received from the manufacturer.
-This profile should be specific to your monitor and not a generic profile (i.e. sRGB).</string>
-        </property>
-       </widget>
-      </item>
-      <item row="5" column="0" >
-       <widget class="QLabel" name="text3" >
-        <property name="text" >
+      <item row="4" column="0">
+       <widget class="QLabel" name="text3">
+        <property name="text">
          <string>P&amp;rinter:</string>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>printerP</cstring>
         </property>
        </widget>
       </item>
-      <item row="5" column="1" >
-       <widget class="QComboBox" name="printerP" >
-        <property name="minimumSize" >
+      <item row="4" column="1">
+       <widget class="QComboBox" name="printerP">
+        <property name="minimumSize">
          <size>
           <width>190</width>
           <height>0</height>
          </size>
         </property>
-        <property name="toolTip" >
+        <property name="toolTip">
          <string>Color profile for your printer model from the manufacturer.
 This profile should be specific to your printer and not a generic profile (i.e. sRGB).</string>
         </property>
@@ -212,75 +168,63 @@
     </widget>
    </item>
    <item>
-    <widget class="QGroupBox" name="renderInt" >
-     <property name="enabled" >
+    <widget class="QGroupBox" name="renderInt">
+     <property name="enabled">
       <bool>false</bool>
      </property>
-     <property name="title" >
-      <string>Rendering Intents</string>
+     <property name="title">
+      <string>Docuemnt Rendering Intents</string>
      </property>
-     <layout class="QGridLayout" >
-      <property name="leftMargin" >
+     <layout class="QGridLayout">
+      <property name="margin">
        <number>10</number>
       </property>
-      <property name="topMargin" >
-       <number>10</number>
-      </property>
-      <property name="rightMargin" >
-       <number>10</number>
-      </property>
-      <property name="bottomMargin" >
-       <number>10</number>
-      </property>
-      <property name="horizontalSpacing" >
+      <property name="spacing">
        <number>5</number>
       </property>
-      <property name="verticalSpacing" >
-       <number>5</number>
-      </property>
-      <item row="0" column="0" >
-       <widget class="QLabel" name="text21" >
-        <property name="text" >
+      <item row="0" column="0">
+       <widget class="QLabel" name="text21">
+        <property name="text">
          <string>Images:</string>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>imagesI</cstring>
         </property>
        </widget>
       </item>
-      <item row="0" column="1" >
-       <widget class="QComboBox" name="imagesI" >
-        <property name="minimumSize" >
+      <item row="0" column="1">
+       <widget class="QComboBox" name="imagesI">
+        <property name="minimumSize">
          <size>
           <width>190</width>
           <height>0</height>
          </size>
         </property>
-        <property name="toolTip" >
+        <property name="toolTip">
          <string>Default rendering intent for images. Unless you know why to change it,
 Relative Colorimetric or Perceptual should be chosen.</string>
         </property>
        </widget>
       </item>
-      <item row="1" column="0" >
-       <widget class="QLabel" name="text22" >
-        <property name="text" >
+      <item row="1" column="0">
+       <widget class="QLabel" name="text22">
+        <property name="text">
          <string>Sol&amp;id Colors:</string>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>colorsI</cstring>
         </property>
        </widget>
       </item>
-      <item row="1" column="1" >
-       <widget class="QComboBox" name="colorsI" >
-        <property name="minimumSize" >
+      <item row="1" column="1">
+       <widget class="QComboBox" name="colorsI">
+        <property name="minimumSize">
          <size>
           <width>190</width>
           <height>0</height>
          </size>
         </property>
-        <property name="toolTip" >
+        <property name="toolTip">
          <string>Default rendering intent for solid colors. Unless you know why to change it,
 Relative Colorimetric or Perceptual should be chosen.</string>
         </property>
@@ -290,57 +234,69 @@
     </widget>
    </item>
    <item>
-    <widget class="QGroupBox" name="simulate" >
-     <property name="enabled" >
+    <widget class="QGroupBox" name="docOptions">
+     <property name="enabled">
       <bool>false</bool>
      </property>
-     <property name="toolTip" >
-      <string>Enable 'soft proofing' of how your document colors will print,
-based on the chosen printer profile.</string>
+     <property name="toolTip">
+      <string/>
      </property>
-     <property name="title" >
-      <string>Sim&amp;ulate Printer on the Screen</string>
+     <property name="title">
+      <string>Document Options</string>
      </property>
-     <property name="checkable" >
-      <bool>true</bool>
+     <property name="checkable">
+      <bool>false</bool>
      </property>
-     <property name="checked" >
+     <property name="checked">
       <bool>false</bool>
      </property>
-     <layout class="QVBoxLayout" >
-      <property name="spacing" >
+     <layout class="QVBoxLayout">
+      <property name="spacing">
        <number>5</number>
       </property>
-      <property name="leftMargin" >
+      <property name="margin">
        <number>10</number>
       </property>
-      <property name="topMargin" >
-       <number>10</number>
-      </property>
-      <property name="rightMargin" >
-       <number>10</number>
-      </property>
-      <property name="bottomMargin" >
-       <number>10</number>
-      </property>
       <item>
-       <widget class="QCheckBox" name="convertAll" >
-        <property name="toolTip" >
+       <widget class="QCheckBox" name="blackPoint">
+        <property name="toolTip">
+         <string>Black Point Compensation is a method of improving contrast in photos.
+It is recommended that you enable this if you have photos in your document.</string>
+        </property>
+        <property name="text">
+         <string>Use &amp;Blackpoint Compensation</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="simulatePrinter">
+        <property name="toolTip">
+         <string>Enable 'soft proofing' of how your document colors will print,
+based on the chosen printer profile.</string>
+        </property>
+        <property name="text">
+         <string>Simulate printer on Screen</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="convertAll">
+        <property name="toolTip">
          <string>Simulate a full color managed environment :
 all colors, rgb or cmyk, are converted to printer color space.</string>
         </property>
-        <property name="text" >
+        <property name="text">
          <string>Convert all colors to printer space</string>
         </property>
        </widget>
       </item>
       <item>
-       <widget class="QCheckBox" name="gamutC" >
-        <property name="toolTip" >
+       <widget class="QCheckBox" name="gamutCheck">
+        <property name="toolTip">
          <string>Method of showing colors on the screen which may not print properly.
 This requires very accurate profiles and serves only as a warning.</string>
         </property>
-        <property name="text" >
+        <property name="text">
          <string>Mark Colors out of &amp;Gamut</string>
         </property>
        </widget>
@@ -349,86 +305,49 @@
     </widget>
    </item>
    <item>
-    <widget class="QCheckBox" name="blackP" >
-     <property name="enabled" >
+    <widget class="QGroupBox" name="monProfile">
+     <property name="enabled">
       <bool>false</bool>
      </property>
-     <property name="toolTip" >
-      <string>Black Point Compensation is a method of improving contrast in photos.
-It is recommended that you enable this if you have photos in your document.</string>
+     <property name="title">
+      <string>Monitor Profile</string>
      </property>
-     <property name="text" >
-      <string>Use &amp;Blackpoint Compensation</string>
-     </property>
+     <layout class="QGridLayout" name="gridLayout_2">
+      <property name="margin">
+       <number>10</number>
+      </property>
+      <property name="spacing">
+       <number>5</number>
+      </property>
+      <item row="0" column="0">
+       <widget class="QLabel" name="monitorProfileLabel">
+        <property name="text">
+         <string>&amp;Monitor:</string>
+        </property>
+        <property name="buddy">
+         <cstring>monitorP</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QComboBox" name="monitorP">
+        <property name="minimumSize">
+         <size>
+          <width>190</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="toolTip">
+         <string>Color profile that you have generated or received from the manufacturer.
+This profile should be specific to your monitor and not a generic profile (i.e. sRGB).</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
     </widget>
    </item>
   </layout>
  </widget>
  <resources/>
- <connections>
-  <connection>
-   <sender>checkBox1</sender>
-   <signal>clicked(bool)</signal>
-   <receiver>sysProfiles</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>162</x>
-     <y>17</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>161</x>
-     <y>42</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>checkBox1</sender>
-   <signal>clicked(bool)</signal>
-   <receiver>renderInt</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>114</x>
-     <y>28</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>99</x>
-     <y>253</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>checkBox1</sender>
-   <signal>clicked(bool)</signal>
-   <receiver>simulate</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>220</x>
-     <y>24</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>196</x>
-     <y>346</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>checkBox1</sender>
-   <signal>clicked(bool)</signal>
-   <receiver>blackP</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>248</x>
-     <y>23</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>157</x>
-     <y>450</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
+ <connections/>
 </ui>
Index: scribus/ui/cmsprefs.cpp
===================================================================
--- scribus/ui/cmsprefs.cpp	(revision 14280)
+++ scribus/ui/cmsprefs.cpp	(revision 14281)
@@ -5,17 +5,26 @@
 for which a new license (GPL+exception) is in place.
 */
 #include "cmsprefs.h"
+#include "scribuscore.h"
 #include "scribusdoc.h"
 #include "scribusstructs.h"
 
 CMSPrefs::CMSPrefs( QWidget* parent, CMSData *Vor, ProfilesL *InputProfiles, ProfilesL *InputProfilesCMYK, ProfilesL *PrinterProfiles, ProfilesL *MonitorProfiles)
 	: QWidget( parent )
 {
+	m_canChangeMonitorProfile = !ScCore->primaryMainWindow()->HaveDoc;
 	prefs = Vor;
 	changed = false;
 	setupUi(this);
 	restoreDefaults(prefs, InputProfiles, InputProfilesCMYK, PrinterProfiles, MonitorProfiles);
-	connect( checkBox1, SIGNAL( clicked() ), this, SLOT( slotCMSon() ) );
+	connect( checkBox1, SIGNAL( clicked(bool) ), this, SLOT( slotCMSon(bool) ) );
+
+	monProfile->setEnabled(m_canChangeMonitorProfile);
+	if (!m_canChangeMonitorProfile)
+	{
+		monitorP->setVisible(false);
+		monitorProfileLabel->setText( tr("Monitor profile can only be changed when no document are currently opened.") );
+	}
 }
 
 void CMSPrefs::restoreDefaults(CMSData *prefs, ProfilesL *InputProfiles, ProfilesL *InputProfilesCMYK, ProfilesL *PrinterProfiles, ProfilesL *MonitorProfiles)
@@ -78,15 +87,15 @@
 		colorsI->addItem(tmp_mp[prop]);
 	colorsI->setCurrentIndex(prefs->DefaultIntentColors);
 
-	simulate->setChecked(prefs->SoftProofOn);
+	simulatePrinter->setChecked(prefs->SoftProofOn);
 	convertAll->setChecked(prefs->SoftProofFullOn);
-	gamutC->setChecked(prefs->GamutCheck);
-	blackP->setChecked(prefs->BlackPoint);
+	gamutCheck->setChecked(prefs->GamutCheck);
+	blackPoint->setChecked(prefs->BlackPoint);
 
-	simulate->setEnabled( checkBox1->isChecked() );
-	blackP->setEnabled( checkBox1->isChecked() );
-	sysProfiles->setEnabled( checkBox1->isChecked() );
+	docOptions->setEnabled( checkBox1->isChecked() );
+	docProfiles->setEnabled( checkBox1->isChecked() );
 	renderInt->setEnabled( checkBox1->isChecked() );
+	monProfile->setEnabled( m_canChangeMonitorProfile );
 }
 
 void CMSPrefs::setValues()
@@ -99,25 +108,28 @@
 		(prefs->DefaultPrinterProfile != printerP->currentText()) ||
 		(prefs->DefaultIntentColors != colorsI->currentIndex()) ||
 		(prefs->DefaultIntentImages != imagesI->currentIndex()) ||
-		(prefs->SoftProofOn != simulate->isChecked()) ||
+		(prefs->SoftProofOn != simulatePrinter->isChecked()) ||
 		(prefs->SoftProofFullOn != convertAll->isChecked()) ||
-		(prefs->GamutCheck != gamutC->isChecked()) ||
-		(prefs->BlackPoint != blackP->isChecked()) ||
+		(prefs->GamutCheck != gamutCheck->isChecked()) ||
+		(prefs->BlackPoint != blackPoint->isChecked()) ||
 		(prefs->CMSinUse != checkBox1->isChecked()))
 			changed = true;
 	prefs->DefaultImageRGBProfile = inputPRGBIm->currentText();
 	prefs->DefaultImageCMYKProfile = inputPCMYKIm->currentText();
 	prefs->DefaultSolidColorRGBProfile = inputPRGB->currentText();
 	prefs->DefaultSolidColorCMYKProfile = inputPCMYK->currentText();
-	prefs->DefaultMonitorProfile = monitorP->currentText();
 	prefs->DefaultPrinterProfile = printerP->currentText();
 	prefs->DefaultIntentColors = (eRenderIntent) colorsI->currentIndex();
 	prefs->DefaultIntentImages = (eRenderIntent) imagesI->currentIndex();
-	prefs->SoftProofOn = simulate->isChecked();
+	prefs->SoftProofOn = simulatePrinter->isChecked();
 	prefs->SoftProofFullOn = convertAll->isChecked();
-	prefs->GamutCheck = gamutC->isChecked();
+	prefs->GamutCheck = gamutCheck->isChecked();
 	prefs->CMSinUse = checkBox1->isChecked();
-	prefs->BlackPoint = blackP->isChecked();
+	prefs->BlackPoint = blackPoint->isChecked();
+	if (m_canChangeMonitorProfile)
+	{
+		prefs->DefaultMonitorProfile = monitorP->currentText();
+	}
 }
 
 void CMSPrefs::updateDocSettings(ScribusDoc* doc)
@@ -126,33 +138,35 @@
 		(doc->CMSSettings.DefaultImageCMYKProfile != inputPCMYKIm->currentText()) ||
 		(doc->CMSSettings.DefaultSolidColorRGBProfile != inputPRGB->currentText()) ||
 		(doc->CMSSettings.DefaultSolidColorCMYKProfile != inputPCMYK->currentText()) ||
-		(doc->CMSSettings.DefaultMonitorProfile != monitorP->currentText()) ||
 		(doc->CMSSettings.DefaultPrinterProfile != printerP->currentText()) ||
 		(doc->CMSSettings.DefaultIntentColors != colorsI->currentIndex()) ||
 		(doc->CMSSettings.DefaultIntentImages != imagesI->currentIndex()) ||
-		(doc->CMSSettings.SoftProofOn != simulate->isChecked()) ||
+		(doc->CMSSettings.SoftProofOn != simulatePrinter->isChecked()) ||
 		(doc->CMSSettings.SoftProofFullOn != convertAll->isChecked()) ||
-		(doc->CMSSettings.GamutCheck != gamutC->isChecked()) ||
-		(doc->CMSSettings.BlackPoint != blackP->isChecked()) ||
+		(doc->CMSSettings.GamutCheck != gamutCheck->isChecked()) ||
+		(doc->CMSSettings.BlackPoint != blackPoint->isChecked()) ||
 		(doc->CMSSettings.CMSinUse != checkBox1->isChecked()))
 			changed = true;
 	doc->CMSSettings.DefaultImageRGBProfile = inputPRGBIm->currentText();
 	doc->CMSSettings.DefaultImageCMYKProfile = inputPCMYKIm->currentText();
 	doc->CMSSettings.DefaultSolidColorRGBProfile = inputPRGB->currentText();
 	doc->CMSSettings.DefaultSolidColorCMYKProfile = inputPCMYK->currentText();
-	doc->CMSSettings.DefaultMonitorProfile = monitorP->currentText();
 	doc->CMSSettings.DefaultPrinterProfile = printerP->currentText();
 	doc->CMSSettings.DefaultIntentColors = (eRenderIntent) colorsI->currentIndex();
 	doc->CMSSettings.DefaultIntentImages = (eRenderIntent) imagesI->currentIndex();
-	doc->CMSSettings.SoftProofOn = simulate->isChecked();
+	doc->CMSSettings.SoftProofOn = simulatePrinter->isChecked();
 	doc->CMSSettings.SoftProofFullOn = convertAll->isChecked();
-	doc->CMSSettings.GamutCheck = gamutC->isChecked();
+	doc->CMSSettings.GamutCheck = gamutCheck->isChecked();
 	doc->CMSSettings.CMSinUse = checkBox1->isChecked();
-	doc->CMSSettings.BlackPoint = blackP->isChecked();
+	doc->CMSSettings.BlackPoint = blackPoint->isChecked();
 }
 
-void CMSPrefs::slotCMSon()
+void CMSPrefs::slotCMSon(bool active)
 {
+	docProfiles->setEnabled(active);
+	monProfile->setEnabled(m_canChangeMonitorProfile);
+	renderInt->setEnabled(active);
+	docOptions->setEnabled(active);
 	emit cmsOn(checkBox1->isChecked());
 }
 
Index: scribus/ui/cmsprefs.h
===================================================================
--- scribus/ui/cmsprefs.h	(revision 14280)
+++ scribus/ui/cmsprefs.h	(revision 14281)
@@ -27,8 +27,11 @@
 	CMSData *prefs;
 	bool changed;
 
+protected:
+	bool m_canChangeMonitorProfile;
+
 public slots:
-	virtual void slotCMSon();
+	virtual void slotCMSon(bool active = false);
 	virtual void setValues();
 
 signals:
Index: scribus/ui/prefs_colormanagementbase.ui
===================================================================
--- scribus/ui/prefs_colormanagementbase.ui	(revision 14280)
+++ scribus/ui/prefs_colormanagementbase.ui	(revision 14281)
@@ -31,13 +31,6 @@
     </widget>
    </item>
    <item>
-    <widget class="Line" name="line">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
-   <item>
     <widget class="QScrollArea" name="scrollArea">
      <property name="widgetResizable">
       <bool>true</bool>
@@ -47,12 +40,32 @@
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>632</width>
-        <height>568</height>
+        <width>638</width>
+        <height>578</height>
        </rect>
       </property>
       <layout class="QVBoxLayout" name="verticalLayout_2">
        <item>
+        <widget class="QLabel" name="label_7">
+         <property name="font">
+          <font>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="text">
+          <string>Document Options</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="Line" name="line_4">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
         <widget class="QCheckBox" name="activateCMCheckBox">
          <property name="text">
           <string>Activate Color Management</string>
@@ -88,7 +101,7 @@
         </widget>
        </item>
        <item>
-        <spacer name="verticalSpacer_2">
+        <spacer name="verticalSpacer">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
          </property>
@@ -112,7 +125,7 @@
           </font>
          </property>
          <property name="text">
-          <string>System Profiles</string>
+          <string>Document Profiles</string>
          </property>
         </widget>
        </item>
@@ -142,7 +155,14 @@
           </widget>
          </item>
          <item row="0" column="1">
-          <widget class="QComboBox" name="rgbImageProfileComboBox"/>
+          <widget class="QComboBox" name="rgbImageProfileComboBox">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+          </widget>
          </item>
          <item row="1" column="0">
           <widget class="QLabel" name="textLabel8">
@@ -155,7 +175,14 @@
           </widget>
          </item>
          <item row="1" column="1">
-          <widget class="QComboBox" name="cmykImageProfileComboBox"/>
+          <widget class="QComboBox" name="cmykImageProfileComboBox">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+          </widget>
          </item>
          <item row="2" column="0">
           <widget class="QLabel" name="textLabel9">
@@ -183,30 +210,20 @@
          <item row="3" column="1">
           <widget class="QComboBox" name="cmykSolidProfileComboBox"/>
          </item>
-         <item row="5" column="0">
+         <item row="4" column="0">
           <widget class="QLabel" name="label_3">
            <property name="text">
             <string>Printer:</string>
            </property>
           </widget>
          </item>
-         <item row="5" column="1">
+         <item row="4" column="1">
           <widget class="QComboBox" name="printerProfileComboBox"/>
          </item>
-         <item row="4" column="1">
-          <widget class="QComboBox" name="monitorProfileComboBox"/>
-         </item>
-         <item row="4" column="0">
-          <widget class="QLabel" name="label_2">
-           <property name="text">
-            <string>Monitor:</string>
-           </property>
-          </widget>
-         </item>
         </layout>
        </item>
        <item>
-        <spacer>
+        <spacer name="verticalSpacer_4">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
          </property>
@@ -230,7 +247,7 @@
           </font>
          </property>
          <property name="text">
-          <string>Rendering Intents</string>
+          <string>Document Rendering Intents</string>
          </property>
         </widget>
        </item>
@@ -269,6 +286,59 @@
         </layout>
        </item>
        <item>
+        <spacer>
+         <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_2">
+         <property name="font">
+          <font>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="text">
+          <string>Monitor Profile</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="Line" name="line_5">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QFormLayout" name="formLayout_3">
+         <property name="fieldGrowthPolicy">
+          <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+         </property>
+         <item row="0" column="1">
+          <widget class="QComboBox" name="monitorProfileComboBox"/>
+         </item>
+         <item row="0" column="0">
+          <widget class="QLabel" name="monitorLabel">
+           <property name="text">
+            <string>Monitor:</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
         <spacer name="verticalSpacer_3">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
@@ -285,6 +355,13 @@
      </widget>
     </widget>
    </item>
+   <item>
+    <widget class="Line" name="line">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <resources/>
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(revision 14280)
+++ scribus/scribus.cpp	(revision 14281)
@@ -7562,13 +7562,13 @@
 	//reset the appMode so we restore our tools shortcuts
 	QString oldUILanguage = prefsManager->uiLanguage();
 	QString oldUIStyle    = prefsManager->guiStyle();
-	bool oldShowPageShadow = prefsManager->showPageShadow();
-	int oldUIFontSize     = prefsManager->guiFontSize();
-	double oldDisplayScale = prefsManager->displayScale();
-	int oldImageQuality = prefsManager->applicationPrefs()->itemToolPrefs.imageLowResType;
+	QString oldMonitorProfile = ScCore->monitorProfile.productDescription();
+	bool    oldShowPageShadow = prefsManager->showPageShadow();
+	int     oldUIFontSize     = prefsManager->guiFontSize();
+	double  oldDisplayScale   = prefsManager->displayScale();
+	int     oldImageQuality   = prefsManager->applicationPrefs()->itemToolPrefs.imageLowResType;
 
 	dia->updatePreferences();
-	prefsManager->SavePrefs();
 	DocDir = prefsManager->documentDir();
 //		scrapbookPalette->rebuildView();
 //		scrapbookPalette->AdjustMenu();
@@ -7598,6 +7598,31 @@
 	ScCore->recheckGS();
 	prefsManager->applyLoadedShortCuts();
 
+	QString newMonitorProfile = prefsManager->appPrefs.colorPrefs.DCMSset.DefaultMonitorProfile;
+	if (oldMonitorProfile != newMonitorProfile)
+	{
+		bool success = false;
+		if (ScCore->MonitorProfiles.contains(newMonitorProfile))
+		{
+			QString profilePath = ScCore->MonitorProfiles[newMonitorProfile];
+			ScColorProfile newProfile = ScCore->defaultEngine.openProfileFromFile(profilePath);
+			if (!newProfile.isNull())
+			{
+				ScCore->monitorProfile = newProfile;
+				success = true;
+			}
+		}
+		if (!success)
+		{
+			prefsManager->appPrefs.colorPrefs.DCMSset.DefaultMonitorProfile = oldMonitorProfile;
+			QString message = tr("An error occurred while opening monitor profile.\nFormer monitor profile will be used." );
+			if (ScCore->usingGUI())
+				QMessageBox::warning(this, CommonStrings::trWarning, message, QMessageBox::Ok, 0, 0);
+			else
+				qWarning( "%s", message.toLocal8Bit().data() );
+		}
+	}
+
 	int newImageQuality = prefsManager->appPrefs.itemToolPrefs.imageLowResType;
 	if (oldImageQuality != newImageQuality)
 		view->previewQualitySwitcher->setCurrentIndex(newImageQuality);
@@ -7628,6 +7653,8 @@
 				scw->view()->DrawNew();
 		}
 	}
+
+	prefsManager->SavePrefs();
 }
 
 void ScribusMainWindow::slotPrefsOrg()
@@ -7641,6 +7668,7 @@
 
 void ScribusMainWindow::slotPrefs150Org()
 {
+	QString oldMonitorProfile = ScCore->monitorProfile.productDescription();
 	slotSelect();
 	struct ApplicationPrefs oldPrefs(prefsManager->appPrefs);
 	PreferencesDialog prefsDialog(this);
@@ -7648,7 +7676,6 @@
 	{
 		struct ApplicationPrefs newPrefs(prefsDialog.prefs());
 		prefsManager->setNewPrefs(newPrefs);
-		prefsManager->SavePrefs();
 
 		// TODO:
 		// CB: Hoping to clean this into a nicer function
@@ -7681,7 +7708,35 @@
 			mdiArea->setViewMode(QMdiArea::TabbedView);
 		else
 			mdiArea->setViewMode(QMdiArea::SubWindowView);
+
+		QString newMonitorProfile = newPrefs.colorPrefs.DCMSset.DefaultMonitorProfile;
+		if (oldMonitorProfile != newMonitorProfile)
+		{
+			bool success = false;
+			if (ScCore->MonitorProfiles.contains(newMonitorProfile))
+			{
+				QString profilePath = ScCore->MonitorProfiles[newMonitorProfile];
+				ScColorProfile newProfile = ScCore->defaultEngine.openProfileFromFile(profilePath);
+				if (!newProfile.isNull())
+				{
+					ScCore->monitorProfile = newProfile;
+					success = true;
+				}
+			}
+			if (!success)
+			{
+				newPrefs.colorPrefs.DCMSset.DefaultMonitorProfile = oldMonitorProfile;
+				prefsManager->setNewPrefs(newPrefs);
+				QString message = tr("An error occurred while opening monitor profile.\nFormer monitor profile will be used." );
+				if (ScCore->usingGUI())
+					QMessageBox::warning(this, CommonStrings::trWarning, message, QMessageBox::Ok, 0, 0);
+				else
+					qWarning( "%s", message.toLocal8Bit().data() );
+			}
+		}
 	}
+
+	prefsManager->SavePrefs();
 }
 
 void ScribusMainWindow::ShowSubs()




More information about the scribus-commit mailing list