1 // Copyright (C) 2012-2019 The VPaint Developers.
2 // See the COPYRIGHT file at the top-level directory of this distribution
3 // and at https://github.com/dalboris/vpaint/blob/master/COPYRIGHT
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef SETTINGS_DIALOG_H
18 #define SETTINGS_DIALOG_H
19 
20 #include <QDialog>
21 #include "Settings.h"
22 
23 #include <QDialogButtonBox>
24 #include <QDoubleSpinBox>
25 
26 class SettingsDialog: public QDialog
27 {
28     Q_OBJECT
29 
30 public:
31     SettingsDialog(QWidget * parent = 0);
32     void go();
33 
34 private slots:
35     void cancel();
36     void apply();
37     void ok();
38 
39     void dialogButtonClicked(QAbstractButton * button);
40     void writeApplicationSettings();
41     void writeApplicationSettings(const Settings & settings);
42 
43 signals:
44     void preferencesChanged();
45 
46 private:
47     //void readApplicationPreferences();
48     //void writeApplicationPreferences();
49 
50     Settings preferencesFromWidgetValues() const;
51     void setWidgetValuesFromPreferences(const Settings & preferences);
52 
53     QDoubleSpinBox * edgeWidth_;
54 
55 
56     QDialogButtonBox * dialogButtons_;
57     Settings preferencesBak;
58 
59 };
60 
61 #endif
62