1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef OPTIONSDIALOG_H
6#define OPTIONSDIALOG_H
7
8#include <QtWidgets/QDialog>
9#include <QMap>
10
11class QHBoxLayout;
12class QVBoxLayout;
13class QLineEdit;
14class QListView;
15class QLabel;
16class QSpacerItem;
17class QStringListModel;
18class QStackedWidget;
19class PageWidget;
20
21class OptionsDialog : public QDialog
22{
23 Q_OBJECT
24public:
25 explicit OptionsDialog(QWidget *parent = nullptr);
26 bool insertOptionPanel(const QString &itemName, PageWidget *panel);
27
28public slots:
29 void slotLeftBarClicked(const QModelIndex &index);
30 void saveSingleConfig();
31 void saveAllConfig();
32
33private:
34 void setupUi(QDialog *Dialog);
35 void readConfig();
36 void findOption(const QString &filter);
37
38protected:
39 virtual void showEvent(QShowEvent *e) override;
40 QLineEdit *filterEdit = nullptr;
41 QListView *leftSideBar = nullptr;
42 QLabel *headTitle = nullptr;
43 QString activeOptName {};
44 QMap<QString, PageWidget *> widgts{};
45 QStringListModel *leftBarModel = nullptr;
46 QStackedWidget *stackWidget = nullptr;
47};
48
49#endif // OPTIONSDIALOG_H
50