summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtk/src/audiohandler.c14
-rw-r--r--gtk/src/audiohandler.h1
-rw-r--r--gtk/src/callbacks.c2
-rw-r--r--gtk/src/subtitlehandler.c13
-rw-r--r--gtk/src/subtitlehandler.h1
5 files changed, 31 insertions, 0 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c
index 0d00a65a6..47009b70f 100644
--- a/gtk/src/audiohandler.c
+++ b/gtk/src/audiohandler.c
@@ -1315,6 +1315,20 @@ ghb_clear_audio_list_settings(GhbValue *settings)
}
void
+ghb_clear_audio_selection(GtkBuilder *builder)
+{
+ GtkTreeView *tv;
+ GtkTreeSelection *tsel;
+
+ g_debug("clear_audio_list_ui ()");
+ tv = GTK_TREE_VIEW(GHB_WIDGET(builder, "audio_list_view"));
+ // Clear tree selection so that updates are not triggered
+ // that cause a recursive attempt to clear the tree selection (crasher)
+ tsel = gtk_tree_view_get_selection(tv);
+ gtk_tree_selection_unselect_all(tsel);
+}
+
+void
ghb_clear_audio_list_ui(GtkBuilder *builder)
{
GtkTreeView *tv;
diff --git a/gtk/src/audiohandler.h b/gtk/src/audiohandler.h
index 46bcce3c3..a0098004d 100644
--- a/gtk/src/audiohandler.h
+++ b/gtk/src/audiohandler.h
@@ -41,5 +41,6 @@ void ghb_init_audio_defaults_ui(signal_user_data_t *ud);
void ghb_audio_defaults_to_ui(signal_user_data_t *ud);
GtkListBoxRow* ghb_find_lang_row(GtkListBox *list_box, int lang_idx);
void ghb_audio_title_change(signal_user_data_t *ud, gboolean title_valid);
+void ghb_clear_audio_selection(GtkBuilder *builder);
#endif // _AUDIOHANDLER_H_
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index e4a0857a6..8cbc6011d 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -1183,6 +1183,8 @@ ghb_load_settings(signal_user_data_t * ud)
ghb_show_container_options(ud);
check_chapter_markers(ud);
+ ghb_clear_audio_selection(ud->builder);
+ ghb_clear_subtitle_selection(ud->builder);
ghb_settings_to_ui(ud, ud->settings);
ghb_audio_defaults_to_ui(ud);
ghb_subtitle_defaults_to_ui(ud);
diff --git a/gtk/src/subtitlehandler.c b/gtk/src/subtitlehandler.c
index b42b482b3..33e9e106a 100644
--- a/gtk/src/subtitlehandler.c
+++ b/gtk/src/subtitlehandler.c
@@ -1049,6 +1049,19 @@ ghb_clear_subtitle_list_settings(GhbValue *settings)
ghb_array_reset(subtitle_list);
}
+void
+ghb_clear_subtitle_selection(GtkBuilder *builder)
+{
+ GtkTreeView *tv;
+ GtkTreeSelection *tsel;
+
+ tv = GTK_TREE_VIEW(GHB_WIDGET(builder, "subtitle_list_view"));
+ // Clear tree selection so that updates are not triggered
+ // that cause a recursive attempt to clear the tree selection (crasher)
+ tsel = gtk_tree_view_get_selection(tv);
+ gtk_tree_selection_unselect_all(tsel);
+}
+
static void
ghb_clear_subtitle_list_ui(GtkBuilder *builder)
{
diff --git a/gtk/src/subtitlehandler.h b/gtk/src/subtitlehandler.h
index d266376e1..df3d22694 100644
--- a/gtk/src/subtitlehandler.h
+++ b/gtk/src/subtitlehandler.h
@@ -38,5 +38,6 @@ void ghb_init_subtitle_defaults_ui(signal_user_data_t *ud);
void ghb_subtitle_defaults_to_ui(signal_user_data_t *ud);
void ghb_subtitle_title_change(signal_user_data_t *ud, gboolean show);
void ghb_subtitle_set_pref_lang(GhbValue *settings);
+void ghb_clear_subtitle_selection(GtkBuilder *builder);
#endif // _SUBTITLEHANDLER_H_