diff options
author | jstebbins <[email protected]> | 2008-08-21 00:43:46 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2008-08-21 00:43:46 +0000 |
commit | 212b4a9f3cdc1e4a0bdf6c99202c2e58537c7af7 (patch) | |
tree | 4d76f0354c106d249f05b8e155bbf109c5af593e /gtk/src/callbacks.c | |
parent | 85cc8a84080abeca75ea05337df0f0971c39cdb9 (diff) |
LinGui: add a hidden feature to allow tweaking some settings. currently
tweaks are available for detelecine, decomb, deinterlace, deblock, and denoise
to enable, you must manually edit preferences file and add "allow_tweaks=1"
to tweak a setting, right click on the widget, an entry dialog will appear.
minimal validity checking is done on the tweak's value.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1648 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/callbacks.c')
-rw-r--r-- | gtk/src/callbacks.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index df6a17b55..803737241 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -2471,6 +2471,11 @@ validate_settings(signal_user_data_t *ud) { return FALSE; } + // Validate filter settings + if (!ghb_validate_filters(ud)) + { + return FALSE; + } audio_list_refresh(ud); return TRUE; } @@ -3510,3 +3515,62 @@ ghb_hal_init() //gvm_hal_claim_branch ("/org/freedesktop/Hal/devices/local"); } +gboolean +tweak_setting_cb( + GtkWidget *widget, + GdkEventButton *event, + signal_user_data_t *ud) +{ + const gchar *name; + gchar *tweak_name; + gboolean ret = FALSE; + gboolean allow_tweaks; + + g_debug("press %d %d", event->type, event->button); + allow_tweaks = ghb_settings_get_bool (ud->settings, "allow_tweaks"); + if (allow_tweaks && event->type == GDK_BUTTON_PRESS && event->button == 3) + { // Its a right mouse click + GtkWidget *dialog; + GtkEntry *entry; + GtkResponseType response; + const gchar *tweak = NULL; + + name = gtk_widget_get_name(widget); + if (g_str_has_prefix(name, "tweak_")) + { + tweak_name = g_strdup(name); + } + else + { + tweak_name = g_strdup_printf("tweak_%s", name); + } + + tweak = ghb_settings_get_string (ud->settings, tweak_name); + dialog = GHB_WIDGET(ud->builder, "tweak_dialog"); + gtk_window_set_title(GTK_WINDOW(dialog), tweak_name); + entry = GTK_ENTRY(GHB_WIDGET(ud->builder, "tweak_setting")); + if (tweak) + gtk_entry_set_text(entry, tweak); + response = gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_hide(dialog); + if (response == GTK_RESPONSE_OK) + { + tweak = gtk_entry_get_text(entry); + if (ghb_validate_filter_string(tweak, -1)) + ghb_settings_set_string(ud->settings, tweak_name, tweak); + else + { + gchar *message; + message = g_strdup_printf( + "Invalid Settings:\n%s", + tweak); + ghb_message_dialog(GTK_MESSAGE_ERROR, message, "Cancel", NULL); + g_free(message); + } + } + g_free(tweak_name); + ret = TRUE; + } + return ret; +} + |