From: jstebbins Date: Thu, 6 Aug 2015 17:19:22 +0000 (+0000) Subject: LinGui: don't hide foreign audio subtitle options X-Git-Tag: 1.0.0~992 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac9f0b5f83c2915b4d1260726b8867cc5789fab4;p=handbrake LinGui: don't hide foreign audio subtitle options Make the insensitive when there is not preferred language set. And improve the tooltip to indicate that a preferred language is required for these options. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7396 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- 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.False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 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. +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. start True True @@ -4865,7 +4867,9 @@ This search pass finds short sequences of foreign audio and provides subtitles f True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - When the default audio track is not your preferred language, add a subtitle track. + 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. start True True 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.False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 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. +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. start True True @@ -4866,7 +4868,9 @@ This search pass finds short sequences of foreign audio and provides subtitles f True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - When the default audio track is not your preferred language, add a subtitle track. + 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. start True True 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.False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 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. +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. start True True @@ -4865,7 +4867,9 @@ This search pass finds short sequences of foreign audio and provides subtitles f True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - When the default audio track is not your preferred language, add a subtitle track. + 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. start True True 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