diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2025-07-31 14:27:00 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2025-08-01 14:35:05 -0400 |
| commit | afccc4b8e0a698b9e9ae39865162c671380e876a (patch) | |
| tree | 8cfee48a476f6503437f3f3e1dbabda497c85143 /ui/logmessagedialog.h | |
| parent | 8df034ed6b3a1a52bd268ed43e783c35b687408f (diff) | |
Add log message dialog for showing stack traces
Diffstat (limited to 'ui/logmessagedialog.h')
| -rw-r--r-- | ui/logmessagedialog.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/ui/logmessagedialog.h b/ui/logmessagedialog.h new file mode 100644 index 00000000..c63a3838 --- /dev/null +++ b/ui/logmessagedialog.h @@ -0,0 +1,38 @@ +#pragma once + +#include <QtWidgets/QDialog> +#include "binaryninjaapi.h" +#include "uitypes.h" +#include "clickablelabel.h" + +/*! + + \defgroup logmessagedialog LogMessageDialog + \ingroup uiapi +*/ + +/*! + \ingroup logmessagedialog +*/ +class BINARYNINJAUIAPI LogMessageDialog : public QDialog +{ + Q_OBJECT + + QString m_stackTrace; + ClickableLabel* m_showStackTraceLabel = nullptr; + QVBoxLayout* m_stackTraceLayout = nullptr; + bool m_stackTraceVisible = false; + + static constexpr int MAX_WIDTH = 720; + static constexpr int STACK_TRACE_HEIGHT = 300; + + void init(BNLogLevel level, const QString& stackTrace, const QString& message); + +public: + LogMessageDialog(QWidget* parent, BNLogLevel level, const std::optional<std::string>& stackTrace, + const std::string& message); + LogMessageDialog(QWidget* parent, BNLogLevel level, const QString& stackTrace, const QString& message); + +public Q_SLOTS: + void requestStackTrace(); +}; |
