فهرست منبع

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.
jp9000 6 سال پیش
والد
کامیت
3bd99797d9
2فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 4 1
      UI/qt-wrappers.cpp
  2. 2 1
      UI/qt-wrappers.hpp

+ 4 - 1
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();
 }

+ 2 - 1
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,