|
|
@@ -75,6 +75,13 @@ void OBSBasicSettings::LoadStream1Settings()
|
|
|
if (strcmp(type, "rtmp_custom") == 0) {
|
|
|
ui->service->setCurrentIndex(0);
|
|
|
ui->customServer->setText(server);
|
|
|
+
|
|
|
+ bool use_auth = obs_data_get_bool(settings, "use_auth");
|
|
|
+ const char *username = obs_data_get_string(settings, "username");
|
|
|
+ const char *password = obs_data_get_string(settings, "password");
|
|
|
+ ui->authUsername->setText(QT_UTF8(username));
|
|
|
+ ui->authPw->setText(QT_UTF8(password));
|
|
|
+ ui->useAuth->setChecked(use_auth);
|
|
|
} else {
|
|
|
int idx = ui->service->findText(service);
|
|
|
if (idx == -1) {
|
|
|
@@ -134,6 +141,14 @@ void OBSBasicSettings::SaveStream1Settings()
|
|
|
} else {
|
|
|
obs_data_set_string(settings, "server",
|
|
|
QT_TO_UTF8(ui->customServer->text()));
|
|
|
+ obs_data_set_bool(settings, "use_auth",
|
|
|
+ ui->useAuth->isChecked());
|
|
|
+ if (ui->useAuth->isChecked()) {
|
|
|
+ obs_data_set_string(settings, "username",
|
|
|
+ QT_TO_UTF8(ui->authUsername->text()));
|
|
|
+ obs_data_set_string(settings, "password",
|
|
|
+ QT_TO_UTF8(ui->authPw->text()));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
obs_data_set_string(settings, "key", QT_TO_UTF8(ui->key->text()));
|
|
|
@@ -267,6 +282,12 @@ void OBSBasicSettings::on_service_currentIndexChanged(int)
|
|
|
ui->connectAccount2->setVisible(false);
|
|
|
#endif
|
|
|
|
|
|
+ ui->useAuth->setVisible(custom);
|
|
|
+ ui->authUsernameLabel->setVisible(custom);
|
|
|
+ ui->authUsername->setVisible(custom);
|
|
|
+ ui->authPwLabel->setVisible(custom);
|
|
|
+ ui->authPwWidget->setVisible(custom);
|
|
|
+
|
|
|
if (custom) {
|
|
|
ui->streamkeyPageLayout->insertRow(1, ui->serverLabel,
|
|
|
ui->serverStackedWidget);
|
|
|
@@ -274,6 +295,7 @@ void OBSBasicSettings::on_service_currentIndexChanged(int)
|
|
|
ui->serverStackedWidget->setCurrentIndex(1);
|
|
|
ui->serverStackedWidget->setVisible(true);
|
|
|
ui->serverLabel->setVisible(true);
|
|
|
+ on_useAuth_toggled();
|
|
|
} else {
|
|
|
ui->serverStackedWidget->setCurrentIndex(0);
|
|
|
}
|
|
|
@@ -337,6 +359,17 @@ void OBSBasicSettings::on_show_clicked()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void OBSBasicSettings::on_authPwShow_clicked()
|
|
|
+{
|
|
|
+ if (ui->authPw->echoMode() == QLineEdit::Password) {
|
|
|
+ ui->authPw->setEchoMode(QLineEdit::Normal);
|
|
|
+ ui->authPwShow->setText(QTStr("Hide"));
|
|
|
+ } else {
|
|
|
+ ui->authPw->setEchoMode(QLineEdit::Password);
|
|
|
+ ui->authPwShow->setText(QTStr("Show"));
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
OBSService OBSBasicSettings::SpawnTempService()
|
|
|
{
|
|
|
bool custom = IsCustomService();
|
|
|
@@ -447,3 +480,16 @@ void OBSBasicSettings::on_useStreamKey_clicked()
|
|
|
{
|
|
|
ui->streamStackWidget->setCurrentIndex((int)Section::StreamKey);
|
|
|
}
|
|
|
+
|
|
|
+void OBSBasicSettings::on_useAuth_toggled()
|
|
|
+{
|
|
|
+ if (!IsCustomService())
|
|
|
+ return;
|
|
|
+
|
|
|
+ bool use_auth = ui->useAuth->isChecked();
|
|
|
+
|
|
|
+ ui->authUsernameLabel->setVisible(use_auth);
|
|
|
+ ui->authUsername->setVisible(use_auth);
|
|
|
+ ui->authPwLabel->setVisible(use_auth);
|
|
|
+ ui->authPwWidget->setVisible(use_auth);
|
|
|
+}
|