diff options
author | jstebbins <[email protected]> | 2011-11-01 17:47:23 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2011-11-01 17:47:23 +0000 |
commit | 6e9e1c71e3e93d0bbeff9c84a27c290c3ef006ee (patch) | |
tree | 42662e56b273c2b68f45e6e32374d7371c548e60 | |
parent | 1262abf0b658545d7e565eeea8db7914f75994c0 (diff) |
LinGui: add index to audio descr in audio list
Audios that have identical descriptions are difficult to distinguish in
the audio list. So add the track index to the display.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4334 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | gtk/src/hb-backend.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 4b765da29..900b82295 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -2164,7 +2164,15 @@ audio_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) } } if (count > 100) count = 100; - if (audio_track_opts.map) g_free(audio_track_opts.map); + if (audio_track_opts.map) + { + for (ii = 0; ii < audio_track_opts.count; ii++) + { + if (audio_track_opts.map[ii].option) + g_free(audio_track_opts.map[ii].option); + } + g_free(audio_track_opts.map); + } if (count > 0) { audio_track_opts.count = count; @@ -2186,7 +2194,7 @@ audio_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) 3, -1.0, 4, "none", -1); - audio_track_opts.map[0].option = "No Audio"; + audio_track_opts.map[0].option = g_strdup("No Audio"); audio_track_opts.map[0].shortOpt = "none"; audio_track_opts.map[0].ivalue = -1; audio_track_opts.map[0].svalue = "none"; @@ -2197,7 +2205,8 @@ audio_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) { audio = (hb_audio_config_t *) hb_list_audio_config_item( title->list_audio, ii ); gtk_list_store_append(store, &iter); - str = g_strdup_printf("<small>%s</small>", audio->lang.description); + char *tmp = g_strdup_printf("%d - %s", ii + 1, audio->lang.description); + str = g_strdup_printf("<small>%s</small>", tmp); gtk_list_store_set(store, &iter, 0, str, 1, TRUE, @@ -2206,7 +2215,8 @@ audio_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) 4, index_str[ii], -1); g_free(str); - audio_track_opts.map[ii].option = audio->lang.description, + audio_track_opts.map[ii].option = g_strdup(tmp); + g_free(tmp); audio_track_opts.map[ii].shortOpt = index_str[ii]; audio_track_opts.map[ii].ivalue = ii; audio_track_opts.map[ii].svalue = index_str[ii]; |