diff options
author | jstebbins <[email protected]> | 2015-06-17 21:59:26 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2015-06-17 21:59:26 +0000 |
commit | 7b24a71db27d1ee6253f7ee0e5fe1b9e575e7a2a (patch) | |
tree | 56c6445aa6b73039f1077384e1a8d05554fc704b /gtk | |
parent | 5d197f1cbad9e64eeba2188e309b3f5ef74ccc9f (diff) |
LinGui: fix video options edit box tooltip
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7302 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/src/videohandler.c | 34 | ||||
-rw-r--r-- | gtk/src/x264handler.c | 30 |
2 files changed, 36 insertions, 28 deletions
diff --git a/gtk/src/videohandler.c b/gtk/src/videohandler.c index 6f07e90d2..b4c0437b8 100644 --- a/gtk/src/videohandler.c +++ b/gtk/src/videohandler.c @@ -76,16 +76,15 @@ vcodec_changed_cb(GtkWidget *widget, signal_user_data_t *ud) } } +char *video_option_tooltip = NULL; + void ghb_video_setting_changed(GtkWidget *widget, signal_user_data_t *ud) { - static char *tt = NULL; - - - if (tt == NULL) + if (video_option_tooltip == NULL) { GtkWidget *eo = GTK_WIDGET(GHB_WIDGET(ud->builder, "VideoOptionExtra")); - tt = gtk_widget_get_tooltip_text(eo); + video_option_tooltip = gtk_widget_get_tooltip_text(eo); } ghb_widget_to_setting(ud->settings, widget); @@ -177,14 +176,16 @@ ghb_video_setting_changed(GtkWidget *widget, signal_user_data_t *ud) GtkWidget *eo = GTK_WIDGET(GHB_WIDGET(ud->builder, "VideoOptionExtra")); - char * new_tt; + char * tt; if (new_opts) - new_tt = g_strdup_printf(_("%s\n\nExpanded Options:\n\"%s\""), tt, new_opts); + tt = g_strdup_printf(_("%s\n\nExpanded Options:\n\"%s\""), + video_option_tooltip, new_opts); else - new_tt = g_strdup_printf(_("%s\n\nExpanded Options:\n\"\""), tt); - gtk_widget_set_tooltip_text(eo, new_tt); + tt = g_strdup_printf(_("%s\n\nExpanded Options:\n\"\""), + video_option_tooltip); + gtk_widget_set_tooltip_text(eo, tt); - g_free(new_tt); + g_free(tt); g_free(new_opts); g_free(tunes); @@ -194,14 +195,15 @@ ghb_video_setting_changed(GtkWidget *widget, signal_user_data_t *ud) const char *opts = ghb_dict_get_string(ud->settings, "x264Option"); GtkWidget *eo = GTK_WIDGET(GHB_WIDGET(ud->builder, "VideoOptionExtra")); - char * new_tt; + char * tt; if (opts) - new_tt = g_strdup_printf(_("%s\n\nExpanded Options:\n\"%s\""), - tt, opts); + tt = g_strdup_printf(_("%s\n\nExpanded Options:\n\"%s\""), + video_option_tooltip, opts); else - new_tt = g_strdup_printf(_("%s\n\nExpanded Options:\n\"\""), tt); - gtk_widget_set_tooltip_text(eo, new_tt); - g_free(new_tt); + tt = g_strdup_printf(_("%s\n\nExpanded Options:\n\"\""), + video_option_tooltip); + gtk_widget_set_tooltip_text(eo, tt); + g_free(tt); } ghb_check_dependency(ud, widget, NULL); diff --git a/gtk/src/x264handler.c b/gtk/src/x264handler.c index fb041a709..66434cabc 100644 --- a/gtk/src/x264handler.c +++ b/gtk/src/x264handler.c @@ -121,17 +121,17 @@ x264_me_changed_cb(GtkWidget *widget, signal_user_data_t *ud) } } +extern char *video_option_tooltip; + G_MODULE_EXPORT void x264_entry_changed_cb(GtkWidget *widget, signal_user_data_t *ud) { g_debug("x264_entry_changed_cb ()"); - static char *tt = NULL; - - if (tt == NULL) + if (video_option_tooltip == NULL) { GtkWidget *eo = GTK_WIDGET(GHB_WIDGET(ud->builder, "VideoOptionExtra")); - tt = gtk_widget_get_tooltip_text(eo); + video_option_tooltip = gtk_widget_get_tooltip_text(eo); } if (!ignore_options_update) @@ -153,14 +153,20 @@ x264_entry_changed_cb(GtkWidget *widget, signal_user_data_t *ud) ghb_update_x264Option(ud, sopts); ghb_x264_parse_options(ud, sopts); - GtkWidget *eo = GTK_WIDGET(GHB_WIDGET(ud->builder, "VideoOptionExtra")); - char * new_tt; - if (sopts) - new_tt = g_strdup_printf(_("%s\n\nExpanded Options:\n\"%s\""), tt, sopts); - else - new_tt = g_strdup_printf(_("%s\n\nExpanded Options:\n\"\""), tt); - gtk_widget_set_tooltip_text(eo, new_tt); - g_free(new_tt); + if (ghb_dict_get_bool(ud->settings, "x264UseAdvancedOptions")) + { + GtkWidget *eo; + eo = GTK_WIDGET(GHB_WIDGET(ud->builder, "VideoOptionExtra")); + char * tt; + if (sopts) + tt = g_strdup_printf(_("%s\n\nExpanded Options:\n\"%s\""), + video_option_tooltip, sopts); + else + tt = g_strdup_printf(_("%s\n\nExpanded Options:\n\"\""), + video_option_tooltip); + gtk_widget_set_tooltip_text(eo, tt); + g_free(tt); + } g_free(sopts); } |