Merge pull request #1725 from derrod/bwtest-cbox
UI: Add checkbox for Twitch bandwidth test mode
This commit is contained in:
commit
0377a34095
@ -297,7 +297,14 @@ void OAuthStreamKey::OnStreamConfig()
|
||||
|
||||
obs_data_t *settings = obs_service_get_settings(service);
|
||||
|
||||
obs_data_set_string(settings, "key", key_.c_str());
|
||||
bool bwtest = obs_data_get_bool(settings, "bwtest");
|
||||
|
||||
if (bwtest && strcmp(this->service(), "Twitch") == 0)
|
||||
obs_data_set_string(settings, "key",
|
||||
key_.append("?bandwidthtest=true").c_str());
|
||||
else
|
||||
obs_data_set_string(settings, "key", key_.c_str());
|
||||
|
||||
obs_service_update(service, settings);
|
||||
|
||||
obs_data_release(settings);
|
||||
|
@ -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?"
|
||||
@ -628,6 +632,7 @@ Basic.Settings.Stream.StreamType="Stream Type"
|
||||
Basic.Settings.Stream.Custom.UseAuthentication="Use authentication"
|
||||
Basic.Settings.Stream.Custom.Username="Username"
|
||||
Basic.Settings.Stream.Custom.Password="Password"
|
||||
Basic.Settings.Stream.BandwidthTestMode="Enable Bandwidth Test Mode"
|
||||
|
||||
# basic mode 'output' settings
|
||||
Basic.Settings.Output="Output"
|
||||
|
@ -1062,17 +1062,17 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QCheckBox" name="useAuth">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Stream.Custom.UseAuthentication</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="authUsername"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="authUsernameLabel">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Stream.Custom.Username</string>
|
||||
@ -1082,7 +1082,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="authPwLabel">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Stream.Custom.Password</string>
|
||||
@ -1092,7 +1092,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<item row="7" column="1">
|
||||
<widget class="QWidget" name="authPwWidget" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_25">
|
||||
<property name="leftMargin">
|
||||
@ -1124,6 +1124,13 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QCheckBox" name="bandwidthTestEnable">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Stream.BandwidthTestMode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
@ -5521,7 +5521,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"),
|
||||
|
@ -36,6 +36,7 @@ void OBSBasicSettings::InitStreamPage()
|
||||
{
|
||||
ui->connectAccount2->setVisible(false);
|
||||
ui->disconnectAccount->setVisible(false);
|
||||
ui->bandwidthTestEnable->setVisible(false);
|
||||
|
||||
int vertSpacing = ui->topStreamLayout->verticalSpacing();
|
||||
|
||||
@ -90,6 +91,9 @@ void OBSBasicSettings::LoadStream1Settings()
|
||||
idx = 1;
|
||||
}
|
||||
ui->service->setCurrentIndex(idx);
|
||||
|
||||
bool bw_test = obs_data_get_bool(settings, "bwtest");
|
||||
ui->bandwidthTestEnable->setChecked(bw_test);
|
||||
}
|
||||
|
||||
UpdateServerList();
|
||||
@ -151,6 +155,7 @@ void OBSBasicSettings::SaveStream1Settings()
|
||||
}
|
||||
}
|
||||
|
||||
obs_data_set_bool(settings, "bwtest", ui->bandwidthTestEnable->isChecked());
|
||||
obs_data_set_string(settings, "key", QT_TO_UTF8(ui->key->text()));
|
||||
|
||||
OBSService newService = obs_service_create(service_id,
|
||||
@ -260,6 +265,7 @@ void OBSBasicSettings::on_service_currentIndexChanged(int)
|
||||
bool custom = IsCustomService();
|
||||
|
||||
ui->disconnectAccount->setVisible(false);
|
||||
ui->bandwidthTestEnable->setVisible(false);
|
||||
|
||||
#ifdef BROWSER_AVAILABLE
|
||||
if (cef) {
|
||||
@ -411,6 +417,9 @@ void OBSBasicSettings::OnOAuthStreamKeyConnected()
|
||||
ui->streamKeyLabel->setVisible(false);
|
||||
ui->connectAccount2->setVisible(false);
|
||||
ui->disconnectAccount->setVisible(true);
|
||||
|
||||
if (strcmp(a->service(), "Twitch") == 0)
|
||||
ui->bandwidthTestEnable->setVisible(true);
|
||||
}
|
||||
|
||||
ui->streamStackWidget->setCurrentIndex((int)Section::StreamKey);
|
||||
@ -473,6 +482,7 @@ void OBSBasicSettings::on_disconnectAccount_clicked()
|
||||
ui->streamKeyLabel->setVisible(true);
|
||||
ui->connectAccount2->setVisible(true);
|
||||
ui->disconnectAccount->setVisible(false);
|
||||
ui->bandwidthTestEnable->setVisible(false);
|
||||
ui->key->setText("");
|
||||
}
|
||||
|
||||
|
@ -334,6 +334,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
HookWidget(ui->server, COMBO_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->customServer, EDIT_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->key, EDIT_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->bandwidthTestEnable, CHECK_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->useAuth, CHECK_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->authUsername, EDIT_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->authPw, EDIT_CHANGED, STREAM1_CHANGED);
|
||||
|
Loading…
x
Reference in New Issue
Block a user