r17055 by fschmid - Prefs_Display: disable all settings that can't be set in document setup mode. Temporary solution until i'll get a better idea.

scribus-commit scribus-commit at lists.scribus.net
Sat Dec 3 10:25:55 UTC 2011


Author: fschmid
Date: Sat Dec  3 10:25:55 2011
New Revision: 17055

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17055
Log:
Prefs_Display: disable all settings that can't be set in document setup mode. Temporary solution until i'll get a better idea.

Modified:
    trunk/Scribus/scribus/canvasmode.cpp
    trunk/Scribus/scribus/ui/prefs_display.cpp
    trunk/Scribus/scribus/ui/prefs_display.h

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17055&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Sat Dec  3 10:25:55 2011
@@ -80,20 +80,20 @@
 {
 	m_pen["outline"]	= QPen(Qt::gray, 1.0 , Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 	m_pen["outline"].setCosmetic(true);
-	m_pen["selection"]	= QPen(Qt::red, 1.0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	m_pen["selection"]	= QPen(PrefsManager::instance()->appPrefs.displayPrefs.frameColor, 1.0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 	m_pen["selection"].setCosmetic(true);
 	m_pen["selection-group"] = QPen(Qt::red, 1.0 , Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 	m_pen["selection-group"].setCosmetic(true);
-	m_pen["selection-group-inside"] = QPen(Qt::red, 1.0 , Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	m_pen["selection-group-inside"] = QPen(PrefsManager::instance()->appPrefs.displayPrefs.frameGroupColor, 1.0 , Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 	m_pen["selection-group-inside"].setCosmetic(true);
-	m_pen["handle"]		= QPen(Qt::red, 1.0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	m_pen["handle"]		= QPen(PrefsManager::instance()->appPrefs.displayPrefs.frameColor, 1.0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 	m_pen["handle"].setCosmetic(true);
 	
 	m_brush["outline"]	= Qt::NoBrush;
 	m_brush["selection"]	= Qt::NoBrush;
 	m_brush["selection-group"] = QColor(255,0,0,10);
 	m_brush["selection-group-inside"] = Qt::NoBrush;
-	m_brush["handle"]	= Qt::red;
+	m_brush["handle"]	= PrefsManager::instance()->appPrefs.displayPrefs.frameColor;
 
 	m_keyRepeat = false;
 	m_arrowKeyDown = false;
@@ -223,6 +223,13 @@
 //	QTime tt;
 //	int tg(0);
 //	QStringList tu;
+	m_pen["selection"]	= QPen(PrefsManager::instance()->appPrefs.displayPrefs.frameColor, 1.0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	m_pen["selection"].setCosmetic(true);
+	m_pen["selection-group-inside"] = QPen(PrefsManager::instance()->appPrefs.displayPrefs.frameGroupColor, 1.0 , Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	m_pen["selection-group-inside"].setCosmetic(true);
+	m_pen["handle"]		= QPen(PrefsManager::instance()->appPrefs.displayPrefs.frameColor, 1.0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	m_pen["handle"].setCosmetic(true);
+	m_brush["handle"]	= PrefsManager::instance()->appPrefs.displayPrefs.frameColor;
 	QString ds;
 	psx->scale(m_canvas->scale(), m_canvas->scale());
 	psx->translate(-m_doc->minCanvasCoordinate.x(), -m_doc->minCanvasCoordinate.y());

Modified: trunk/Scribus/scribus/ui/prefs_display.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17055&path=/trunk/Scribus/scribus/ui/prefs_display.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_display.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_display.cpp Sat Dec  3 10:25:55 2011
@@ -13,12 +13,12 @@
 
 #include "prefs_display.h"
 #include "prefsstructs.h"
+#include "scribuscore.h"
 #include "scribusdoc.h"
 #include "units.h"
 #include "util_icon.h"
 
-Prefs_Display::Prefs_Display(QWidget* parent, ScribusDoc* doc)
-	: Prefs_Pane(parent)
+Prefs_Display::Prefs_Display(QWidget* parent, ScribusDoc* doc) : Prefs_Pane(parent), m_doc(doc)
 {
 	setupUi(this);
 	languageChange();
@@ -26,19 +26,40 @@
 	buttonRestoreDPI->setIcon(QIcon(loadIcon("screen.png")));
 
 	connect(pageFillColorButton, SIGNAL(clicked()), this, SLOT(changePaperColor()));
-	connect(scratchSpaceColorButton, SIGNAL(clicked()), this, SLOT(changeScratchColor()));
-	connect(frameSelectedColorButton, SIGNAL(clicked()), this, SLOT(changeFrameColor()));
-	connect(frameColorButton, SIGNAL(clicked()), this, SLOT(changeNormFrameColor()));
-	connect(frameGroupedColorButton, SIGNAL(clicked()), this, SLOT(changeGroupFrameColor()));
-	connect(frameLinkedColorButton, SIGNAL(clicked()), this, SLOT(changeChainFrameColor()));
-	connect(frameLockedColorButton, SIGNAL(clicked()), this, SLOT(changeLockFrameColor()));
-	connect(frameAnnotationColorButton, SIGNAL(clicked()), this, SLOT(changeAnnotFrameColor()));
-	connect(selectedPageBorderButton, SIGNAL(clicked()), this, SLOT(changePageBorderColor()));
-	connect(textControlCharsButton, SIGNAL(clicked()), this, SLOT(changeControlCharsColor()));
-
-	connect(buttonRestoreDPI, SIGNAL(clicked()), this, SLOT(restoreDisScale()));
-	connect(adjustDisplaySlider, SIGNAL(valueChanged(int)), this, SLOT(setDisScale()));
-	connect(rulerUnitComboBox, SIGNAL(activated(int)), this, SLOT(drawRuler()));
+
+	if (m_doc == NULL && !ScCore->primaryMainWindow()->HaveDoc)
+	{
+		connect(scratchSpaceColorButton, SIGNAL(clicked()), this, SLOT(changeScratchColor()));
+		connect(frameSelectedColorButton, SIGNAL(clicked()), this, SLOT(changeFrameColor()));
+		connect(frameColorButton, SIGNAL(clicked()), this, SLOT(changeNormFrameColor()));
+		connect(frameGroupedColorButton, SIGNAL(clicked()), this, SLOT(changeGroupFrameColor()));
+		connect(frameLinkedColorButton, SIGNAL(clicked()), this, SLOT(changeChainFrameColor()));
+		connect(frameLockedColorButton, SIGNAL(clicked()), this, SLOT(changeLockFrameColor()));
+		connect(frameAnnotationColorButton, SIGNAL(clicked()), this, SLOT(changeAnnotFrameColor()));
+		connect(selectedPageBorderButton, SIGNAL(clicked()), this, SLOT(changePageBorderColor()));
+		connect(textControlCharsButton, SIGNAL(clicked()), this, SLOT(changeControlCharsColor()));
+		connect(buttonRestoreDPI, SIGNAL(clicked()), this, SLOT(restoreDisScale()));
+		connect(adjustDisplaySlider, SIGNAL(valueChanged(int)), this, SLOT(setDisScale()));
+		connect(rulerUnitComboBox, SIGNAL(activated(int)), this, SLOT(drawRuler()));
+	}
+	else
+	{
+		scratchSpaceColorButton->setEnabled(false);
+		frameSelectedColorButton->setEnabled(false);
+		frameColorButton->setEnabled(false);
+		frameGroupedColorButton->setEnabled(false);
+		frameLinkedColorButton->setEnabled(false);
+		frameLockedColorButton->setEnabled(false);
+		frameAnnotationColorButton->setEnabled(false);
+		selectedPageBorderButton->setEnabled(false);
+		textControlCharsButton->setEnabled(false);
+		buttonRestoreDPI->setEnabled(false);
+		adjustDisplaySlider->setEnabled(false);
+		rulerUnitComboBox->setEnabled(false);
+		showPageShadowCheckBox->setEnabled(false);
+		showVerifierWarningsOnCanvasCheckBox->setEnabled(false);
+		tabWidget->setTabEnabled(2, false);
+	}
 }
 
 Prefs_Display::~Prefs_Display()

Modified: trunk/Scribus/scribus/ui/prefs_display.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17055&path=/trunk/Scribus/scribus/ui/prefs_display.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_display.h (original)
+++ trunk/Scribus/scribus/ui/prefs_display.h Sat Dec  3 10:25:55 2011
@@ -74,6 +74,7 @@
 		QColor colorPageBorder;
 		QColor colorControlChars;
 		double displayScale;
+		ScribusDoc* m_doc;
 
 };
 




More information about the scribus-commit mailing list