Browse Source

UI: Fix stream key UI not showing when using stream key

In the settings window, when the user chooses to use a stream key
instead of connecting their account, it switches widgets to show the
stream key UI. However, when opening the settings window again after
having done that, it's supposed to continue to show the stream key UI,
and that functionality was broken by obsproject/obs-studio#9272. It did
this because OBSBasicSettings::ServiceChanged() no longer called
reset_service_ui_fields() because the lastService member variable was no
longer set to empty in OBSBasicSettings::LoadStream1Settings().

This fixes it by just adding a parameter to
OBSBasicSettings::ServiceChanged() to make it forcibly reset the fields
when loading stream settings.
Lain 2 years ago
parent
commit
112adb0a73
2 changed files with 4 additions and 4 deletions
  1. 3 3
      UI/window-basic-settings-stream.cpp
  2. 1 1
      UI/window-basic-settings.hpp

+ 3 - 3
UI/window-basic-settings-stream.cpp

@@ -162,7 +162,7 @@ void OBSBasicSettings::LoadStream1Settings()
 	else
 		ui->key->setText(key);
 
-	ServiceChanged();
+	ServiceChanged(true);
 
 	UpdateKeyLink();
 	UpdateMoreInfoLink();
@@ -520,7 +520,7 @@ void OBSBasicSettings::on_customServer_textChanged(const QString &)
 		lastCustomServer = ui->customServer->text();
 }
 
-void OBSBasicSettings::ServiceChanged()
+void OBSBasicSettings::ServiceChanged(bool resetFields)
 {
 	std::string service = QT_TO_UTF8(ui->service->currentText());
 	bool custom = IsCustomService();
@@ -531,7 +531,7 @@ void OBSBasicSettings::ServiceChanged()
 	ui->twitchAddonDropdown->setVisible(false);
 	ui->twitchAddonLabel->setVisible(false);
 
-	if (lastService != service.c_str()) {
+	if (resetFields || lastService != service.c_str()) {
 		reset_service_ui_fields(ui.get(), service, loading);
 	}
 

+ 1 - 1
UI/window-basic-settings.hpp

@@ -261,7 +261,7 @@ private:
 	int prevLangIndex;
 	bool prevBrowserAccel;
 
-	void ServiceChanged();
+	void ServiceChanged(bool resetFields = false);
 	QString FindProtocol();
 	void UpdateServerList();
 	void UpdateKeyLink();