59fcd323fdab3110a757147ae12a56b27fc08208
[qstardict] / qstardict / settingsdialog.h
1 /*****************************************************************************
2  * settingsdialog.h - QStarDict, a StarDict clone written with using Qt      *
3  * Copyright (C) 2007 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 "dictcore.h"
27
28 class QStandardItemModel;
29 class QStandardItem;
30
31 namespace QStarDict
32 {
33 class MainWindow;
34
35 /**
36  * The settings dialog.
37  */
38 class SettingsDialog: public QDialog, private Ui::SettingsDialog
39 {
40     Q_OBJECT
41
42     public:
43         /**
44          * Construct new SettingsDialog widget with parent MainWindow.
45          */
46         SettingsDialog(QWidget *parent = 0);
47
48         void accept();
49         void reject();
50
51     protected:
52         void closeEvent(QCloseEvent *event);
53
54     private slots:
55         void on_dictsMoveUpButton_clicked();
56         void on_dictsMoveDownButton_clicked();
57         void on_dictsShowInfoButton_clicked();
58
59         void on_pluginsShowInfoButton_clicked();
60         void on_pluginsConfigureButton_clicked();
61         void pluginsItemChanged(QStandardItem *item);
62         void dictionariesItemChanged(QStandardItem *item);
63
64     private slots:
65         void loadDictsList();
66         void loadPluginsList();
67
68     private:
69         QStringList m_oldPlugins;
70         QList<DictCore::Dictionary> m_oldDicts;
71         QStandardItemModel *m_dictsModel;
72         QStandardItemModel *m_pluginsModel;
73 };
74
75 }
76
77 #endif // SETTINGSDIALOG_H
78
79 // vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab cindent textwidth=120 formatoptions=tc
80