diff options
author | Stijn Buys <ingar@osirion.org> | 2013-07-13 20:14:11 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-07-13 20:14:11 +0000 |
commit | 8b7b9e3c69fc138c4288036a2e659ac39badb902 (patch) | |
tree | 69a51d13c327be07f6b526060b87bec83ab74712 /src/sudokuwidget.cc | |
parent | 13393a3a2c30abac42c97fd37afdbdcd9a3a111e (diff) |
Adds a settings class, use APPDATA/Sudoku Solver as homedir on win32, renames the UNIX homedir to ~/.sudokusolver
Diffstat (limited to 'src/sudokuwidget.cc')
-rw-r--r-- | src/sudokuwidget.cc | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/sudokuwidget.cc b/src/sudokuwidget.cc index b42637c..78e90fd 100644 --- a/src/sudokuwidget.cc +++ b/src/sudokuwidget.cc @@ -1,18 +1,11 @@ #include "sudokuwidget.h" +#include "settings.h" #include <QLineEdit> #include <QGridLayout> #include <QString> -/* - * TODO - * This should be moved into a global configuration sectoion - * with a settings dialog - * */ -const QColor color_invalid_value(255, 0, 0); -const QColor color_input_error(195, 195, 195); - SudokuWidget::SudokuWidget() { for (int row = 0; row < 9; row++) { @@ -41,7 +34,7 @@ void SudokuWidget::verify(const QString & text) values.cell(row, column).set_value(0); QPalette child_palette(palette()); if (!sudokuwidget_value[row][column]->text().isEmpty()) { - child_palette.setColor(QPalette::Base, color_input_error); + child_palette.setColor(QPalette::Base, globalSettings().colorInputError()); } sudokuwidget_value[row][column]->setPalette(child_palette); } @@ -57,7 +50,7 @@ void SudokuWidget::verify(const QString & text) if ( (i > 0) && (i <= 9) ) { // set background color depending on the validity of the cell value if (!values.cell(row, column).valid()) { - child_palette.setColor(QPalette::Base, color_invalid_value); + child_palette.setColor(QPalette::Base, globalSettings().colorInvalidValue()); } sudokuwidget_value[row][column]->setPalette(child_palette); } @@ -82,7 +75,7 @@ void SudokuWidget::set_values(const Sudoku & values) // set background color depending on the validity of the cell value if (!values.cell(row, column).valid()) { - child_palette.setColor(QPalette::Base, color_invalid_value); + child_palette.setColor(QPalette::Base, globalSettings().colorInvalidValue()); } } else { sudokuwidget_value[row][column]->clear(); |