UI: Add confirmation dialog for bandwidth test mode

This commit is contained in:
derrod 2019-03-09 06:38:52 +01:00
parent 51bfb9d899
commit 4595d49e98
2 changed files with 19 additions and 1 deletions

View file

@ -257,6 +257,10 @@ ConfirmStart.Text="Are you sure you want to start the stream?"
ConfirmStop.Title="Stop Stream?"
ConfirmStop.Text="Are you sure you want to stop the stream?"
# confirm bandwidth test dialog box
ConfirmBWTest.Title="Start Bandwidth Test?"
ConfirmBWTest.Text="You have OBS configured in bandwidth test mode. This mode allows for network testing without your channel going live. Once you are done testing, you will need to disable it in order for viewers to be able to see your stream.\n\nDo you want to continue?"
# confirm exit dialog box
ConfirmExit.Title="Exit OBS?"
ConfirmExit.Text="OBS is currently active. All streams/recordings will be shut down. Are you sure you wish to exit?"

View file

@ -5519,7 +5519,21 @@ void OBSBasic::on_streamButton_clicked()
bool confirm = config_get_bool(GetGlobalConfig(), "BasicWindow",
"WarnBeforeStartingStream");
if (confirm && isVisible()) {
obs_data_t *settings = obs_service_get_settings(service);
bool bwtest = obs_data_get_bool(settings, "bwtest");
obs_data_release(settings);
if (bwtest && isVisible()) {
QMessageBox::StandardButton button =
OBSMessageBox::question(this,
QTStr("ConfirmBWTest.Title"),
QTStr("ConfirmBWTest.Text"));
if (button == QMessageBox::No) {
ui->streamButton->setChecked(false);
return;
}
} else if (confirm && isVisible()) {
QMessageBox::StandardButton button =
OBSMessageBox::question(this,
QTStr("ConfirmStart.Title"),