Sayonara Player
Loading...
Searching...
No Matches
GUI_PreferenceDialog.h
1/* GUI_PreferenceDialog.h */
2
3/* Copyright (C) 2011-2024 Michael Lugmair (Lucio Carreras)
4 *
5 * This file is part of sayonara player
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef GUI_PreferenceDialog_H
22#define GUI_PreferenceDialog_H
23
24#include "Utils/Pimpl.h"
25#include "Gui/Utils/Widgets/Dialog.h"
26#include "Components/Preferences/PreferenceRegistry.h"
27
28#include <QMainWindow>
29
30namespace Preferences
31{
32 class Base;
33 class Action;
34}
35
37
38class GUI_PreferenceDialog :
39 public Gui::Dialog,
40 public PreferenceUi
41{
42 Q_OBJECT
43 UI_CLASS_SHARED_PTR(GUI_PreferenceDialog)
44 PIMPL(GUI_PreferenceDialog)
45
46 signals:
47 void sigError(const QString& errorMessage);
48
49 public:
50 explicit GUI_PreferenceDialog(QMainWindow* parent);
51 ~GUI_PreferenceDialog() override;
52
53 [[nodiscard]] QString actionName() const;
54 [[nodiscard]] QAction* action();
55 [[nodiscard]] QList<QAction*> actions(QWidget* parent);
56
57 void registerPreferenceDialog(Preferences::Base* dialog);
58 void showPreference(const QString& identifier) override;
59
60 protected slots:
61 bool commit();
62 void revert();
63 void commitAndClose();
64 void rowChanged(int row);
65
66 protected:
67 void initUi();
68 void languageChanged() override;
69 void showEvent(QShowEvent* e) override;
70
71 void hideAll();
72};
73
74#endif // GUI_PreferenceDialog_H
Definition GUI_PreferenceDialog.h:41
Definition PreferenceRegistry.h:30
The action, which is used to access the Preference.
Definition PreferenceAction.h:40
Definition PreferenceWidget.h:32
Definition EngineUtils.h:33