File indexing completed on 2024-06-23 05:07:20

0001 /*
0002     SPDX-FileCopyrightText: 2008 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "akonadiwidgets_export.h"
0010 #include "ui_selftestdialog.h"
0011 #include <QDialog>
0012 
0013 class QStandardItem;
0014 class QStandardItemModel;
0015 namespace Akonadi
0016 {
0017 /**
0018  * @internal
0019  *
0020  * @short A dialog that checks the current status of the Akonadi system.
0021  *
0022  * This dialog checks the current status of the Akonadi system and
0023  * displays a summary of the checks.
0024  *
0025  * @author Volker Krause <vkrause@kde.org>
0026  */
0027 class AKONADIWIDGETS_EXPORT SelfTestDialog : public QDialog
0028 {
0029     Q_OBJECT
0030 public:
0031     /**
0032      * Creates a new self test dialog.
0033      *
0034      * @param parent The parent widget.
0035      */
0036     explicit SelfTestDialog(QWidget *parent = nullptr);
0037 
0038     /**
0039      * Hides the label with the introduction message.
0040      */
0041     void hideIntroduction();
0042 
0043 private Q_SLOTS:
0044     void selectionChanged(const QModelIndex &index);
0045     void saveReport();
0046     void copyReport();
0047     void linkActivated(const QString &link);
0048     void runTests();
0049 
0050 private:
0051     enum ResultType {
0052         Skip,
0053         Success,
0054         Warning,
0055         Error,
0056     };
0057     AKONADIWIDGETS_NO_EXPORT QStandardItem *report(ResultType type, const KLocalizedString &summary, const KLocalizedString &details);
0058     AKONADIWIDGETS_NO_EXPORT QVariant serverSetting(const QString &group, const char *key, const QVariant &def) const;
0059     AKONADIWIDGETS_NO_EXPORT bool useStandaloneMysqlServer() const;
0060     AKONADIWIDGETS_NO_EXPORT bool runProcess(const QString &app, const QStringList &args, QString &result) const;
0061 
0062     AKONADIWIDGETS_NO_EXPORT void testSQLDriver();
0063     AKONADIWIDGETS_NO_EXPORT void testMySQLServer();
0064     AKONADIWIDGETS_NO_EXPORT void testMySQLServerLog();
0065     AKONADIWIDGETS_NO_EXPORT void testMySQLServerConfig();
0066     AKONADIWIDGETS_NO_EXPORT void testPSQLServer();
0067     AKONADIWIDGETS_NO_EXPORT void testAkonadiCtl();
0068     AKONADIWIDGETS_NO_EXPORT void testServerStatus();
0069     AKONADIWIDGETS_NO_EXPORT void testProtocolVersion();
0070     AKONADIWIDGETS_NO_EXPORT void testResources();
0071     AKONADIWIDGETS_NO_EXPORT void testServerLog();
0072     AKONADIWIDGETS_NO_EXPORT void testControlLog();
0073     AKONADIWIDGETS_NO_EXPORT void testRootUser();
0074 
0075     AKONADIWIDGETS_NO_EXPORT QString createReport();
0076 
0077     Ui::SelfTestDialog ui;
0078     QStandardItemModel *mTestModel = nullptr;
0079 };
0080 }