0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

UI: Add warning / critical QMessageBox wrappers

This commit is contained in:
Richard Stanway 2019-03-30 15:42:35 +01:00 committed by jp9000
parent 42e76f6c34
commit 4be88c7f2a
2 changed files with 32 additions and 0 deletions

View File

@ -90,6 +90,30 @@ void OBSMessageBox::information(
mb.exec();
}
void OBSMessageBox::warning(
QWidget *parent,
const QString &title,
const QString &text)
{
QMessageBox mb(QMessageBox::Warning,
title, text, QMessageBox::Ok,
parent);
mb.setButtonText(QMessageBox::Ok, QTStr("OK"));
mb.exec();
}
void OBSMessageBox::critical(
QWidget *parent,
const QString &title,
const QString &text)
{
QMessageBox mb(QMessageBox::Critical,
title, text, QMessageBox::Ok,
parent);
mb.setButtonText(QMessageBox::Ok, QTStr("OK"));
mb.exec();
}
void QTToGSWindow(WId windowId, gs_window &gswindow)
{
#ifdef _WIN32

View File

@ -48,6 +48,14 @@ public:
QWidget *parent,
const QString &title,
const QString &text);
static void warning(
QWidget *parent,
const QString &title,
const QString &text);
static void critical(
QWidget *parent,
const QString &title,
const QString &text);
};
void OBSErrorBox(QWidget *parent, const char *msg, ...);