1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef PLUGINDIALOG_H
6#define PLUGINDIALOG_H
7
8#include "framework/lifecycle/pluginmetaobject.h"
9
10#include <QDialog>
11#include <QLabel>
12#include <QGridLayout>
13#include <QListWidget>
14#include <QTextEdit>
15#include <QSpacerItem>
16
17class DetailsView;
18class QDialogButtonBox;
19class QLabel;
20
21namespace dpf {
22class PluginView;
23}
24
25class PluginDialog : public QDialog
26{
27 Q_OBJECT
28
29public:
30 explicit PluginDialog(QWidget *parent = nullptr);
31
32private slots:
33 void slotCurrentPluginActived();
34
35private:
36 void updateRestartRequired();
37 void updateButtons();
38 void closeDialog();
39
40 dpf::PluginView *view = nullptr;
41 DetailsView *detailView = nullptr;
42
43 QDialogButtonBox *closeButton = nullptr;
44 QPushButton *detailsButton = nullptr;
45 QLabel *restratRequired = nullptr;
46};
47
48class DetailsView : public QWidget
49{
50 Q_OBJECT
51public:
52 DetailsView(QWidget *parent = nullptr);
53
54 void update(dpf::PluginMetaObjectPointer plugin);
55
56private:
57 QGridLayout *gridLayout = nullptr;
58 QVBoxLayout *vboxLayout_1 = nullptr;
59 QVBoxLayout *vboxLayout_2 = nullptr;
60 QVBoxLayout *vboxLayout_3 = nullptr;
61 QSpacerItem *spacerItem_1 = nullptr;
62 QSpacerItem *spacerItem_2 = nullptr;
63 QSpacerItem *spacerItem_3 = nullptr;
64 QLabel *name = nullptr;
65 QLabel *version = nullptr;
66 QLabel *compatVersion = nullptr;
67 QLabel *vendor = nullptr;
68 QLabel *copyright = nullptr;
69 QLabel *category = nullptr;
70 QLabel *urlLink = nullptr;
71 QTextEdit *description = nullptr;
72 QTextEdit *license = nullptr;
73 QListWidget *dependencies = nullptr;
74
75 QLabel *nameLabel = nullptr;
76 QLabel *versionLabel = nullptr;
77 QLabel *compatVersionLabel = nullptr;
78 QLabel *vendorLabel = nullptr;
79 QLabel *copyrightLabel = nullptr;
80 QLabel *categoryLabel = nullptr;
81 QLabel *urlLabel = nullptr;
82 QLabel *licenseLabel = nullptr;
83 QLabel *descriptionLabel = nullptr;
84 QLabel *dependenciesLabel = nullptr;
85};
86
87#endif // PLUGINDIALOG_H
88