[2bbe924ad8] | 1 | /*! |
---|
| 2 | * \file settingsdialog.h |
---|
[b4b4f8d479] | 3 | * \author Copyright © 2007-2014 Oleksii Serdiuk <contacts[at]oleksii[dot]name> |
---|
[2bbe924ad8] | 4 | * |
---|
[7ba743d983] | 5 | * $Id: $Format:%h %ai %an$ $ |
---|
| 6 | * $URL: http://tspsg.info/ $ |
---|
[2bbe924ad8] | 7 | * |
---|
| 8 | * \brief Defines SettingsDialog class. |
---|
| 9 | * |
---|
| 10 | * <b>TSPSG: TSP Solver and Generator</b> |
---|
| 11 | * |
---|
| 12 | * This file is part of TSPSG. |
---|
| 13 | * |
---|
| 14 | * TSPSG is free software: you can redistribute it and/or modify |
---|
| 15 | * it under the terms of the GNU General Public License as published by |
---|
[2940c14782] | 16 | * the Free Software Foundation, either version 2 of the License, or |
---|
[2bbe924ad8] | 17 | * (at your option) any later version. |
---|
| 18 | * |
---|
| 19 | * TSPSG is distributed in the hope that it will be useful, |
---|
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 22 | * GNU General Public License for more details. |
---|
| 23 | * |
---|
| 24 | * You should have received a copy of the GNU General Public License |
---|
| 25 | * along with TSPSG. If not, see <http://www.gnu.org/licenses/>. |
---|
| 26 | */ |
---|
| 27 | |
---|
| 28 | #ifndef SETTINGSDIALOG_H |
---|
| 29 | #define SETTINGSDIALOG_H |
---|
| 30 | |
---|
| 31 | #include "globals.h" |
---|
| 32 | |
---|
| 33 | #include "ui_settingsdialog.h" |
---|
| 34 | |
---|
| 35 | /*! |
---|
| 36 | * \brief Class for handling Settings Dialog UI and logic. |
---|
[b4b4f8d479] | 37 | * \author Copyright © 2007-2014 Oleksii Serdiuk <contacts[at]oleksii[dot]name> |
---|
[2bbe924ad8] | 38 | */ |
---|
| 39 | class SettingsDialog: public QDialog, Ui::SettingsDialog |
---|
| 40 | { |
---|
[9eb63a1598] | 41 | Q_OBJECT |
---|
[2bbe924ad8] | 42 | public: |
---|
[9eb63a1598] | 43 | SettingsDialog(QWidget *parent = 0); |
---|
| 44 | bool colorChanged() const; |
---|
| 45 | bool fontChanged() const; |
---|
| 46 | qint8 translucencyChanged() const; |
---|
[2bbe924ad8] | 47 | |
---|
| 48 | private: |
---|
[a09f31733a] | 49 | bool _fontChanged; |
---|
| 50 | bool _colorChanged; |
---|
[9eb63a1598] | 51 | qint8 _translucency; |
---|
[2bbe924ad8] | 52 | |
---|
[a09f31733a] | 53 | QColor textColor, selColor, altColor, borderColor, bgColor; |
---|
[9eb63a1598] | 54 | QFont font; |
---|
[2bbe924ad8] | 55 | |
---|
[9eb63a1598] | 56 | QSettings *settings; |
---|
| 57 | QHBoxLayout *layoutCitiesLimit; |
---|
[b8a2a118c4] | 58 | #ifndef HANDHELD |
---|
[9eb63a1598] | 59 | QCheckBox *cbUseTranslucency; |
---|
[b8a2a118c4] | 60 | #endif // HANDHELD |
---|
[9eb63a1598] | 61 | QCheckBox *cbCheck4Updates; |
---|
| 62 | QSpinBox *spinUpdateCheckInterval; |
---|
[e26679937d] | 63 | #ifndef QT_NO_PRINTER |
---|
[9eb63a1598] | 64 | QCheckBox *cbHQGraph; |
---|
[e26679937d] | 65 | #endif |
---|
[89e5214692] | 66 | #ifdef Q_OS_WINCE_WM |
---|
[9eb63a1598] | 67 | QRect currentGeometry; |
---|
[3cadf24d00] | 68 | #elif !defined(HANDHELD) |
---|
[9eb63a1598] | 69 | QCheckBox *cbSaveState; |
---|
| 70 | QLabel *imgIcon; |
---|
| 71 | QFrame *lineVertical; |
---|
| 72 | QLabel *labelHint; |
---|
[2bbe924ad8] | 73 | |
---|
[9adbc413c7] | 74 | #ifndef QT_NO_STATUSTIP |
---|
[9eb63a1598] | 75 | bool event(QEvent *ev); |
---|
[9adbc413c7] | 76 | #endif // QT_NO_STATUSTIP |
---|
[89e5214692] | 77 | #endif // Q_OS_WINCE_WM |
---|
[2bbe924ad8] | 78 | |
---|
[7c2ff7afbc] | 79 | void pickColor(QColor &where); |
---|
| 80 | void setBgColor(QWidget *widget, const QColor &color); |
---|
| 81 | |
---|
[2bbe924ad8] | 82 | private slots: |
---|
[9eb63a1598] | 83 | void accept(); |
---|
[a09f31733a] | 84 | void buttonTextColorClicked(); |
---|
[c8ed26ddf1] | 85 | void buttonSelectedColorClicked(); |
---|
| 86 | void buttonAlternateColorClicked(); |
---|
| 87 | void buttonBorderColorClicked(); |
---|
| 88 | // void buttonBgColorClicked(); |
---|
[9eb63a1598] | 89 | void buttonFontClicked(); |
---|
[89e5214692] | 90 | #ifdef Q_OS_WINCE_WM |
---|
[9eb63a1598] | 91 | void desktopResized(int screen); |
---|
| 92 | void showEvent(QShowEvent *ev); |
---|
[89e5214692] | 93 | #endif // Q_OS_WINCE_WM |
---|
[9eb63a1598] | 94 | void spinRandMinValueChanged(int val); |
---|
[2bbe924ad8] | 95 | }; |
---|
| 96 | |
---|
| 97 | #endif // SETTINGSDIALOG_H |
---|