diff options
author | jstebbins <[email protected]> | 2009-12-14 19:49:26 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-12-14 19:49:26 +0000 |
commit | b4487bf6de437d77ebdd2cc137f54631b22fc9c8 (patch) | |
tree | a71ce5bf0680421f9d2c824cc6a52178f3c89c71 /gtk/src | |
parent | 4d312d2288983fd54866c447e667cbcedd0b9cbe (diff) |
LinGui: fix m4v file extension selection when the source has only 1 chapter
the chapter markers settings wasn't actually disabled, even though
it was being filtered out of the job settings. This caused the m4v file
extension selection logic to use m4v. And there was no way to change it
since the chapter markers widget was hidden.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3029 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r-- | gtk/src/callbacks.c | 41 | ||||
-rw-r--r-- | gtk/src/presets.c | 81 | ||||
-rw-r--r-- | gtk/src/presets.h | 1 |
3 files changed, 110 insertions, 13 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index fb319b297..087185dcf 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -1490,6 +1490,18 @@ title_changed_cb(GtkWidget *widget, signal_user_data_t *ud) set_destination(ud); } ghb_preview_set_visible(ud); + + gint end; + widget = GHB_WIDGET (ud->builder, "ChapterMarkers"); + gtk_widget_set_sensitive(widget, TRUE); + end = ghb_settings_get_int(ud->settings, "end_chapter"); + if (1 == end) + { + ud->dont_clear_presets = TRUE; + ghb_ui_update(ud, "ChapterMarkers", ghb_boolean_value(FALSE)); + ud->dont_clear_presets = FALSE; + gtk_widget_set_sensitive(widget, FALSE); + } } G_MODULE_EXPORT void @@ -1600,16 +1612,16 @@ start_chapter_changed_cb(GtkWidget *widget, signal_user_data_t *ud) { set_destination(ud); } - widget = GHB_WIDGET (ud->builder, "chapters_tab"); + widget = GHB_WIDGET (ud->builder, "ChapterMarkers"); + gtk_widget_set_sensitive(widget, TRUE); // End may have been changed above, get it again end = ghb_settings_get_int(ud->settings, "end_chapter"); if (start == end) { - gtk_widget_hide(widget); - } - else - { - gtk_widget_show(widget); + ud->dont_clear_presets = TRUE; + ghb_ui_update(ud, "ChapterMarkers", ghb_boolean_value(FALSE)); + ud->dont_clear_presets = FALSE; + gtk_widget_set_sensitive(widget, FALSE); } update_title_duration(ud); } @@ -1631,16 +1643,16 @@ end_chapter_changed_cb(GtkWidget *widget, signal_user_data_t *ud) { set_destination(ud); } - widget = GHB_WIDGET (ud->builder, "chapters_tab"); + widget = GHB_WIDGET (ud->builder, "ChapterMarkers"); + gtk_widget_set_sensitive(widget, TRUE); // Start may have been changed above, get it again start = ghb_settings_get_int(ud->settings, "start_chapter"); if (start == end) { - gtk_widget_hide(widget); - } - else - { - gtk_widget_show(widget); + ud->dont_clear_presets = TRUE; + ghb_ui_update(ud, "ChapterMarkers", ghb_boolean_value(FALSE)); + ud->dont_clear_presets = FALSE; + gtk_widget_set_sensitive(widget, FALSE); } update_title_duration(ud); } @@ -2467,6 +2479,11 @@ ghb_backend_events(signal_user_data_t *ud) gtk_progress_bar_set_fraction (scan_prog, 1.0); gtk_widget_hide(GTK_WIDGET(scan_prog)); + if (!ghb_settings_get_boolean(ud->settings, "preset_modified")) + { + ghb_refresh_preset(ud); + } + ghb_title_info_t tinfo; ghb_update_ui_combo_box(ud, "title", 0, FALSE); diff --git a/gtk/src/presets.c b/gtk/src/presets.c index 687daba8f..fca8c9304 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -3936,6 +3936,74 @@ preset_update_title_deps(signal_user_data_t *ud, ghb_title_info_t *tinfo) } } +void +ghb_refresh_preset(signal_user_data_t *ud) +{ + ghb_title_info_t tinfo; + GValue *preset; + gint *indices, len; + + g_debug("ghb_refresh_preset ()"); + preset = ghb_settings_get_value(ud->settings, "preset_selection"); + indices = ghb_preset_indices_from_path(presetsPlist, preset, &len); + if (indices) + { + gboolean folder; + + folder = ghb_presets_get_folder(presetsPlist, indices, len); + if (!folder) + { + ud->dont_clear_presets = TRUE; + // Temporarily set the video_quality range to (0,100) + // This is needed so the video_quality value does not get + // truncated when set. The range will be readjusted below + GtkWidget *qp = GHB_WIDGET(ud->builder, "VideoQualitySlider"); + gtk_range_set_range (GTK_RANGE(qp), 0, 100); + gtk_scale_set_digits(GTK_SCALE(qp), 3); + // Clear the audio list prior to changing the preset. Existing + // audio can cause the container extension to be automatically + // changed when it shouldn't be + ghb_clear_audio_list(ud); + ghb_set_preset_from_indices(ud, indices, len); + gint titleindex; + titleindex = ghb_settings_combo_int(ud->settings, "title"); + ghb_set_pref_audio(titleindex, ud); + ghb_set_pref_subtitle(titleindex, ud); + ghb_settings_set_boolean(ud->settings, "preset_modified", FALSE); + if (ghb_get_title_info (&tinfo, titleindex)) + { + preset_update_title_deps(ud, &tinfo); + } + ghb_set_scale (ud, GHB_PIC_KEEP_PAR); + ud->dont_clear_presets = FALSE; + + gdouble vqmin, vqmax, step, page; + gint digits; + gboolean inverted; + + ghb_vquality_range(ud, &vqmin, &vqmax, &step, + &page, &digits, &inverted); + gtk_range_set_range (GTK_RANGE(qp), vqmin, vqmax); + gtk_range_set_increments (GTK_RANGE(qp), step, page); + gtk_scale_set_digits(GTK_SCALE(qp), digits); + gtk_range_set_inverted (GTK_RANGE(qp), inverted); + + gchar *text; + gint crop[4]; + GtkWidget *crop_widget; + crop[0] = ghb_settings_get_int(ud->settings, "PictureTopCrop"); + crop[1] = ghb_settings_get_int(ud->settings, "PictureBottomCrop"); + crop[2] = ghb_settings_get_int(ud->settings, "PictureLeftCrop"); + crop[3] = ghb_settings_get_int(ud->settings, "PictureRightCrop"); + crop_widget = GHB_WIDGET (ud->builder, "crop_values"); + text = g_strdup_printf("%d:%d:%d:%d", + crop[0], crop[1], crop[2], crop[3]); + gtk_label_set_text (GTK_LABEL(crop_widget), text); + g_free(text); + } + } +} + G_MODULE_EXPORT void presets_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_t *ud) { @@ -3975,7 +4043,6 @@ presets_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_ // changed when it shouldn't be ghb_clear_audio_list(ud); ghb_set_preset_from_indices(ud, indices, len); - gtk_tree_path_free(treepath); gint titleindex; titleindex = ghb_settings_combo_int(ud->settings, "title"); ghb_set_pref_audio(titleindex, ud); @@ -4012,6 +4079,7 @@ presets_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_ gtk_label_set_text (GTK_LABEL(crop_widget), text); g_free(text); } + gtk_tree_path_free(treepath); gtk_widget_set_sensitive(widget, TRUE); } else @@ -4019,6 +4087,17 @@ presets_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_ g_debug("No selection??? Perhaps unselected."); gtk_widget_set_sensitive(widget, FALSE); } + gint start = ghb_settings_get_int(ud->settings, "start_chapter"); + gint end = ghb_settings_get_int(ud->settings, "end_chapter"); + widget = GHB_WIDGET (ud->builder, "ChapterMarkers"); + gtk_widget_set_sensitive(widget, TRUE); + if (start == end) + { + ud->dont_clear_presets = TRUE; + ghb_ui_update(ud, "ChapterMarkers", ghb_boolean_value(FALSE)); + ud->dont_clear_presets = FALSE; + gtk_widget_set_sensitive(widget, FALSE); + } } void diff --git a/gtk/src/presets.h b/gtk/src/presets.h index 65b4e8cd0..a4da4ed74 100644 --- a/gtk/src/presets.h +++ b/gtk/src/presets.h @@ -41,5 +41,6 @@ gboolean ghb_preset_is_custom(void); void ghb_prefs_store(void); void ghb_pref_set(GValue *settings, const gchar *key); gboolean ghb_lock_file(const gchar *name); +void ghb_refresh_preset(signal_user_data_t *ud); #endif // _GHB_PRESETS_H_ |