From 9b546b7aaefa70e76dbe81aef8faa8ecb73d8ba9 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Thu, 20 Oct 2011 13:04:47 +0200 Subject: [PATCH] Adjustments on GtkFormDecoder autocompletion. Added eclipse project files. refs #41 --- .cproject | 59 +++++++ .project | 307 ++++++++++++++++++++++++++++++++++ libgtkformui/gtkformdecoder.c | 26 ++- 3 files changed, 383 insertions(+), 9 deletions(-) create mode 100644 .cproject create mode 100644 .project diff --git a/.cproject b/.cproject new file mode 100644 index 0000000..609c776 --- /dev/null +++ b/.cproject @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..4c2a3ee --- /dev/null +++ b/.project @@ -0,0 +1,307 @@ + + + libgtkform + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.buildLocation + ${workspace_loc:/libgtkform/Default} + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + 1319094436599 + + 30 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-autom4te.cache + + + + 1319094436604 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-*.pc + + + + 1319094436610 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-Makefile + + + + 1319094436613 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-missing + + + + 1319094436619 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-depcomp + + + + 1319094436622 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-config.h.in + + + + 1319094436625 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-install-sh + + + + 1319094436627 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-stamp-h1 + + + + 1319094436630 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-Makefile.in + + + + 1319094436636 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-libtool + + + + 1319094436639 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-config.log + + + + 1319094436641 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-config.guess + + + + 1319094436644 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-gtk-doc.make + + + + 1319094436647 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-aclocal.m4 + + + + 1319094436650 + + 30 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-m4 + + + + 1319094436653 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-configure + + + + 1319094436656 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-config.status + + + + 1319094436659 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-config.sub + + + + 1319094436664 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-*.o + + + + 1319094436671 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-*.lo + + + + 1319094436674 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-*.la + + + + 1319094436677 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-*.exe + + + + 1319094436680 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-intltool* + + + + 1319094436683 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-ltmain.sh + + + + 1319094436687 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-mkinstalldirs + + + + 1319094436690 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-config.h + + + + diff --git a/libgtkformui/gtkformdecoder.c b/libgtkformui/gtkformdecoder.c index 4baf4b9..2c99663 100644 --- a/libgtkformui/gtkformdecoder.c +++ b/libgtkformui/gtkformdecoder.c @@ -240,7 +240,8 @@ gtk_form_decoder_init (GtkFormDecoder *decoder) priv->lbl_key = gtk_label_new (""); gtk_box_pack_start (GTK_BOX (priv->hbox), priv->lbl_key, FALSE, FALSE, 0); - gtk_widget_set_no_show_all (priv->lbl_key, TRUE); + //gtk_widget_set_no_show_all (priv->lbl_key, TRUE); + gtk_widget_show (priv->lbl_key); } /** @@ -484,7 +485,7 @@ gtk_form_decoder_set_completion (GtkFormDecoder *decoder, GtkFormDecoderPrivate *priv = GTK_FORM_DECODER_GET_PRIVATE (decoder); - if (decoder == NULL) + if (sql == NULL && !GDA_IS_DATA_MODEL (data_model)) { priv->completion_dm = NULL; priv->completion_text_column = 0; @@ -495,30 +496,36 @@ gtk_form_decoder_set_completion (GtkFormDecoder *decoder, return; } - g_return_if_fail (sql != NULL || GDA_IS_DATA_MODEL (data_model)); - - if (!GDA_IS_DATA_MODEL (data_model)) + _sql = NULL; + if (sql != NULL) { _sql = g_strstrip (g_strdup (sql)); - g_return_if_fail (g_strcmp0 (_sql, "") != 0); + } + if (_sql != NULL && g_strcmp0 (_sql, "") != 0 && !GDA_IS_DATA_MODEL (data_model)) + { if (!IS_GDAEX (priv->gdaex)) { g_warning (_("No GdaEx object inside GtkFormDecoder.")); return; } - priv->completion_dm = gdaex_query (priv->gdaex, sql); + priv->completion_dm = gdaex_query (priv->gdaex, _sql); if (priv->completion_dm == NULL) { g_warning (_("Unable to create the GdaDataModel for completion.")); return; } } - else + else if (GDA_IS_DATA_MODEL (data_model)) { priv->completion_dm = data_model; } + else + { + g_warning (_("Must be set sql or data_model.")); + return; + } priv->completion_text_column = text_column; priv->completion_key_column = key_column; @@ -526,6 +533,7 @@ gtk_form_decoder_set_completion (GtkFormDecoder *decoder, model = GTK_TREE_MODEL (gdaex_data_model_to_gtkliststore (priv->completion_dm, FALSE)); if (model == NULL) { + g_warning (_("Unable to create the GtkTreeModel from the GdaDataModel.")); return; } @@ -539,7 +547,7 @@ gtk_form_decoder_set_completion (GtkFormDecoder *decoder, gtk_entry_completion_set_model (completion, model); gtk_entry_completion_set_minimum_key_length (completion, 3); - gtk_entry_completion_set_text_column (completion, text_column); + gtk_entry_completion_set_text_column (completion, priv->completion_text_column); gtk_editable_set_editable (GTK_EDITABLE (priv->txt_decoded), TRUE); } -- 2.49.0