]> saetta.ns0.it Git - libgtkform/commitdiff
Adjustments on GtkFormDecoder autocompletion.
authorAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Thu, 20 Oct 2011 11:04:47 +0000 (13:04 +0200)
committerAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Thu, 20 Oct 2011 11:04:47 +0000 (13:04 +0200)
Added eclipse project files.
refs #41

.cproject [new file with mode: 0644]
.project [new file with mode: 0644]
libgtkformui/gtkformdecoder.c

diff --git a/.cproject b/.cproject
new file mode 100644 (file)
index 0000000..609c776
--- /dev/null
+++ b/.cproject
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+       <storageModule moduleId="org.eclipse.cdt.core.settings">
+               <cconfiguration id="cdt.managedbuild.toolchain.gnu.mingw.base.1787576894">
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.mingw.base.1787576894" moduleId="org.eclipse.cdt.core.settings" name="Default">
+                               <externalSettings/>
+                               <extensions>
+                                       <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                               </extensions>
+                       </storageModule>
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+                               <configuration artifactName="libgtkform" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.mingw.base.1787576894" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
+                                       <folderInfo id="cdt.managedbuild.toolchain.gnu.mingw.base.1787576894.1102004166" name="/" resourcePath="">
+                                               <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.base.133199640" name="cdt.managedbuild.toolchain.gnu.mingw.base" superClass="cdt.managedbuild.toolchain.gnu.mingw.base">
+                                                       <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.PE" id="cdt.managedbuild.target.gnu.platform.mingw.base.136826476" name="Debug Platform" osList="win32" superClass="cdt.managedbuild.target.gnu.platform.mingw.base"/>
+                                                       <builder buildPath="${workspace_loc:/libgtkform/Default}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.758991837" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.base.461920277" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.base">
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1114600826" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+                                                       </tool>
+                                                       <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1003588714" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.895849839" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base">
+                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.750743053" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+                                                       </tool>
+                                                       <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.base.574440126" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.base">
+                                                               <option id="gnu.c.compiler.option.include.paths.1394559870" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+                                                                       <listOptionValue builtIn="false" value="&quot;C:\mingw\include\glib-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;C:\mingw\include\libgda-4.0\libgda&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;C:\mingw\include\gtk-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;C:\mingw\include\libxml2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;C:\mingw\include\libgda-4.0&quot;"/>
+                                                               </option>
+                                                               <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.639758280" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+                                                       </tool>
+                                                       <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.base.1760160466" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.base"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base.855393552" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base">
+                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1670186231" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+                                                               </inputType>
+                                                       </tool>
+                                               </toolChain>
+                                       </folderInfo>
+                               </configuration>
+                       </storageModule>
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+               </cconfiguration>
+       </storageModule>
+       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+               <project id="libgtkform.null.964343723" name="libgtkform"/>
+       </storageModule>
+       <storageModule moduleId="scannerConfiguration">
+               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+       </storageModule>
+</cproject>
diff --git a/.project b/.project
new file mode 100644 (file)
index 0000000..4c2a3ee
--- /dev/null
+++ b/.project
@@ -0,0 +1,307 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>libgtkform</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+                       <triggers>clean,full,incremental,</triggers>
+                       <arguments>
+                               <dictionary>
+                                       <key>?name?</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.append_environment</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildArguments</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildCommand</key>
+                                       <value>make</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildLocation</key>
+                                       <value>${workspace_loc:/libgtkform/Default}</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.contents</key>
+                                       <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+                                       <value>false</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.stopOnError</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+                                       <value>true</value>
+                               </dictionary>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+                       <triggers>full,incremental,</triggers>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.cdt.core.cnature</nature>
+               <nature>org.eclipse.cdt.core.ccnature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+       </natures>
+       <filteredResources>
+               <filter>
+                       <id>1319094436599</id>
+                       <name></name>
+                       <type>30</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-autom4te.cache</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436604</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-*.pc</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436610</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-Makefile</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436613</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-missing</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436619</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-depcomp</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436622</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-config.h.in</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436625</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-install-sh</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436627</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-stamp-h1</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436630</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-Makefile.in</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436636</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-libtool</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436639</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-config.log</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436641</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-config.guess</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436644</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-gtk-doc.make</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436647</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-aclocal.m4</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436650</id>
+                       <name></name>
+                       <type>30</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-m4</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436653</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-configure</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436656</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-config.status</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436659</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-config.sub</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436664</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-*.o</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436671</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-*.lo</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436674</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-*.la</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436677</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-*.exe</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436680</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-intltool*</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436683</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-ltmain.sh</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436687</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-mkinstalldirs</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1319094436690</id>
+                       <name></name>
+                       <type>22</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-config.h</arguments>
+                       </matcher>
+               </filter>
+       </filteredResources>
+</projectDescription>
index 4baf4b9c3341b1ec17a40b0edb8b6dc7dfcf4476..2c99663a328a98fe1ad8c50a64871f0b7fbba620 100644 (file)
@@ -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);
 }