File indexing completed on 2022-11-29 20:01:35

0001 /*******************************************************************
0002  * backtracewidget.h
0003  * SPDX-FileCopyrightText: 2009 Dario Andres Rodriguez <andresbajotierra@gmail.com>
0004  *
0005  * SPDX-License-Identifier: GPL-2.0-or-later
0006  *
0007  ******************************************************************/
0008 
0009 #ifndef BACKTRACEWIDGET__H
0010 #define BACKTRACEWIDGET__H
0011 
0012 #include <QWidget>
0013 
0014 #include "debugpackageinstaller.h"
0015 #include "ui_backtracewidget.h"
0016 
0017 namespace KSyntaxHighlighting
0018 {
0019 class SyntaxHighlighter;
0020 }
0021 class BacktraceRatingWidget;
0022 class BacktraceGenerator;
0023 
0024 class BacktraceWidget : public QWidget
0025 {
0026     Q_OBJECT
0027 
0028 public:
0029     explicit BacktraceWidget(BacktraceGenerator *generator, QWidget *parent = nullptr, bool showToggleBacktrace = false);
0030 
0031     bool canInstallDebugPackages() const;
0032 
0033 public Q_SLOTS:
0034     void generateBacktrace();
0035     void highlightExtraDetailsLabel(bool highlight);
0036     void focusImproveBacktraceButton();
0037 
0038     void toggleBacktrace(bool show);
0039     void extraDetailsLinkActivated(QString link);
0040 
0041 Q_SIGNALS:
0042     void stateChanged();
0043 
0044 private:
0045     BacktraceGenerator *m_btGenerator = nullptr;
0046     Ui::Form ui;
0047     BacktraceRatingWidget *m_backtraceRatingWidget = nullptr;
0048     KSyntaxHighlighting::SyntaxHighlighter *m_highlighter = nullptr;
0049     DebugPackageInstaller *m_debugPackageInstaller = nullptr;
0050 
0051     void setAsLoading();
0052 
0053 private Q_SLOTS:
0054     void loadData();
0055     void backtraceNewLine(const QString &);
0056 
0057     void regenerateBacktrace();
0058 
0059     void saveClicked();
0060     void copyClicked();
0061 
0062     void anotherDebuggerRunning();
0063 
0064     void installDebugPackages();
0065     void debugPackageError(const QString &);
0066     void debugPackageCanceled();
0067 };
0068 
0069 #endif