]> saetta.ns0.it Git - libzakgtkdecodergdaexqe/commitdiff
Implemented QueryEditorIWidget::get_value_visible. master
authorAndrea Zagli <azagli@libero.it>
Wed, 13 Jan 2016 15:36:01 +0000 (16:36 +0100)
committerAndrea Zagli <azagli@libero.it>
Wed, 13 Jan 2016 17:53:29 +0000 (18:53 +0100)
src/decoderqe.c
tests/query_editor.c

index 63887003dae4ba7afacc8e15dc42917536436060..45f4fa3f4e735b84e0ad32e348952da86b84f8c7 100644 (file)
@@ -42,6 +42,7 @@ static void zak_gtk_decoder_gdaex_qe_dispose (GObject *gobject);
 static void zak_gtk_decoder_gdaex_qe_finalize (GObject *gobject);
 
 static const gchar *zak_gtk_decoder_gdaex_qe_get_value (GdaExQueryEditorIWidget *iwidget);
+static const gchar *zak_gtk_decoder_gdaex_qe_get_value_visible (GdaExQueryEditorIWidget *iwidget);
 static const gchar *zak_gtk_decoder_gdaex_qe_get_value_sql (GdaExQueryEditorIWidget *iwidget);
 static void zak_gtk_decoder_gdaex_qe_set_value (GdaExQueryEditorIWidget *iwidget, const gchar *value);
 
@@ -81,6 +82,7 @@ static void
 zak_gtk_decoder_gdaex_qe_gdaex_query_editor_iwidget_interface_init (GdaExQueryEditorIWidgetIface *iface)
 {
        iface->get_value = zak_gtk_decoder_gdaex_qe_get_value;
+       iface->get_value_visible = zak_gtk_decoder_gdaex_qe_get_value_visible;
        iface->get_value_sql = zak_gtk_decoder_gdaex_qe_get_value_sql;
        iface->set_value = zak_gtk_decoder_gdaex_qe_set_value;
 }
@@ -165,6 +167,12 @@ static const gchar
        return zak_gtk_decoder_get_key (ZAK_GTK_DECODER (iwidget));
 }
 
+static const gchar
+*zak_gtk_decoder_gdaex_qe_get_value_visible (GdaExQueryEditorIWidget *iwidget)
+{
+       return zak_gtk_decoder_get_decoded (ZAK_GTK_DECODER (iwidget));
+}
+
 static const gchar
 *zak_gtk_decoder_gdaex_qe_get_value_sql (GdaExQueryEditorIWidget *iwidget)
 {
index 1d9d8d69d9c786628587f4475151ba171df99536..3ed33e44fc25f50226bcebc6fcf70ea0c14948a0 100644 (file)
@@ -47,14 +47,19 @@ city_on_browse_clicked (gpointer instance, gpointer user_data)
 static gchar
 *city_on_decode (gpointer instance, gchar *key, gpointer user_data)
 {
-       return g_strdup_printf ("Decode from «%s»", key);
+       if (strtol (key, NULL, 10) > 0)
+               {
+                       return g_strdup_printf ("Decode from «%s»", key);
+               }
+       else
+               {
+                       return g_strdup ("");
+               }
 }
 
 static void
-city_on_iwidget_init (gpointer instance, GdaExQueryEditorIWidget *iwidget, gchar *table_name, gchar *field_name, gpointer user_data)
+city_on_iwidget_init (gpointer instance, GdaExQueryEditorIWidget *iwidget, gchar *table_name, gchar *field_name, gboolean from, gpointer user_data)
 {
-       g_warning ("signal iwidget_init");
-
        g_signal_connect (G_OBJECT (iwidget), "btn-browse-clicked",
                                          G_CALLBACK (city_on_browse_clicked), NULL);
        g_signal_connect (G_OBJECT (iwidget), "decode",