r15684 by fschmid - Removed unused Prefs structure
scribus-commit
scribus-commit at lists.scribus.net
Fri Oct 29 22:33:21 CEST 2010
Author: fschmid
Date: Fri Oct 29 20:33:21 2010
New Revision: 15684
URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15684
Log:
Removed unused Prefs structure
Modified:
trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
trunk/Scribus/scribus/prefsmanager.cpp
trunk/Scribus/scribus/prefsstructs.h
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/ui/paintmanager.cpp
trunk/Scribus/scribus/ui/paintmanager.h
Modified: trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15684&path=/trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp (original)
+++ trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp Fri Oct 29 20:33:21 2010
@@ -218,7 +218,7 @@
void BarcodeGenerator::bgColorButton_pressed()
{
- PaintManagerDialog d(this, &ScCore->primaryMainWindow()->doc->docGradients, ScCore->primaryMainWindow()->doc->PageColors, "", QStringList(), ScCore->primaryMainWindow()->doc, ScCore->primaryMainWindow());
+ PaintManagerDialog d(this, &ScCore->primaryMainWindow()->doc->docGradients, ScCore->primaryMainWindow()->doc->PageColors, "", ScCore->primaryMainWindow()->doc, ScCore->primaryMainWindow());
if (!d.exec())
return;
bgColor = d.selectedColor();
@@ -229,7 +229,7 @@
void BarcodeGenerator::lnColorButton_pressed()
{
- PaintManagerDialog d(this, &ScCore->primaryMainWindow()->doc->docGradients, ScCore->primaryMainWindow()->doc->PageColors, "", QStringList(), ScCore->primaryMainWindow()->doc, ScCore->primaryMainWindow());
+ PaintManagerDialog d(this, &ScCore->primaryMainWindow()->doc->docGradients, ScCore->primaryMainWindow()->doc->PageColors, "", ScCore->primaryMainWindow()->doc, ScCore->primaryMainWindow());
if (!d.exec())
return;
lnColor = d.selectedColor();
@@ -240,7 +240,7 @@
void BarcodeGenerator::txtColorButton_pressed()
{
- PaintManagerDialog d(this, &ScCore->primaryMainWindow()->doc->docGradients, ScCore->primaryMainWindow()->doc->PageColors, "", QStringList(), ScCore->primaryMainWindow()->doc, ScCore->primaryMainWindow());
+ PaintManagerDialog d(this, &ScCore->primaryMainWindow()->doc->docGradients, ScCore->primaryMainWindow()->doc->PageColors, "", ScCore->primaryMainWindow()->doc, ScCore->primaryMainWindow());
if (!d.exec())
return;
Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15684&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Fri Oct 29 20:33:21 2010
@@ -304,7 +304,6 @@
appPrefs.pathPrefs.colorProfiles = "";
appPrefs.pathPrefs.scripts = "";
appPrefs.pathPrefs.documentTemplates = "";
- appPrefs.colorPrefs.CustomColorSets.clear();
appPrefs.printPreviewPrefs.PrPr_Mode = false;
//appPrefs.Gcr_Mode = true;
appPrefs.printPreviewPrefs.PrPr_AntiAliasing = false;
@@ -1805,7 +1804,6 @@
csm.findPaletteLocations();
csm.findPalettes();
csm.findUserPalettes();
- appPrefs.colorPrefs.CustomColorSets = csm.userPaletteNames();
ScColor lf = ScColor();
QDomNode DOC=elem.firstChild();
if (!DOC.namedItem("CheckProfile").isNull())
@@ -2313,7 +2311,8 @@
appPrefs.colorPrefs.DColors.clear();
QString pfadC = "";
appPrefs.colorPrefs.DColorSet = dc.attribute("Name");
- if (appPrefs.colorPrefs.CustomColorSets.contains(appPrefs.colorPrefs.DColorSet))
+ QStringList CustomColorSets = csm.userPaletteNames();
+ if (CustomColorSets.contains(appPrefs.colorPrefs.DColorSet))
pfadC = csm.userPaletteFileFromName(appPrefs.colorPrefs.DColorSet);
else
pfadC = csm.paletteFileFromName(appPrefs.colorPrefs.DColorSet);
@@ -2334,8 +2333,6 @@
appPrefs.colorPrefs.DColors.insert("Red", ScColor(0, 255, 255, 0));
appPrefs.colorPrefs.DColors.insert("Yellow", ScColor(0, 0, 255, 0));
appPrefs.colorPrefs.DColors.insert("Magenta", ScColor(0, 255, 0, 0));
- if (appPrefs.colorPrefs.CustomColorSets.contains(appPrefs.colorPrefs.DColorSet))
- appPrefs.colorPrefs.CustomColorSets.removeAll(appPrefs.colorPrefs.DColorSet);
appPrefs.colorPrefs.DColorSet = "Scribus Small";
}
}
Modified: trunk/Scribus/scribus/prefsstructs.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15684&path=/trunk/Scribus/scribus/prefsstructs.h
==============================================================================
--- trunk/Scribus/scribus/prefsstructs.h (original)
+++ trunk/Scribus/scribus/prefsstructs.h Fri Oct 29 20:33:21 2010
@@ -260,7 +260,6 @@
{
ColorList DColors;
QString DColorSet;
- QStringList CustomColorSets;
CMSData DCMSset;
};
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15684&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Fri Oct 29 20:33:21 2010
@@ -9945,7 +9945,7 @@
edc = prefsManager->colorSet();
}
undoManager->setUndoEnabled(false);
- PaintManagerDialog *dia = new PaintManagerDialog(this, Gradients, edc, prefsManager->colorSetName(), prefsManager->appPrefs.colorPrefs.CustomColorSets, doc, this);
+ PaintManagerDialog *dia = new PaintManagerDialog(this, Gradients, edc, prefsManager->colorSetName(), doc, this);
if (dia->exec())
{
if (HaveDoc)
@@ -9992,7 +9992,6 @@
propertiesPalette->Cpal->SetColors(prefsManager->colorSet());
prefsManager->appPrefs.defaultGradients = dia->dialogGradients;
prefsManager->setColorSetName(dia->getColorSetName());
- prefsManager->appPrefs.colorPrefs.CustomColorSets = dia->customColSet;
}
}
delete dia;
@@ -10025,105 +10024,6 @@
delete dia2;
}
}
-/*
-void ScribusMainWindow::manageGradients()
-{
- if (HaveDoc)
- {
- undoManager->setUndoEnabled(false);
- gradientManagerDialog *dia = new gradientManagerDialog(this, &doc->docGradients, doc->PageColors, doc, this);
- if (dia->exec())
- {
- doc->setGradients(dia->dialogGradients);
- if (!dia->replaceMap.isEmpty())
- {
- ResourceCollection gradrsc;
- gradrsc.mapPatterns(dia->replaceMap);
- doc->replaceNamedResources(gradrsc);
- }
- if (dia->hasImportedColors)
- {
- doc->PageColors = dia->m_colorList;
- doc->recalculateColors();
- doc->recalcPicturesRes();
- propertiesPalette->SetLineFormats(doc);
- styleManager->updateColorList();
- }
- propertiesPalette->updateColorList();
- view->DrawNew();
- if (doc->m_Selection->count() != 0)
- doc->m_Selection->itemAt(0)->emitAllToGUI();
- slotDocCh();
- }
- delete dia;
- undoManager->setUndoEnabled(true);
- }
- else
- {
- gradientManagerDialog *dia = new gradientManagerDialog(this, &prefsManager->appPrefs.defaultGradients, prefsManager->colorSet(), NULL, this);
- if (dia->exec())
- {
- prefsManager->appPrefs.defaultGradients = dia->dialogGradients;
- if (dia->hasImportedColors)
- prefsManager->setColorSet(dia->m_colorList);
- }
- delete dia;
- }
-}
-
-void ScribusMainWindow::slotEditColors()
-{
- ColorList edc;
- if (HaveDoc)
- edc = doc->PageColors;
- else
- edc = prefsManager->colorSet();
- ColorManager* dia = new ColorManager(this, edc, doc, prefsManager->colorSetName(), prefsManager->appPrefs.colorPrefs.CustomColorSets);
- if (dia->exec())
- {
- if (HaveDoc)
- {
- QColor tmpc;
- slotDocCh();
- doc->PageColors = dia->EditColors;
- if (dia->replaceMap.isEmpty())
- {
- // invalidate all charstyles, as replaceNamedResources() wont do it if all maps are empty
- const StyleSet<CharStyle> dummy;
- doc->redefineCharStyles(dummy, false);
- }
- else
- {
- ResourceCollection colorrsc;
- colorrsc.mapColors(dia->replaceMap);
- // Update tools colors
- PrefsManager::replaceToolColors(doc->itemToolPrefs(), colorrsc.colors());
- // Update objects and styles colors
- doc->replaceNamedResources(colorrsc);
- // Temporary code until LineStyle is effectively used
- doc->replaceLineStyleColors(dia->replaceMap);
- }
- doc->recalculateColors();
- doc->recalcPicturesRes();
- updateColorLists();
- if (doc->m_Selection->count() != 0)
- doc->m_Selection->itemAt(0)->emitAllToGUI();
- view->DrawNew();
- }
- else
- {
- // Update tools colors if needed
- prefsManager->replaceToolColors(dia->replaceMap);
- prefsManager->setColorSet(dia->EditColors);
- prefsManager->setColorSetName(dia->getColorSetName());
- propertiesPalette->Cpal->SetColors(prefsManager->colorSet());
- }
- }
- if (!HaveDoc)
- prefsManager->appPrefs.colorPrefs.CustomColorSets = dia->customColSet;
- delete dia;
-}
-*/
void ScribusMainWindow::enableTextActions(QMap<QString, QPointer<ScrAction> > *actionMap, bool enabled, const QString& fontName)
{
Modified: trunk/Scribus/scribus/ui/paintmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15684&path=/trunk/Scribus/scribus/ui/paintmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/paintmanager.cpp (original)
+++ trunk/Scribus/scribus/ui/paintmanager.cpp Fri Oct 29 20:33:21 2010
@@ -54,7 +54,7 @@
#include "util_formats.h"
#include "util_icon.h"
-PaintManagerDialog::PaintManagerDialog(QWidget* parent, QMap<QString, VGradient> *docGradients, ColorList doco, QString docColSet, QStringList custColSet, ScribusDoc *doc, ScribusMainWindow *scMW) : QDialog(parent)
+PaintManagerDialog::PaintManagerDialog(QWidget* parent, QMap<QString, VGradient> *docGradients, ColorList doco, QString docColSet, ScribusDoc *doc, ScribusMainWindow *scMW) : QDialog(parent)
{
setupUi(this);
setModal(true);
@@ -77,7 +77,6 @@
origNames.insert(it.key(), it.key());
}
origGradients = docGradients->keys();
- customColSet = custColSet;
csm.findPaletteLocations();
systemSwatches = LoadColSet->addTopLevelItem( tr("Scribus Swatches"));
@@ -86,6 +85,7 @@
systemSwatches->setExpanded(true);
userSwatches = LoadColSet->addTopLevelItem( tr("User Swatches"));
csm.findUserPalettes(userSwatches);
+ customColSet = csm.userPaletteNames();
userSwatches->setExpanded(true);
LoadColSet->setCurrentComboItem(docColSet);
if (m_doc != 0)
@@ -99,7 +99,7 @@
if (docColSet != "Scribus Small")
{
QString pfad = "";
- if (custColSet.contains(docColSet))
+ if (customColSet.contains(docColSet))
pfad = csm.userPaletteFileFromName(docColSet);
else
pfad = csm.paletteFileFromName(docColSet);
Modified: trunk/Scribus/scribus/ui/paintmanager.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15684&path=/trunk/Scribus/scribus/ui/paintmanager.h
==============================================================================
--- trunk/Scribus/scribus/ui/paintmanager.h (original)
+++ trunk/Scribus/scribus/ui/paintmanager.h Fri Oct 29 20:33:21 2010
@@ -38,7 +38,7 @@
Q_OBJECT
public:
- PaintManagerDialog(QWidget* parent, QMap<QString, VGradient> *docGradients, ColorList doco, QString docColSet, QStringList custColSet, ScribusDoc *doc, ScribusMainWindow* scMW);
+ PaintManagerDialog(QWidget* parent, QMap<QString, VGradient> *docGradients, ColorList doco, QString docColSet, ScribusDoc *doc, ScribusMainWindow* scMW);
~PaintManagerDialog() {};
/*! \brief Returns the name of the current/selected color set.
\retval QString selected name. */
More information about the scribus-commit
mailing list