File indexing completed on 2024-12-22 04:45:39
0001 /* 0002 SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "libruqolawidgets_private_export.h" 0010 #include "serverinfo.h" 0011 #include <QJsonObject> 0012 #include <QWidget> 0013 class QTreeWidget; 0014 class QTreeWidgetItem; 0015 class KTreeWidgetSearchLineWidget; 0016 class QPushButton; 0017 class RocketChatAccount; 0018 class LIBRUQOLAWIDGETS_TESTS_EXPORT AdministratorServerInfoWidget : public QWidget 0019 { 0020 Q_OBJECT 0021 public: 0022 explicit AdministratorServerInfoWidget(RocketChatAccount *account, QWidget *parent = nullptr); 0023 ~AdministratorServerInfoWidget() override; 0024 void initialize(); 0025 0026 private: 0027 LIBRUQOLAWIDGETS_NO_EXPORT void parseServerInfo(QTreeWidgetItem *serverInfoItem, const QJsonObject &obj); 0028 LIBRUQOLAWIDGETS_NO_EXPORT void parseUsageInfo(QTreeWidgetItem *usageInfoItem, const QJsonObject &obj); 0029 LIBRUQOLAWIDGETS_NO_EXPORT void parseRuntimeInfo(QTreeWidgetItem *runtimeInfoItem, const QJsonObject &obj); 0030 LIBRUQOLAWIDGETS_NO_EXPORT void parseCommitInfo(QTreeWidgetItem *commitInfoItem); 0031 LIBRUQOLAWIDGETS_NO_EXPORT void parseBuildInfo(QTreeWidgetItem *buildInfoItem); 0032 LIBRUQOLAWIDGETS_NO_EXPORT void 0033 createItemFromIntValue(QTreeWidgetItem *usageInfoItem, const QJsonObject &obj, const QString &label, const QString &identifier); 0034 LIBRUQOLAWIDGETS_NO_EXPORT void 0035 createItemFromStringValue(QTreeWidgetItem *parentItem, const QJsonObject &obj, const QString &label, const QString &identifier); 0036 LIBRUQOLAWIDGETS_NO_EXPORT void slotServerInfoDone(const QString &versionInfo, const QJsonObject &obj); 0037 LIBRUQOLAWIDGETS_NO_EXPORT void 0038 createItemDisplayFormat(QTreeWidgetItem *parentItem, const QJsonObject &obj, const QString &label, const QString &identifier); 0039 LIBRUQOLAWIDGETS_NO_EXPORT void slotLicensesListDone(const QJsonObject &obj); 0040 LIBRUQOLAWIDGETS_NO_EXPORT void slotStatisticDone(const QJsonObject &obj); 0041 LIBRUQOLAWIDGETS_NO_EXPORT void slotRefreshInfo(); 0042 LIBRUQOLAWIDGETS_NO_EXPORT void loadStatisticInfo(bool refresh); 0043 LIBRUQOLAWIDGETS_NO_EXPORT void loadServerInfo(); 0044 LIBRUQOLAWIDGETS_NO_EXPORT void loadLicensesInfo(); 0045 LIBRUQOLAWIDGETS_NO_EXPORT void fillLicenses(const QJsonObject &obj); 0046 LIBRUQOLAWIDGETS_NO_EXPORT void slotContextMenu(const QPoint &pos); 0047 LIBRUQOLAWIDGETS_NO_EXPORT void createItemFromLicense(QTreeWidgetItem *licenseInfoItem, const QString &name, bool valid); 0048 QTreeWidget *const mTreeWidget; 0049 KTreeWidgetSearchLineWidget *const mSearchLineWidget; 0050 QPushButton *const mRefreshButton; 0051 ServerInfo mServerInfo; 0052 QTreeWidgetItem *mServerInfoItem = nullptr; 0053 QTreeWidgetItem *mUsageInfoItem = nullptr; 0054 QTreeWidgetItem *mRuntimeInfoItem = nullptr; 0055 RocketChatAccount *const mRocketChatAccount; 0056 };