From: Andrea Zagli Date: Sat, 16 Jan 2016 10:33:00 +0000 (+0100) Subject: QueryEditor: on notebook page changing, unselect all in other pages (closes #989). X-Git-Tag: v0.6.0~1^2~3 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=33eb9c518ded7823ead242ea562f892935845524;p=libgdaex QueryEditor: on notebook page changing, unselect all in other pages (closes #989). --- diff --git a/src/queryeditor.c b/src/queryeditor.c index 1f54086..6621140 100644 --- a/src/queryeditor.c +++ b/src/queryeditor.c @@ -135,6 +135,11 @@ static void gdaex_query_editor_on_trv_fields_row_activated (GtkTreeView *tree_vi GtkTreeViewColumn *column, gpointer user_data); +static void gdaex_query_editor_on_notebook_switch_page (GtkNotebook *notebook, + gpointer page, + guint page_num, + gpointer user_data); + static void gdaex_query_editor_show_add_iter (GdaExQueryEditor *qe, GtkTreeIter *iter); static void gdaex_query_editor_on_btn_show_add_clicked (GtkButton *button, @@ -481,6 +486,8 @@ GdaExQueryEditor } priv->notebook = GTK_WIDGET (gtk_builder_get_object (priv->gtkbuilder, "notebook1")); + g_signal_connect (G_OBJECT (priv->notebook), "switch-page", + G_CALLBACK (gdaex_query_editor_on_notebook_switch_page), (gpointer)gdaex_query_editor); priv->trv_fields = GTK_WIDGET (gtk_builder_get_object (priv->gtkbuilder, "treeview1")); priv->trv_where = GTK_WIDGET (gtk_builder_get_object (priv->gtkbuilder, "treeview3")); @@ -3855,6 +3862,30 @@ gdaex_query_editor_on_btn_save_clicked (GtkButton *button, gtk_widget_hide (priv->vbx_values_container); } +static void +gdaex_query_editor_on_notebook_switch_page (GtkNotebook *notebook, + gpointer page, + guint page_num, + gpointer user_data) +{ + GdaExQueryEditorPrivate *priv; + + priv = GDAEX_QUERY_EDITOR_GET_PRIVATE ((GdaExQueryEditor *)user_data); + + if (page_num != GDAEX_QE_PAGE_SHOW) + { + gtk_tree_selection_unselect_all (priv->sel_show); + } + if (page_num != GDAEX_QE_PAGE_WHERE) + { + gtk_tree_selection_unselect_all (priv->sel_where); + } + if (page_num != GDAEX_QE_PAGE_ORDER) + { + gtk_tree_selection_unselect_all (priv->sel_order); + } +} + static void gdaex_query_editor_show_add_iter (GdaExQueryEditor *qe, GtkTreeIter *iter) {