Bladeren bron

UI: Switch format tooltip based on user selection

derrod 2 jaren geleden
bovenliggende
commit
b86e878a75
3 gewijzigde bestanden met toevoegingen van 19 en 7 verwijderingen
  1. 2 1
      UI/data/locale/en-US.ini
  2. 0 6
      UI/forms/OBSBasicSettings.ui
  3. 17 0
      UI/window-basic-settings.cpp

+ 2 - 1
UI/data/locale/en-US.ini

@@ -943,7 +943,8 @@ Basic.Settings.Output.Format.TS="MPEG-TS (.ts)"
 Basic.Settings.Output.Format.HLS="HLS (.m3u8 + .ts)"
 Basic.Settings.Output.Format.fMP4="Fragmented MP4 (.mp4)"
 Basic.Settings.Output.Format.fMOV="Fragmented MOV (.mov)"
-Basic.Settings.Output.Format.TT="Fragmented MP4/MOV writes the recording in chunks and does not require the same finalization as traditional MP4/MOV files.\nThis ensures the file remains playable even if writing to disk is interrupted, for example, as a result of a BSOD or power loss.\n\nThis may not be compatible with all players and editors. Use File → Remux Recordings to convert the file into a more compatible format if necessary."
+Basic.Settings.Output.Format.TT.fmov="Fragmented MOV writes the recording in chunks and does not require the same finalization as traditional MOV files.\nThis ensures the file remains playable even if writing to disk is interrupted, for example, as a result of a BSOD or power loss.\n\nThis may not be compatible with all players and editors. Use File → Remux Recordings to convert the file into a more compatible format if necessary."
+Basic.Settings.Output.Format.TT.fmp4="Fragmented MP4 writes the recording in chunks and does not require the same finalization as traditional MP4 files.\nThis ensures the file remains playable even if writing to disk is interrupted, for example, as a result of a BSOD or power loss.\n\nThis may not be compatible with all players and editors. Use File → Remux Recordings to convert the file into a more compatible format if necessary."
 Basic.Settings.Output.Encoder.Video="Video Encoder"
 Basic.Settings.Output.Encoder.Audio="Audio Encoder"
 Basic.Settings.Output.SelectDirectory="Select Recording Directory"

+ 0 - 6
UI/forms/OBSBasicSettings.ui

@@ -1901,9 +1901,6 @@
                        </item>
                        <item row="3" column="1">
                         <widget class="QComboBox" name="simpleOutRecFormat">
-                         <property name="toolTip">
-                          <string>Basic.Settings.Output.Format.TT</string>
-                         </property>
                          <property name="editable">
                           <bool>false</bool>
                          </property>
@@ -2878,9 +2875,6 @@
                                </item>
                                <item row="2" column="1">
                                 <widget class="QComboBox" name="advOutRecFormat">
-                                 <property name="toolTip">
-                                  <string>Basic.Settings.Output.Format.TT</string>
-                                 </property>
                                  <property name="sizePolicy">
                                   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
                                    <horstretch>0</horstretch>

+ 17 - 0
UI/window-basic-settings.cpp

@@ -4998,6 +4998,15 @@ void OBSBasicSettings::AdvOutRecCheckCodecs()
 {
 	QString recFormat = ui->advOutRecFormat->currentData().toString();
 
+	/* Set tooltip if available */
+	QString tooltip =
+		QTStr("Basic.Settings.Output.Format.TT." + recFormat.toUtf8());
+
+	if (!tooltip.startsWith("Basic.Settings.Output"))
+		ui->advOutRecFormat->setToolTip(tooltip);
+	else
+		ui->advOutRecFormat->setToolTip(nullptr);
+
 	string format = recFormat.toStdString();
 	/* Remove leading "f" for fragmented MP4/MOV */
 	if (format == "fmp4" || format == "fmov")
@@ -5759,6 +5768,14 @@ void OBSBasicSettings::SimpleRecordingEncoderChanged()
 	}
 
 	QString format = ui->simpleOutRecFormat->currentData().toString();
+	/* Set tooltip if available */
+	QString tooltip =
+		QTStr("Basic.Settings.Output.Format.TT." + format.toUtf8());
+
+	if (!tooltip.startsWith("Basic.Settings.Output"))
+		ui->simpleOutRecFormat->setToolTip(tooltip);
+	else
+		ui->simpleOutRecFormat->setToolTip(nullptr);
 
 	if (qual == "Lossless") {
 		if (!warning.isEmpty())