Add Traditional Chinese desktop entry
[lxde/compton-conf.git] / maindialog.h
1 /*
2 * <one line to give the library's name and an idea of what it does.>
3 * Copyright (C) 2013 <copyright holder> <email>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 */
20
21 #ifndef MAINDIALOG_H
22 #define MAINDIALOG_H
23
24 #include <QDialog>
25 #include <libconfig.h>
26
27 namespace Ui
28 {
29 class MainDialog;
30 }
31
32 class QAbstractButton;
33
34 class MainDialog : public QDialog
35 {
36 Q_OBJECT
37 public:
38 MainDialog(QString userConfigFile = QString());
39 ~MainDialog();
40
41 virtual void done(int res);
42
43 private:
44 void saveConfig();
45 void updateShadowColorButton();
46
47 void configSetInt(const char* key, int val);
48 void configSetFloat(const char* key, double val);
49 void configSetBool(const char* key, bool val);
50 void configSetString(const char* key, const char* val);
51
52 private Q_SLOTS:
53 void onButtonToggled(bool checked);
54 void onSpinValueChanged(double d);
55 void onSpinValueChanged(int i);
56 void onDialogButtonClicked(QAbstractButton* button);
57 void onColorButtonClicked();
58 void onAboutButtonClicked();
59 void onRadioGroupToggled(bool checked);
60
61 private:
62 Ui::MainDialog* ui;
63 config_t config_;
64 QString userConfigFile_;
65 QColor shadowColor_;
66 };
67
68 #endif // MAINDIALOG_H