summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/ghb-3.12.ui8
-rw-r--r--gtk/src/ghb-3.14.ui8
-rw-r--r--gtk/src/ghb.ui8
-rw-r--r--gtk/src/subtitlehandler.c22
4 files changed, 33 insertions, 13 deletions
diff --git a/gtk/src/ghb-3.12.ui b/gtk/src/ghb-3.12.ui
index 1bf43d669..486d77b37 100644
--- a/gtk/src/ghb-3.12.ui
+++ b/gtk/src/ghb-3.12.ui
@@ -4848,7 +4848,9 @@ for determining subtitle selection settings when there is foreign audio.</proper
<property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip_text" translatable="yes">Add "Foreign Audio Search" when the default audio track is your preferred language.
-This search pass finds short sequences of foreign audio and provides subtitles for them.</property>
+This search pass finds short sequences of foreign audio and provides subtitles for them.
+
+This option requires a language to be set in the Selected Languages list.</property>
<property name="halign">start</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
@@ -4865,7 +4867,9 @@ This search pass finds short sequences of foreign audio and provides subtitles f
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="tooltip_text" translatable="yes">When the default audio track is not your preferred language, add a subtitle track.</property>
+ <property name="tooltip_text" translatable="yes">When the default audio track is not your preferred language, add a subtitle track.
+
+This option requires a language to be set in the Selected Languages list.</property>
<property name="halign">start</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
diff --git a/gtk/src/ghb-3.14.ui b/gtk/src/ghb-3.14.ui
index ca2073b94..3f90c84d2 100644
--- a/gtk/src/ghb-3.14.ui
+++ b/gtk/src/ghb-3.14.ui
@@ -4849,7 +4849,9 @@ for determining subtitle selection settings when there is foreign audio.</proper
<property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip_text" translatable="yes">Add "Foreign Audio Search" when the default audio track is your preferred language.
-This search pass finds short sequences of foreign audio and provides subtitles for them.</property>
+This search pass finds short sequences of foreign audio and provides subtitles for them.
+
+This option requires a language to be set in the Selected Languages list.</property>
<property name="halign">start</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
@@ -4866,7 +4868,9 @@ This search pass finds short sequences of foreign audio and provides subtitles f
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="tooltip_text" translatable="yes">When the default audio track is not your preferred language, add a subtitle track.</property>
+ <property name="tooltip_text" translatable="yes">When the default audio track is not your preferred language, add a subtitle track.
+
+This option requires a language to be set in the Selected Languages list.</property>
<property name="halign">start</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui
index 018606612..da314b4ca 100644
--- a/gtk/src/ghb.ui
+++ b/gtk/src/ghb.ui
@@ -4848,7 +4848,9 @@ for determining subtitle selection settings when there is foreign audio.</proper
<property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip_text" translatable="yes">Add "Foreign Audio Search" when the default audio track is your preferred language.
-This search pass finds short sequences of foreign audio and provides subtitles for them.</property>
+This search pass finds short sequences of foreign audio and provides subtitles for them.
+
+This option requires a language to be set in the Selected Languages list.</property>
<property name="halign">start</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
@@ -4865,7 +4867,9 @@ This search pass finds short sequences of foreign audio and provides subtitles f
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="tooltip_text" translatable="yes">When the default audio track is not your preferred language, add a subtitle track.</property>
+ <property name="tooltip_text" translatable="yes">When the default audio track is not your preferred language, add a subtitle track.
+
+This option requires a language to be set in the Selected Languages list.</property>
<property name="halign">start</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
diff --git a/gtk/src/subtitlehandler.c b/gtk/src/subtitlehandler.c
index e2cde7dc4..22d034475 100644
--- a/gtk/src/subtitlehandler.c
+++ b/gtk/src/subtitlehandler.c
@@ -1273,20 +1273,28 @@ subtitle_update_pref_lang(signal_user_data_t *ud, const iso639_lang_t *lang)
ghb_dict_set_string(ud->settings, "PreferredLanguage", code);
+ // If there is no preferred language, disable options that require
+ // a preferred language to be set.
+ gboolean sensitive = !(lang == NULL || !strncmp(code, "und", 4));
button = GTK_BUTTON(GHB_WIDGET(ud->builder,
"SubtitleAddForeignAudioSubtitle"));
- str = g_strdup_printf(_("Add %s subtitle track if default audio is not %s"),
- name, name);
+ if (sensitive)
+ {
+ str = g_strdup_printf(
+ _("Add %s subtitle track if default audio is not %s"), name, name);
+ }
+ else
+ {
+ str = g_strdup_printf(
+ _("Add subtitle track if default audio is not your preferred language"));
+ }
gtk_button_set_label(button, str);
g_free(str);
- // If there is no preferred language, hide options that require
- // a preferred language to be set.
- gboolean visible = !(lang == NULL || !strncmp(code, "und", 4));
- gtk_widget_set_visible(GTK_WIDGET(button), visible);
+ gtk_widget_set_sensitive(GTK_WIDGET(button), sensitive);
button = GTK_BUTTON(GHB_WIDGET(ud->builder,
"SubtitleAddForeignAudioSearch"));
- gtk_widget_set_visible(GTK_WIDGET(button), visible);
+ gtk_widget_set_sensitive(GTK_WIDGET(button), sensitive);
}
void