mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-24 06:48:24 -05:00
Move DisplayMessage() to utility.hpp
This commit is contained in:
parent
dad36689c4
commit
f37f384b5a
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "headers/advanced-scene-switcher.hpp"
|
||||
#include "headers/curl-helper.hpp"
|
||||
#include "headers/utility.hpp"
|
||||
#include "headers/version.h"
|
||||
|
||||
SwitcherData *switcher = nullptr;
|
||||
|
|
@ -73,28 +74,6 @@ void AdvSceneSwitcher::loadUI()
|
|||
/******************************************************************************
|
||||
* UI helpers
|
||||
******************************************************************************/
|
||||
bool AdvSceneSwitcher::DisplayMessage(QString msg, bool question)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::addSelectionEntry(QComboBox *sel,
|
||||
const char *description,
|
||||
bool selectable, const char *tooltip)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user