Browse Source

UI: Add stream key tooltip in the auto-config wizard

田七不甜 2 years ago
parent
commit
2dbd7bf7ff
1 changed files with 16 additions and 1 deletions
  1. 16 1
      UI/window-basic-auto-config.cpp

+ 16 - 1
UI/window-basic-auto-config.cpp

@@ -731,9 +731,24 @@ void AutoConfigStreamPage::UpdateKeyLink()
 	if (serviceName == "Dacast") {
 	if (serviceName == "Dacast") {
 		ui->streamKeyLabel->setText(
 		ui->streamKeyLabel->setText(
 			QTStr("Basic.AutoConfig.StreamPage.EncoderKey"));
 			QTStr("Basic.AutoConfig.StreamPage.EncoderKey"));
-	} else {
+		ui->streamKeyLabel->setToolTip("");
+	} else if (!IsCustomService()) {
 		ui->streamKeyLabel->setText(
 		ui->streamKeyLabel->setText(
 			QTStr("Basic.AutoConfig.StreamPage.StreamKey"));
 			QTStr("Basic.AutoConfig.StreamPage.StreamKey"));
+		ui->streamKeyLabel->setToolTip("");
+	} else {
+		/* add tooltips for stream key */
+		QString file = !App()->IsThemeDark()
+				       ? ":/res/images/help.svg"
+				       : ":/res/images/help_light.svg";
+		QString lStr = "<html>%1 <img src='%2' style=' \
+				vertical-align: bottom;  \
+				' /></html>";
+
+		ui->streamKeyLabel->setText(lStr.arg(
+			QTStr("Basic.AutoConfig.StreamPage.StreamKey"), file));
+		ui->streamKeyLabel->setToolTip(
+			QTStr("Basic.AutoConfig.StreamPage.StreamKey.ToolTip"));
 	}
 	}
 
 
 	if (QString(streamKeyLink).isNull() ||
 	if (QString(streamKeyLink).isNull() ||