File indexing completed on 2024-05-05 04:48:24

0001 /****************************************************************************************
0002  * Copyright (c) 2012 Andrzej J. R. Hunt <andrzej at ahunt.org>                         *
0003  * Copyright (c) Mark Kretschmann <kretschmann@kde.org>                                 *
0004  *                                                                                      *
0005  * This program is free software; you can redistribute it and/or modify it under        *
0006  * the terms of the GNU General Public License as published by the Free Software        *
0007  * Foundation; either version 2 of the License, or (at your option) any later           *
0008  * version.                                                                             *
0009  *                                                                                      *
0010  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0011  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0012  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0013  *                                                                                      *
0014  * You should have received a copy of the GNU General Public License along with         *
0015  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0016  ****************************************************************************************/
0017 #ifndef AMAROK_DIAGNOSTICDIALOG_H
0018 #define AMAROK_DIAGNOSTICDIALOG_H
0019 
0020 #include "amarok_export.h"
0021 
0022 #include <QDialog>
0023 
0024 class KAboutData;
0025 class QPlainTextEdit;
0026 
0027 struct BackendDescriptor {
0028     explicit BackendDescriptor(const QString &path = QString());
0029 
0030     bool isValid;
0031 
0032     QString iid;
0033 
0034     QString name;
0035     QString version;
0036     QString website;
0037     int preference;
0038 
0039     QString pluginPath;
0040 
0041     /** Implemented for qSort(QList) */
0042     bool operator <(const BackendDescriptor &rhs) const;
0043 };
0044 
0045 class AMAROK_EXPORT DiagnosticDialog : public QDialog
0046 {
0047     Q_OBJECT
0048 
0049 public:
0050     explicit DiagnosticDialog( const KAboutData &about, QWidget *parent = nullptr );
0051 
0052 private:
0053     QPlainTextEdit *m_textBox;
0054 
0055     const QString generateReport( const KAboutData *aboutData );
0056     const BackendDescriptor getPreferredBackend() const;
0057 
0058 private Q_SLOTS:
0059     void slotCopyToClipboard() const;
0060 };
0061 
0062 
0063 #endif //AMAROK_DIAGNOSTICDIALOG_H