From 99a98a6d9ca400020796df9298a4ed64cfaa2fbb Mon Sep 17 00:00:00 2001 From: jstebbins Date: Tue, 19 May 2015 21:16:14 +0000 Subject: LinGui: refactor subtitle pane Store subtitle track info in json job compatible format. Copy directly into job when adding new job. Also, removed "Foreign audio search" from the subtitle track dropdown and made an explicit "Foreign audio search" toolbar button. This makes it easy to enforce only one such track in the list and gives me a place to put a better tooltip explaining FAS. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7211 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- gtk/src/queuehandler.c | 58 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 17 deletions(-) (limited to 'gtk/src/queuehandler.c') diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index dcac384f0..19fce60d1 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -22,6 +22,7 @@ #include "callbacks.h" #include "presets.h" #include "audiohandler.h" +#include "subtitlehandler.h" #include "ghb-dvd.h" #include "plist.h" @@ -597,17 +598,38 @@ add_to_queue_list(signal_user_data_t *ud, GhbValue *settings, GtkTreeIter *piter // Subtitle Tracks: count // Subtitle description(Subtitle options) // ... - const GhbValue *sub_list; + const GhbValue *sub_settings, *sub_list, *sub_search; + gboolean search; - sub_list = ghb_dict_get_value(settings, "subtitle_list"); + sub_settings = ghb_get_subtitle_settings(settings); + sub_list = ghb_dict_get(sub_settings, "SubtitleList"); + sub_search = ghb_dict_get(sub_settings, "Search"); + search = ghb_dict_get_bool(sub_search, "Enable"); count = ghb_array_len(sub_list); - if (count == 1) + if (count + search == 1) { XPRINT(_("Subtitle: ")); } - else if (count > 1) + else if (count + search > 1) { - XPRINT(_("Subtitle Tracks: %d\n"), count); + XPRINT(_("Subtitle Tracks: %d\n"), count + search); + } + if (search) + { + const gchar *track; + gboolean force, burn, def; + + track = ghb_dict_get_string(sub_search, "Description"); + force = ghb_dict_get_bool(sub_search, "Forced"); + burn = ghb_dict_get_bool(sub_search, "Burn"); + def = ghb_dict_get_bool(sub_search, "Default"); + if (count + search > 1) + XPRINT("\t"); + XPRINT("%s%s%s%s\n", track, + force ? _(" (Forced Only)") : "", + burn ? _(" (Burn)") : "", + def ? _(" (Default)") : "" + ); } for (ii = 0; ii < count; ii++) { @@ -617,32 +639,34 @@ add_to_queue_list(signal_user_data_t *ud, GhbValue *settings, GtkTreeIter *piter gint source; settings = ghb_array_get(sub_list, ii); - track = ghb_dict_get_string(settings, "SubtitleTrackDescription"); - source = ghb_dict_get_int(settings, "SubtitleSource"); - force = ghb_dict_get_bool(settings, "SubtitleForced"); - burn = ghb_dict_get_bool(settings, "SubtitleBurned"); - def = ghb_dict_get_bool(settings, "SubtitleDefaultTrack"); - if (count > 1) + track = ghb_dict_get_string(settings, "Description"); + source = ghb_dict_get_int(settings, "Source"); + force = ghb_dict_get_bool(settings, "Forced"); + burn = ghb_dict_get_bool(settings, "Burn"); + def = ghb_dict_get_bool(settings, "Default"); + if (count + search > 1) XPRINT("\t"); if (source != SRTSUB) { XPRINT("%s%s%s%s\n", track, - force ? _(" (Force)"):"", - burn ? _(" (Burn)"):"", - def ? _(" (Default)"):"" + force ? _(" (Forced Only)") : "", + burn ? _(" (Burn)") : "", + def ? _(" (Default)") : "" ); } else { + GhbValue *srt; gint offset; const gchar *filename, *code; gchar *basename; - offset = ghb_dict_get_int(settings, "SrtOffset"); - filename = ghb_dict_get_string(settings, "SrtFile"); + srt = ghb_dict_get(settings, "SRT"); + offset = ghb_dict_get_int(settings, "Offset"); + filename = ghb_dict_get_string(srt, "File"); basename = g_path_get_basename(filename); - code = ghb_dict_get_string(settings, "SrtCodeset"); + code = ghb_dict_get_string(srt, "Codeset"); XPRINT(_(" %s (%s), %s, Offset (ms) %d%s\n"), track, code, basename, offset, def ? " (Default)":""); -- cgit v1.2.3