diff options
author | John Stebbins <[email protected]> | 2017-12-20 09:53:43 -0800 |
---|---|---|
committer | John Stebbins <[email protected]> | 2017-12-20 09:53:43 -0800 |
commit | ad5ec4705201d3905846a5c81955e48f990658a0 (patch) | |
tree | 50146316a6c6ead11f0cdd7be419d6d9a2a99d0c /gtk/src | |
parent | 16077a9128d5c03be1fec5330c4b859af1d0bd23 (diff) |
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.
Diffstat (limited to 'gtk/src')
-rw-r--r-- | gtk/src/callbacks.c | 32 | ||||
-rw-r--r-- | gtk/src/callbacks.h | 1 | ||||
-rw-r--r-- | gtk/src/ghb.m4 | 37 | ||||
-rw-r--r-- | gtk/src/internal_defaults.json | 1 | ||||
-rw-r--r-- | gtk/src/presets.c | 1 | ||||
-rw-r--r-- | gtk/src/queuehandler.c | 11 |
6 files changed, 50 insertions, 33 deletions
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.</property> <property name="position">2</property> </packing> </child> - <child> - <object class="GtkButton" id="title_reset"> - <property name="label" translatable="yes">Reset All Titles</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">Apply current settings to all titles</property> - <property name="receives_default">True</property> - <property name="halign">end</property> - <signal name="clicked" handler="title_reset_clicked_cb" swapped="no"/> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">3</property> - </packing> - </child> </object> <packing> <property name="top_attach">0</property> @@ -8076,6 +8060,27 @@ Check this if you want the queue to clean itself up by deleting completed jobs.< <property name="height">1</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="SyncTitleSettings"> + <property name="label" translatable="yes">Use the same settings for all titles in a batch</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="tooltip_text" translatable="yes">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.</property> + <property name="halign">start</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="pref_changed_cb" swapped="no"/> + </object> + <packing> + <property name="top_attach">8</property> + <property name="left_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> 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) |