From 3bd99797d92af9a23df17adbf7536f4f1992a42c Mon Sep 17 00:00:00 2001 From: jp9000 Date: Fri, 31 May 2019 20:52:17 -0700 Subject: [PATCH] UI: Add ability to use rich text in warning dialogs Allows the ability to use things such as links in warning dialogs, optionally. Disabled by default. --- UI/qt-wrappers.cpp | 5 ++++- UI/qt-wrappers.hpp | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/UI/qt-wrappers.cpp b/UI/qt-wrappers.cpp index 2755b7ccc..5d8a9cb28 100644 --- a/UI/qt-wrappers.cpp +++ b/UI/qt-wrappers.cpp @@ -93,11 +93,14 @@ void OBSMessageBox::information( void OBSMessageBox::warning( QWidget *parent, const QString &title, - const QString &text) + const QString &text, + bool enableRichText) { QMessageBox mb(QMessageBox::Warning, title, text, QMessageBox::Ok, parent); + if (enableRichText) + mb.setTextFormat(Qt::RichText); mb.setButtonText(QMessageBox::Ok, QTStr("OK")); mb.exec(); } diff --git a/UI/qt-wrappers.hpp b/UI/qt-wrappers.hpp index 58c6a7781..ab301097b 100644 --- a/UI/qt-wrappers.hpp +++ b/UI/qt-wrappers.hpp @@ -51,7 +51,8 @@ public: static void warning( QWidget *parent, const QString &title, - const QString &text); + const QString &text, + bool enableRichText = false); static void critical( QWidget *parent, const QString &title,