mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-08 09:36:07 -05:00
Move DisplayMessage() to utility.hpp
This commit is contained in:
@@ -64,7 +64,6 @@ public:
|
||||
void setTabOrder();
|
||||
void restoreWindowGeo();
|
||||
|
||||
static bool DisplayMessage(QString msg, bool question = false);
|
||||
static void AskBackup(obs_data_t *obj);
|
||||
|
||||
static void addSelectionEntry(QComboBox *sel, const char *description,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <QTextStream>
|
||||
#include <QLayout>
|
||||
#include <QLabel>
|
||||
#include <QMessageBox>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <obs.hpp>
|
||||
@@ -204,3 +205,25 @@ static inline bool compareIgnoringLineEnding(QString &s1, QString &s2)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool DisplayMessage(QString msg, bool question = false)
|
||||
{
|
||||
if (question) {
|
||||
QMessageBox::StandardButton reply;
|
||||
reply = QMessageBox::question(
|
||||
nullptr, "Advanced Scene Switcher", msg,
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if (reply == QMessageBox::Yes) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
QMessageBox Msgbox;
|
||||
Msgbox.setWindowTitle("Advanced Scene Switcher");
|
||||
Msgbox.setText(msg);
|
||||
Msgbox.exec();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user