From d024e58390c5900d7badefa298f803cade8f356c Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Tue, 12 Sep 2017 12:43:11 -0700 Subject: LinGui: Reorgainize Summary pane Synching up with https://github.com/HandBrake/HandBrake/issues/833 --- gtk/src/queuehandler.c | 47 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) (limited to 'gtk/src/queuehandler.c') diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index a708598fa..c8fdd00fc 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -78,6 +78,47 @@ queue_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_t } } +char * +ghb_subtitle_short_description(const GhbValue *subsource, + const GhbValue *subsettings) +{ + GhbValue *srt; + char *desc = NULL; + + srt = ghb_dict_get(subsettings, "SRT"); + if (srt != NULL) + { + const gchar *code; + const gchar *lang; + const iso639_lang_t *iso; + + lang = ghb_dict_get_string(srt, "Language"); + code = ghb_dict_get_string(srt, "Codeset"); + + iso = lang_lookup(lang); + if (iso != NULL) + { + if (iso->native_name != NULL) + lang = iso->native_name; + else + lang = iso->eng_name; + } + + desc = g_strdup_printf("%s (%s)(SRT)", lang, code); + } + else if (subsource == NULL) + { + desc = g_strdup(_("Foreign Audio Scan")); + } + else + { + const char * lang = ghb_dict_get_string(subsource, "Language"); + desc = g_strdup_printf("%s", lang); + } + + return desc; +} + static char * subtitle_get_track_description(const GhbValue *subsource, const GhbValue *subsettings) @@ -120,15 +161,13 @@ subtitle_get_track_description(const GhbValue *subsource, } else if (subsource == NULL) { - desc = g_strdup(_("Foreign Audio Search")); + desc = g_strdup(_("Foreign Audio Scan")); } else { int track = ghb_dict_get_int(subsettings, "Track"); - int source = ghb_dict_get_int(subsource, "Source"); const char * lang = ghb_dict_get_string(subsource, "Language"); - desc = g_strdup_printf("%d - %s (%s)", track + 1, - lang, hb_subsource_name(source)); + desc = g_strdup_printf("%d - %s", track + 1, lang); } return desc; -- cgit v1.2.3