]> saetta.ns0.it Git - solipa/territorio/commitdiff
Non venivano conservati i parametri di ricerca degli stati.
authorAndrea Zagli <azagli@libero.it>
Tue, 29 Dec 2015 19:55:39 +0000 (20:55 +0100)
committerAndrea Zagli <azagli@libero.it>
Tue, 29 Dec 2015 19:55:39 +0000 (20:55 +0100)
src/statiqe.c

index 9f97d308454e882526886f98d9338486c051551c..f90db8450227c8794046e8995736ba6942f440ec 100644 (file)
@@ -137,10 +137,17 @@ TerritorioStatiQe
        g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button66"),
                                          "clicked", G_CALLBACK (territorio_stati_qe_on_btn_seleziona_clicked), (gpointer)a);
 
-       priv->qe = gdaex_query_editor_new (priv->commons->gdaex);
-       gdaex_query_editor_load_tables_from_file (priv->qe, g_build_filename (priv->commons->queryeditordir, "stati.xml", NULL), TRUE);
-       gdaex_query_editor_set_show_visible (priv->qe, FALSE);
-       gdaex_query_editor_set_order_visible (priv->qe, FALSE);
+       if (!GDAEX_IS_QUERY_EDITOR (qe))
+               {
+                       priv->qe = g_object_ref (gdaex_query_editor_new (priv->commons->gdaex));
+                       gdaex_query_editor_load_tables_from_file (priv->qe, g_build_filename (priv->commons->queryeditordir, "stati.xml", NULL), TRUE);
+                       gdaex_query_editor_set_show_visible (priv->qe, FALSE);
+                       gdaex_query_editor_set_order_visible (priv->qe, FALSE);
+               }
+       else
+               {
+                       priv->qe = qe;
+               }
 
        priv->wqe = gdaex_query_editor_get_widget (priv->qe);
        gtk_box_pack_start (GTK_BOX (gtk_builder_get_object (priv->commons->gtkbuilder, "vbox19")),
@@ -150,13 +157,6 @@ TerritorioStatiQe
                                                   priv->wqe,
                                                   0);
 
-       if (GDAEX_IS_QUERY_EDITOR (qe))
-               {
-                       gdaex_query_editor_load_choices_from_xml (priv->qe,
-                                                                                                         gdaex_query_editor_get_sql_as_xml (qe),
-                                                                                                         TRUE);
-               }
-
        return a;
 }
 
@@ -204,6 +204,8 @@ territorio_stati_qe_selezionato (TerritorioStatiQe *territorio_stati_qe)
 
        g_signal_emit (G_OBJECT (territorio_stati_qe), klass->selezionato_signal_id, 0, (gpointer)priv->qe);
 
+       gtk_container_remove (GTK_CONTAINER (gtk_builder_get_object (priv->commons->gtkbuilder, "vbox19")),
+                                                 priv->wqe);
        gtk_widget_destroy (priv->widget);
        g_object_unref (G_OBJECT (territorio_stati_qe));
 }
@@ -262,6 +264,8 @@ territorio_stati_qe_on_btn_annulla_clicked (GtkButton *button,
 {
        TerritorioStatiQePrivate *priv = TERRITORIO_STATI_QE_GET_PRIVATE ((TerritorioStatiQe *)user_data);
 
+       gtk_container_remove (GTK_CONTAINER (gtk_builder_get_object (priv->commons->gtkbuilder, "vbox19")),
+                                                 priv->wqe);
        gtk_widget_destroy (priv->widget);
        g_object_unref (G_OBJECT (user_data));
 }