r15057 by cbradney - New Prefs Dialog: Colour Management Monitor Profile no longer shows when in doc setup

scribus-commit scribus-commit at lists.scribus.net
Sat May 8 00:20:25 CEST 2010


Revision: 15057
Author: cbradney
Date: 2010-05-07T22:12:50.944755Z
Commit message: New Prefs Dialog: Colour Management Monitor Profile no longer shows when in doc setup

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

Diffs:
Index: scribus/ui/prefs_colormanagement.cpp
===================================================================
--- scribus/ui/prefs_colormanagement.cpp	(revision 15056)
+++ scribus/ui/prefs_colormanagement.cpp	(revision 15057)
@@ -12,7 +12,8 @@
 #include "scribusdoc.h"
 
 Prefs_ColorManagement::Prefs_ColorManagement(QWidget* parent, ScribusDoc* doc)
-	: Prefs_Pane(parent)
+	: Prefs_Pane(parent),
+	m_Doc(doc)
 {
 	m_canChangeMonitorProfile = !ScCore->primaryMainWindow()->HaveDoc; 
 	setupUi(this);
@@ -21,8 +22,18 @@
 	connect(simulatePrinterOnScreenCheckBox, SIGNAL(clicked(bool)), this, SLOT(simulatePrinter(bool)));
 	if (!m_canChangeMonitorProfile)
 	{
-		monitorProfileComboBox->setVisible(false);
-		monitorLabel->setText( tr("Monitor profiles can only be changed when no documents are currently open.") );
+		if (!m_Doc)
+		{
+			monitorProfileComboBox->setVisible(false);
+			monitorLabel->setText( tr("Monitor profiles can only be changed when no documents are open") );
+		}
+		else
+		{
+			monitorProfileLabel->setVisible(false);
+			monitorProfileLine->setVisible(false);
+			monitorProfileComboBox->setVisible(false);
+			monitorLabel->setVisible(false);
+		}
 	}
 }
 
@@ -91,11 +102,14 @@
 			cmykSolidProfileComboBox->setCurrentIndex(cmykSolidProfileComboBox->count()-1);
 	}
 	monitorProfileComboBox->clear();
-	for (it = monitorProfiles->begin(); it != monitorProfiles->end(); ++it)
+	if (m_canChangeMonitorProfile && !m_Doc)
 	{
-		monitorProfileComboBox->addItem(it.key());
-		if (it.key() == prefsData->colorPrefs.DCMSset.DefaultMonitorProfile)
-			monitorProfileComboBox->setCurrentIndex(monitorProfileComboBox->count()-1);
+		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)
@@ -122,10 +136,8 @@
 	prefsData->colorPrefs.DCMSset.DefaultSolidColorCMYKProfile = cmykSolidProfileComboBox->currentText();
 	prefsData->colorPrefs.DCMSset.DefaultPrinterProfile = printerProfileComboBox->currentText();
 
-	if (m_canChangeMonitorProfile)
-	{
+	if (m_canChangeMonitorProfile && !m_Doc)
 		prefsData->colorPrefs.DCMSset.DefaultMonitorProfile = monitorProfileComboBox->currentText();
-	}
 }
 
 bool Prefs_ColorManagement::cmActive()
@@ -145,7 +157,8 @@
 	cmykImageProfileComboBox->setEnabled( active );
 	rgbSolidProfileComboBox->setEnabled( active );
 	cmykSolidProfileComboBox->setEnabled( active );
-	monitorProfileComboBox->setEnabled( m_canChangeMonitorProfile );
+	if (!m_Doc)
+		monitorProfileComboBox->setEnabled( m_canChangeMonitorProfile );
 	printerProfileComboBox->setEnabled( active );
 }
 
Index: scribus/ui/prefs_colormanagement.h
===================================================================
--- scribus/ui/prefs_colormanagement.h	(revision 15056)
+++ scribus/ui/prefs_colormanagement.h	(revision 15057)
@@ -29,6 +29,7 @@
 		bool cmActive();
 	protected:
 		bool m_canChangeMonitorProfile;
+		ScribusDoc *m_Doc;
 
 	public slots:
 		void languageChange();
Index: scribus/ui/prefs_colormanagementbase.ui
===================================================================
--- scribus/ui/prefs_colormanagementbase.ui	(revision 15056)
+++ scribus/ui/prefs_colormanagementbase.ui	(revision 15057)
@@ -39,9 +39,9 @@
       <property name="geometry">
        <rect>
         <x>0</x>
-        <y>0</y>
-        <width>638</width>
-        <height>578</height>
+        <y>-45</y>
+        <width>617</width>
+        <height>631</height>
        </rect>
       </property>
       <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -302,7 +302,7 @@
         </spacer>
        </item>
        <item>
-        <widget class="QLabel" name="label_2">
+        <widget class="QLabel" name="monitorProfileLabel">
          <property name="font">
           <font>
            <weight>75</weight>
@@ -315,7 +315,7 @@
         </widget>
        </item>
        <item>
-        <widget class="Line" name="line_5">
+        <widget class="Line" name="monitorProfileLine">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
@@ -355,13 +355,6 @@
      </widget>
     </widget>
    </item>
-   <item>
-    <widget class="Line" name="line">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
   </layout>
  </widget>
  <resources/>




More information about the scribus-commit mailing list