summaryrefslogtreecommitdiffstats
path: root/gtk/src/queuehandler.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-05-19 21:16:14 +0000
committerjstebbins <[email protected]>2015-05-19 21:16:14 +0000
commit99a98a6d9ca400020796df9298a4ed64cfaa2fbb (patch)
treecc192b06e4ef4cf4b5494bed2859a9012272e981 /gtk/src/queuehandler.c
parentaef3d731cabd8a5f5a7166741b848f482246a51b (diff)
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
Diffstat (limited to 'gtk/src/queuehandler.c')
-rw-r--r--gtk/src/queuehandler.c58
1 files changed, 41 insertions, 17 deletions
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(_("<b>Subtitle:</b> "));
}
- else if (count > 1)
+ else if (count + search > 1)
{
- XPRINT(_("<b>Subtitle Tracks: %d</b>\n"), count);
+ XPRINT(_("<b>Subtitle Tracks: %d</b>\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("<small>%s%s%s%s</small>\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("<small>%s%s%s%s</small>\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(_("<small> %s (%s), %s, Offset (ms) %d%s</small>\n"),
track, code, basename, offset, def ? " (Default)":"");