summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/preferencesdialog.cpp
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2010-06-15 11:06:40 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2010-06-15 11:06:40 +0000
commit98a5780d6df3777dbc3fe44e68b40cba541e34ff (patch)
treedb0a4f4ad923f799e8c731952189ff12156dd122 /utils/themeeditor/preferencesdialog.cpp
parenta316ebe65b3efea6863bb4098ef28c9bea1d7717 (diff)
downloadrockbox-98a5780d6df3777dbc3fe44e68b40cba541e34ff.tar.gz
rockbox-98a5780d6df3777dbc3fe44e68b40cba541e34ff.tar.bz2
rockbox-98a5780d6df3777dbc3fe44e68b40cba541e34ff.zip
Theme editor: only accept valid colors in the preference dialog
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26857 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/preferencesdialog.cpp')
-rw-r--r--utils/themeeditor/preferencesdialog.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/utils/themeeditor/preferencesdialog.cpp b/utils/themeeditor/preferencesdialog.cpp
index 78f2ed7206..8cd9665779 100644
--- a/utils/themeeditor/preferencesdialog.cpp
+++ b/utils/themeeditor/preferencesdialog.cpp
@@ -165,7 +165,7 @@ void PreferencesDialog::setupUI()
void PreferencesDialog::colorClicked()
{
- QColor* toEdit = 0;
+ QColor* toEdit = 0, newColor;
if(QObject::sender() == ui->bgButton)
toEdit = &bgColor;
@@ -185,8 +185,12 @@ void PreferencesDialog::colorClicked()
if(!toEdit)
return;
- *toEdit = QColorDialog::getColor(*toEdit, this);
- setButtonColor(dynamic_cast<QPushButton*>(QObject::sender()), *toEdit);
+ newColor = QColorDialog::getColor(*toEdit, this);
+ if (newColor.isValid())
+ {
+ *toEdit = newColor;
+ setButtonColor(dynamic_cast<QPushButton*>(QObject::sender()), *toEdit);
+ }
}
void PreferencesDialog::accept()