diff --git a/obs/data/locale/en-US.ini b/obs/data/locale/en-US.ini index c09e8e39d..9c45f234c 100644 --- a/obs/data/locale/en-US.ini +++ b/obs/data/locale/en-US.ini @@ -55,6 +55,14 @@ NameExists.Text="The name is already in use." NoNameEntered.Title="Please enter a valid name" NoNameEntered.Text="You cannot use empty names." +# confirm start stream dialog box +ConfirmStart.Title="Start Stream?" +ConfirmStart.Text="Are you sure you want to start the stream?" + +# confirm stop stream dialog box +ConfirmStop.Title="Stop Stream?" +ConfirmStop.Text="Are you sure you want to stop the stream?" + # 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?" @@ -300,6 +308,8 @@ Basic.Settings.Confirm="You have unsaved changes. Save changes?" Basic.Settings.General="General" Basic.Settings.General.Theme="Theme" Basic.Settings.General.Language="Language" +Basic.Settings.General.WarnBeforeStartingStream="Show confirmation dialog when starting streams" +Basic.Settings.General.WarnBeforeStoppingStream="Show confirmation dialog when stopping streams" # basic mode 'stream' settings Basic.Settings.Stream="Stream" diff --git a/obs/forms/OBSBasicSettings.ui b/obs/forms/OBSBasicSettings.ui index 42291a36c..5837f91f5 100644 --- a/obs/forms/OBSBasicSettings.ui +++ b/obs/forms/OBSBasicSettings.ui @@ -165,6 +165,20 @@ + + + + Basic.Settings.General.WarnBeforeStartingStream + + + + + + + Basic.Settings.General.WarnBeforeStoppingStream + + + @@ -2663,8 +2677,8 @@ 0 0 - 735 - 618 + 525 + 383 diff --git a/obs/window-basic-main.cpp b/obs/window-basic-main.cpp index d944febaa..997579ae8 100644 --- a/obs/window-basic-main.cpp +++ b/obs/window-basic-main.cpp @@ -3267,8 +3267,34 @@ void OBSBasic::RecordingStop(int code) void OBSBasic::on_streamButton_clicked() { if (outputHandler->StreamingActive()) { + bool confirm = config_get_bool(GetGlobalConfig(), "BasicWindow", + "WarnBeforeStoppingStream"); + + if (confirm) { + QMessageBox::StandardButton button = + QMessageBox::question(this, + QTStr("ConfirmStop.Title"), + QTStr("ConfirmStop.Text")); + + if (button == QMessageBox::No) + return; + } + StopStreaming(); } else { + bool confirm = config_get_bool(GetGlobalConfig(), "BasicWindow", + "WarnBeforeStartingStream"); + + if (confirm) { + QMessageBox::StandardButton button = + QMessageBox::question(this, + QTStr("ConfirmStart.Title"), + QTStr("ConfirmStart.Text")); + + if (button == QMessageBox::No) + return; + } + StartStreaming(); } } diff --git a/obs/window-basic-settings.cpp b/obs/window-basic-settings.cpp index e368f96fc..05b395c1a 100644 --- a/obs/window-basic-settings.cpp +++ b/obs/window-basic-settings.cpp @@ -263,6 +263,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent) HookWidget(ui->language, COMBO_CHANGED, GENERAL_CHANGED); HookWidget(ui->theme, COMBO_CHANGED, GENERAL_CHANGED); + HookWidget(ui->warnBeforeStreamStart,CHECK_CHANGED, GENERAL_CHANGED); + HookWidget(ui->warnBeforeStreamStop, CHECK_CHANGED, GENERAL_CHANGED); HookWidget(ui->outputMode, COMBO_CHANGED, OUTPUTS_CHANGED); HookWidget(ui->streamType, COMBO_CHANGED, STREAM1_CHANGED); HookWidget(ui->simpleOutputPath, EDIT_CHANGED, OUTPUTS_CHANGED); @@ -741,6 +743,14 @@ void OBSBasicSettings::LoadGeneralSettings() LoadLanguageList(); LoadThemeList(); + bool warnBeforeStreamStart = config_get_bool(GetGlobalConfig(), + "BasicWindow", "WarnBeforeStartingStream"); + ui->warnBeforeStreamStart->setChecked(warnBeforeStreamStart); + + bool warnBeforeStreamStop = config_get_bool(GetGlobalConfig(), + "BasicWindow", "WarnBeforeStoppingStream"); + ui->warnBeforeStreamStop->setChecked(warnBeforeStreamStop); + loading = false; } @@ -1954,6 +1964,13 @@ void OBSBasicSettings::SaveGeneralSettings() theme.c_str()); App()->SetTheme(theme); } + + config_set_bool(GetGlobalConfig(), "BasicWindow", + "WarnBeforeStartingStream", + ui->warnBeforeStreamStart->isChecked()); + config_set_bool(GetGlobalConfig(), "BasicWindow", + "WarnBeforeStoppingStream", + ui->warnBeforeStreamStop->isChecked()); } void OBSBasicSettings::SaveStream1Settings()