From: Andrea Zagli Date: Wed, 13 Jan 2016 15:36:01 +0000 (+0100) Subject: Implemented QueryEditorIWidget::get_value_visible. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=HEAD;p=libzakgtkdecodergdaexqe Implemented QueryEditorIWidget::get_value_visible. --- diff --git a/src/decoderqe.c b/src/decoderqe.c index 6388700..45f4fa3 100644 --- a/src/decoderqe.c +++ b/src/decoderqe.c @@ -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) { diff --git a/tests/query_editor.c b/tests/query_editor.c index 1d9d8d6..3ed33e4 100644 --- a/tests/query_editor.c +++ b/tests/query_editor.c @@ -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",