Selaa lähdekoodia

UI: Add confirmation dialog for bandwidth test mode

derrod 6 vuotta sitten
vanhempi
sitoutus
4595d49e98
2 muutettua tiedostoa jossa 19 lisäystä ja 1 poistoa
  1. 4 0
      UI/data/locale/en-US.ini
  2. 15 1
      UI/window-basic-main.cpp

+ 4 - 0
UI/data/locale/en-US.ini

@@ -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?"

+ 15 - 1
UI/window-basic-main.cpp

@@ -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"),