Update DBus Notify method annotation name
[lxde/liblxqt.git] / configdialog / lxqtconfigdialog.h
CommitLineData
a36cb19b
AM
1/* BEGIN_COMMON_COPYRIGHT_HEADER
2 * (c)LGPL2+
3 *
b9223fe7 4 * LXQt - a lightweight, Qt based, desktop toolset
a36cb19b
AM
5 * http://razor-qt.org
6 *
7 * Copyright (C) 2012 Alec Moskvin <alecm@gmx.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 *
23 * END_COMMON_COPYRIGHT_HEADER */
24
b6483430
AS
25#ifndef LXQTCONFIGDIALOG_H
26#define LXQTCONFIGDIALOG_H
a36cb19b 27
3a8c8a2a 28#include "lxqtsettings.h"
afd3b116
JL
29#include <QDialog>
30#include <QAbstractButton>
ae45471f 31#include <QDialogButtonBox>
f9cba1ba 32#include "lxqtglobals.h"
a36cb19b
AM
33
34namespace Ui {
ad7ee7e8 35class ConfigDialog;
a36cb19b
AM
36}
37
f05ba5af 38namespace LXQt
ad7ee7e8
AS
39{
40
f9cba1ba 41class LXQT_API ConfigDialog : public QDialog
a36cb19b
AM
42{
43 Q_OBJECT
44
45public:
82830dc2 46 explicit ConfigDialog(const QString& title, Settings* settings, QWidget* parent = 0);
ae45471f 47
ad7ee7e8 48 ~ConfigDialog();
a36cb19b
AM
49
50 /*!
ae45471f
L
51 * Sets buttons in button bar
52 */
53 void setButtons(QDialogButtonBox::StandardButtons buttons);
54
55 /*!
a36cb19b
AM
56 * Add a page to the configure dialog
57 */
58 void addPage(QWidget* page, const QString& name, const QString& iconName="application-x-executable");
59
edcb7d1a
AM
60 /*!
61 * Add a page to the configure dialog, attempting several alternative icons to find one in the theme
62 */
63 void addPage(QWidget* page, const QString& name, const QStringList& iconNames);
64
98dd8833
PL
65 /*!
66 * Show page containing the widget in parameter
67 */
68 void showPage(QWidget *page);
69
552e1c4a 70
ae45471f 71
a36cb19b
AM
72signals:
73 /*!
74 * This signal is emitted when the user pressed the "Reset" button.
82830dc2 75 * Settings should be re-read and the widgets should be set accordingly.
a36cb19b
AM
76 */
77 void reset();
78
79 /*!
80 * This is emitted whenever the window is closed and settings need to be saved.
82830dc2 81 * It is only necessary if additional actions need to be performed - Settings are handled automatically.
a36cb19b
AM
82 */
83 void save();
84
ae45471f
L
85 /*!
86 * This is emitted when some button in the buttonbar is clicked.
87 */
88 void clicked(QDialogButtonBox::StandardButton);
89
4cf2dc5e 90protected:
82830dc2 91 Settings* mSettings;
38964268
PK
92 virtual bool event(QEvent * event) override;
93 virtual void closeEvent(QCloseEvent* event) override;
4cf2dc5e
AM
94
95private:
82830dc2 96 SettingsCache* mCache;
ad0420f9 97 QList<QStringList> mIcons;
ca9b082d 98 QSize mMaxSize;
ad7ee7e8 99 Ui::ConfigDialog* ui;
a36cb19b
AM
100
101private slots:
102 void dialogButtonsAction(QAbstractButton* button);
ad0420f9
AM
103 void updateIcons();
104
a36cb19b
AM
105};
106
f05ba5af 107} // namespace LXQt
b6483430 108#endif // LXQTCONFIGDIALOG_H