UI: Add support for "More Info" link from service
(Jim) Allows the ability to get a link from the service's settings about a specific service selection the user chooses and display it as a "More Info" button that the user can click to find out more information about that particular service.
This commit is contained in:
parent
c574b65488
commit
41f4a0b0b9
8 changed files with 138 additions and 6 deletions
|
|
@ -285,6 +285,8 @@ AutoConfigStreamPage::AutoConfigStreamPage(QWidget *parent)
|
|||
|
||||
connect(ui->service, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(UpdateKeyLink()));
|
||||
connect(ui->service, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(UpdateMoreInfoLink()));
|
||||
|
||||
connect(ui->key, SIGNAL(textChanged(const QString &)), this,
|
||||
SLOT(UpdateCompleted()));
|
||||
|
|
@ -575,6 +577,35 @@ void AutoConfigStreamPage::ServiceChanged()
|
|||
UpdateCompleted();
|
||||
}
|
||||
|
||||
void AutoConfigStreamPage::UpdateMoreInfoLink()
|
||||
{
|
||||
if (IsCustomService()) {
|
||||
ui->moreInfoButton->hide();
|
||||
return;
|
||||
}
|
||||
|
||||
QString serviceName = ui->service->currentText();
|
||||
obs_properties_t *props = obs_get_service_properties("rtmp_common");
|
||||
obs_property_t *services = obs_properties_get(props, "service");
|
||||
|
||||
OBSData settings = obs_data_create();
|
||||
obs_data_release(settings);
|
||||
|
||||
obs_data_set_string(settings, "service", QT_TO_UTF8(serviceName));
|
||||
obs_property_modified(services, settings);
|
||||
|
||||
const char *more_info_link =
|
||||
obs_data_get_string(settings, "more_info_link");
|
||||
|
||||
if (!more_info_link || (*more_info_link == '\0')) {
|
||||
ui->moreInfoButton->hide();
|
||||
} else {
|
||||
ui->moreInfoButton->setTargetUrl(QUrl(more_info_link));
|
||||
ui->moreInfoButton->show();
|
||||
}
|
||||
obs_properties_destroy(props);
|
||||
}
|
||||
|
||||
void AutoConfigStreamPage::UpdateKeyLink()
|
||||
{
|
||||
QString serviceName = ui->service->currentText();
|
||||
|
|
@ -814,6 +845,7 @@ AutoConfig::AutoConfig(QWidget *parent) : QWizard(parent)
|
|||
|
||||
streamPage->UpdateServerList();
|
||||
streamPage->UpdateKeyLink();
|
||||
streamPage->UpdateMoreInfoLink();
|
||||
streamPage->lastService.clear();
|
||||
|
||||
if (!customServer) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue