Commit fae004a8 authored by Kurt Hindenburg's avatar Kurt Hindenburg

Add _IsNewScheme bool member

Add _isNewScheme bool as private member in ColorSchemeEditor class,
making the dialog aware if it correspond to a new theme or not.

Patch by renan fargetton renan.fargetton@gmail.com
REVIEW: 110534
parent a091014a
......@@ -47,6 +47,7 @@ const int INTENSE_COLOR_COLUMN = 2; // column 2 : intense colors
ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
: QWidget(aParent)
, _isNewScheme(false)
, _colors(0)
{
_ui = new Ui::ColorSchemeEditor();
......@@ -186,8 +187,14 @@ void ColorSchemeEditor::setRandomizedBackgroundColor(bool randomize)
{
_colors->setRandomizedBackgroundColor(randomize);
}
void ColorSchemeEditor::setup(const ColorScheme* scheme)
void ColorSchemeEditor::setup(const ColorScheme* scheme, bool isNewScheme)
{
_isNewScheme = isNewScheme;
if (_isNewScheme) {
setDescription(i18n("New Color Scheme"));
}
delete _colors;
_colors = new ColorScheme(*scheme);
......@@ -243,5 +250,9 @@ ColorScheme* ColorSchemeEditor::colorScheme() const
{
return _colors;
}
bool ColorSchemeEditor::isNewScheme() const
{
return _isNewScheme;
}
#include "ColorSchemeEditor.moc"
......@@ -56,9 +56,10 @@ public:
virtual ~ColorSchemeEditor();
/** Initializes the dialog with the properties of the specified color scheme. */
void setup(const ColorScheme* scheme);
void setup(const ColorScheme* scheme, bool isNewScheme);
/** Returns the modified color scheme. */
ColorScheme* colorScheme() const;
bool isNewScheme() const;
signals:
/** Emitted when the colors in the color scheme change. */
......@@ -78,6 +79,7 @@ private slots:
private:
void setupColorTable(const ColorScheme* table);
bool _isNewScheme;
Ui::ColorSchemeEditor* _ui;
ColorScheme* _colors;
};
......
......@@ -706,7 +706,7 @@ void EditProfileDialog::showColorSchemeEditor(bool isNewScheme)
ColorSchemeEditor* editor = new ColorSchemeEditor;
dialog.data()->setMainWidget(editor);
editor->setup(colors);
editor->setup(colors, isNewScheme);
if (isNewScheme)
editor->setDescription(i18n("New Color Scheme"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment