init
[qstardict] / plugins / web / settingsdialog.h
1 /*****************************************************************************
2  * settingsdialog.h - QStarDict, a StarDict clone written with using Qt      *
3  * Copyright (C) 2008 Alexander Rodin                                        *
4  *                                                                           *
5  * This program is free software; you can redistribute it and/or modify      *
6  * it under the terms of the GNU General Public License as published by      *
7  * the Free Software Foundation; either version 2 of the License, or         *
8  * (at your option) any later version.                                       *
9  *                                                                           *
10  * This program 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             *
13  * GNU General Public License for more details.                              *
14  *                                                                           *
15  * You should have received a copy of the GNU General Public License along   *
16  * with this program; if not, write to the Free Software Foundation, Inc.,   *
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.               *
18  *****************************************************************************/
19
20 #ifndef SETTINGSDIALOG_H
21 #define SETTINGSDIALOG_H
22
23 #include <QDialog>
24 #include "ui_settingsdialog.h"
25
26 #include "web.h"
27
28 class SettingsDialog: public QDialog, public Ui::SettingsDialog
29 {
30     Q_OBJECT
31     public:
32         SettingsDialog(Web *plugin, QWidget *parent = 0);
33
34         void accept();
35     protected:
36         void closeEvent(QCloseEvent *event);
37
38     private slots:
39         void on_editDictButton_clicked();
40         void on_addDictButton_clicked();
41         void on_removeDictButton_clicked();
42
43     private:
44         void refresh();
45
46         struct Dict
47         {
48             Dict(const QString &a = QString(),
49                 const QString &d = QString(),
50                 const QString &q = QString(),
51                 const QByteArray &c = QByteArray())
52                 : author(a),
53                   description(d),
54                   query(q),
55                   charset(c)
56             { }
57             QString author;
58             QString description;
59             QString query;
60             QByteArray charset;
61         };
62         QHash<QString, Dict> m_oldDicts;
63         QHash<QString, Dict> m_dicts;
64         Web *m_plugin;
65 };
66
67 #endif // SETTINGSDIALOG_H
68
69 // vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab cindent
70