From: John Stebbins Date: Wed, 20 Dec 2017 17:53:43 +0000 (-0800) Subject: LinGui: remove "Reset All Titles" button X-Git-Tag: 1.1.0~176 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad5ec4705201d3905846a5c81955e48f990658a0;p=handbrake LinGui: remove "Reset All Titles" button Replace with a preference option that synchronizes all title settings by default. This makes the linux gui behaviour consistant with the other guis by default. Titles can have independent settings by unchecking the preference option. --- diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index b7597e545..a02751a06 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -2157,7 +2157,7 @@ ghb_update_summary_info(signal_user_data_t *ud) } void -set_title_settings(signal_user_data_t *ud, GhbValue *settings) +ghb_set_title_settings(signal_user_data_t *ud, GhbValue *settings) { int title_id, titleindex; const hb_title_t * title; @@ -2285,13 +2285,12 @@ set_title_settings(signal_user_data_t *ud, GhbValue *settings) g_free(dest); ghb_dict_set_int(settings, "preview_frame", 2); - ghb_update_summary_info(ud); } void ghb_set_current_title_settings(signal_user_data_t *ud) { - set_title_settings(ud, ud->settings); + ghb_set_title_settings(ud, ud->settings); ghb_update_summary_info(ud); } @@ -2323,7 +2322,7 @@ load_all_titles(signal_user_data_t *ud, int titleindex) title = hb_list_item(list, ii); ghb_dict_set_int(settings, "title", title ? title->index : -1); - set_title_settings(ud, settings); + ghb_set_title_settings(ud, settings); ghb_array_append(settings_array, settings); } if (titleindex < 0 || titleindex >= count) @@ -2350,6 +2349,17 @@ title_changed_cb(GtkWidget *widget, signal_user_data_t *ud) count = ghb_array_len(ud->settings_array); int idx = (titleindex >= 0 && titleindex < count) ? titleindex : 0; + if (ghb_dict_get_bool(ud->prefs, "SyncTitleSettings")) + { + GhbValue * preset = ghb_settings_to_preset(ud->settings); + GhbValue * settings = ghb_array_get(ud->settings_array, idx); + if (preset != NULL) + { + ghb_preset_to_settings(settings, preset); + ghb_set_title_settings(ud, settings); + } + ghb_value_free(&preset); + } ud->settings = ghb_array_get(ud->settings_array, idx); ghb_load_settings(ud); @@ -2370,19 +2380,7 @@ title_changed_cb(GtkWidget *widget, signal_user_data_t *ud) ghb_reset_preview_image(ud); } -} - -G_MODULE_EXPORT void -title_reset_clicked_cb(GtkWidget *widget, signal_user_data_t *ud) -{ - int title_id, titleindex; - const hb_title_t *title; - - title_id = ghb_dict_get_int(ud->settings, "title"); - title = ghb_lookup_title(title_id, &titleindex); - (void)title; // Silence "unused variable" warning - load_all_titles(ud, titleindex); - ghb_load_settings(ud); + ghb_update_summary_info(ud); } G_MODULE_EXPORT void diff --git a/gtk/src/callbacks.h b/gtk/src/callbacks.h index 7e0b1b886..e12c52318 100644 --- a/gtk/src/callbacks.h +++ b/gtk/src/callbacks.h @@ -90,6 +90,7 @@ void ghb_scale_configure(signal_user_data_t *ud, char *name, double val, double min, double max, double step, double page, int digits, gboolean inverted); void ghb_update_summary_info(signal_user_data_t *ud); +void ghb_set_title_settings(signal_user_data_t *ud, GhbValue *settings); #endif // _CALLBACKS_H_ diff --git a/gtk/src/ghb.m4 b/gtk/src/ghb.m4 index 8dd772da9..f2b46bcf2 100644 --- a/gtk/src/ghb.m4 +++ b/gtk/src/ghb.m4 @@ -1371,22 +1371,6 @@ This is often the feature title of a DVD. 2 - - - Reset All Titles - True - True - Apply current settings to all titles - True - end - - - - True - True - 3 - - 0 @@ -8076,6 +8060,27 @@ Check this if you want the queue to clean itself up by deleting completed jobs.< 1 + + + Use the same settings for all titles in a batch + True + True + False + When checked, every title will use the same settings when adding a +batch of titles to the queue. + +Uncheck this if you want to allow changing each title's settings independently. + start + True + + + + 8 + 0 + 1 + 1 + + False diff --git a/gtk/src/internal_defaults.json b/gtk/src/internal_defaults.json index 77a5df2c3..3f3f95991 100644 --- a/gtk/src/internal_defaults.json +++ b/gtk/src/internal_defaults.json @@ -73,6 +73,7 @@ "DiskFreeCheck": true, "DiskFreeLimit": 10000, "RemoveFinishedJobs": false, + "SyncTitleSettings": true, "HideAdvancedVideoSettings": true, "AutoScan": false, "AddCC": false, diff --git a/gtk/src/presets.c b/gtk/src/presets.c index 89e6cb8f2..9a650e3de 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -1612,6 +1612,7 @@ ghb_settings_to_preset(GhbValue *settings) gboolean autoscale, br, constant; + ghb_dict_remove(preset, "title"); ghb_dict_set_bool(preset, "Default", 0); ghb_dict_set_int(preset, "Type", HB_PRESET_TYPE_CUSTOM); if (!ghb_dict_get_bool(preset, "PictureWidthEnable")) diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index 09c6e74e4..5778ee486 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -1837,9 +1837,15 @@ queue_add_all_action_cb(GSimpleAction *action, GVariant *param, GtkWidget *row; gint count, ii; int max_title_len = 0; + GhbValue * preset = NULL; list = GTK_LIST_BOX(GHB_WIDGET(ud->builder, "title_add_multiple_list")); + if (ghb_dict_get_bool(ud->prefs, "SyncTitleSettings")) + { + preset = ghb_settings_to_preset(ud->settings); + } + // Set up the list of titles count = ghb_array_len(ud->settings_array); for (ii = 0; ii < count; ii++) @@ -1859,6 +1865,11 @@ queue_add_all_action_cb(GSimpleAction *action, GVariant *param, chooser = GTK_FILE_CHOOSER(find_widget(row, "title_dir")); settings = ghb_array_get(ud->settings_array, ii); + if (preset != NULL) + { + ghb_preset_to_settings(settings, preset); + ghb_set_title_settings(ud, settings); + } title_id = ghb_dict_get_int(settings, "title"); title = ghb_lookup_title(title_id, &titleindex); if (title != NULL)