summaryrefslogtreecommitdiffstats
path: root/gtk/src/subtitlehandler.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-08-06 17:19:22 +0000
committerjstebbins <[email protected]>2015-08-06 17:19:22 +0000
commitac9f0b5f83c2915b4d1260726b8867cc5789fab4 (patch)
treec6ade43f5e35eba99e9eb4bb9a4488e7219aba36 /gtk/src/subtitlehandler.c
parent8bea39017f7c11ad43d3485cf82684f810240fb6 (diff)
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
Diffstat (limited to 'gtk/src/subtitlehandler.c')
-rw-r--r--gtk/src/subtitlehandler.c22
1 files changed, 15 insertions, 7 deletions
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