]> saetta.ns0.it Git - libgdaex/commitdiff
QueryEditor: managed boolean field (closes #987).
authorAndrea Zagli <andrea.zagli@email.it>
Wed, 13 Jan 2016 22:02:41 +0000 (23:02 +0100)
committerAndrea Zagli <andrea.zagli@email.it>
Wed, 13 Jan 2016 22:02:41 +0000 (23:02 +0100)
po/POTFILES.in
po/it.po
src/Makefile.am
src/queryeditor.c
src/queryeditor.h
src/queryeditorcheck.c [new file with mode: 0644]
src/queryeditorcheck.h [new file with mode: 0644]
src/queryeditorentry.h
tests/query_editor.xml

index 9262c02c116f697345d2856dad7ca51cc18ad6a6..2f24a602030bc2110cdb1c98d3e26e1c804cb8ca 100644 (file)
@@ -1,5 +1,7 @@
 # List of source files which contain translatable strings.
 src/gdaex.c
 src/queryeditor.c
-src/grid.c
+src/queryeditorcheck.c
+src/queryeditorentry.c
+src/queryeditorentrydate.c
 [type: gettext/glade]data/libgdaex/gui/libgdaex.ui
index 5f44966ba1ca37e7a49bd84135acca9f56e7e33d..d7f58dbab33841f4931aae16370205b0de64ce03 100644 (file)
--- a/po/it.po
+++ b/po/it.po
@@ -1,13 +1,13 @@
 # SOME DESCRIPTIVE TITLE.
 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
 # This file is distributed under the same license as the PACKAGE package.
-# Andrea Zagli <azagli@libero.it>, 2011.
+# Andrea Zagli <azagli@libero.it>, 2011-2016.
 #
 msgid ""
 msgstr ""
 "Project-Id-Version: libgdaex 0.4.0\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-11-19 12:05+0100\n"
+"POT-Creation-Date: 2016-01-13 22:38+0100\n"
 "PO-Revision-Date: 2011-10-24 17:44+0200\n"
 "Last-Translator: Andrea Zagli <azagli@libero.it>\n"
 "Language-Team: Italian <tp@lists.linux.it>\n"
@@ -32,15 +32,15 @@ msgstr "Impossibile creare l'oggetto GdaEx."
 msgid "Error creating database connection: %s"
 msgstr "Errore nella creazione della connessione al database: %s"
 
-#: ../src/gdaex.c:286 ../src/gdaex.c:689 ../src/gdaex.c:706
-#: ../src/gdaex.c:1041 ../src/gdaex.c:1081 ../src/gdaex.c:1120
-#: ../src/gdaex.c:1159 ../src/gdaex.c:1211 ../src/gdaex.c:1306
-#: ../src/gdaex.c:1366 ../src/gdaex.c:1432 ../src/gdaex.c:1482
-#: ../src/gdaex.c:2314 ../src/gdaex.c:2470 ../src/gdaex.c:2527
-#: ../src/gdaex.c:2545 ../src/gdaex.c:2598 ../src/gdaex.c:2657
-#: ../src/gdaex.c:2707 ../src/gdaex.c:3199 ../src/gdaex.c:3213
-#: ../src/gdaex.c:3287 ../src/gdaex.c:3305 ../src/queryeditor.c:375
-#: ../src/queryeditor.c:2010 ../src/queryeditor.c:2022
+#: ../src/gdaex.c:286 ../src/gdaex.c:705 ../src/gdaex.c:722 ../src/gdaex.c:1080
+#: ../src/gdaex.c:1144 ../src/gdaex.c:1186 ../src/gdaex.c:1228
+#: ../src/gdaex.c:1280 ../src/gdaex.c:1375 ../src/gdaex.c:1435
+#: ../src/gdaex.c:1501 ../src/gdaex.c:1551 ../src/gdaex.c:2433
+#: ../src/gdaex.c:2589 ../src/gdaex.c:2646 ../src/gdaex.c:2664
+#: ../src/gdaex.c:2717 ../src/gdaex.c:2776 ../src/gdaex.c:2826
+#: ../src/gdaex.c:3320 ../src/gdaex.c:3334 ../src/gdaex.c:3408
+#: ../src/gdaex.c:3426 ../src/queryeditor.c:422 ../src/queryeditor.c:479
+#: ../src/queryeditor.c:2207 ../src/queryeditor.c:2219
 msgid "no details"
 msgstr "nessun dettaglio"
 
@@ -63,16 +63,16 @@ msgstr "Errore nella scrittura del file di registro: %s"
 msgid "Error on opening log file: %s"
 msgstr "Errore nell'apertura del file di registro: %s"
 
-#: ../src/gdaex.c:540
+#: ../src/gdaex.c:556
 msgid "Unable to get the GdaSqlStatement from the GdaStatement."
 msgstr "Impossibile ottenere il GdaSqlStatement dal GdaStatement."
 
-#: ../src/gdaex.c:654
+#: ../src/gdaex.c:670
 #, c-format
 msgid "Statement type %s not implemented."
 msgstr "Tipo di istruzione %s non implementato."
 
-#: ../src/gdaex.c:688
+#: ../src/gdaex.c:704
 #, c-format
 msgid ""
 "Error parsing query string: %s\n"
@@ -81,7 +81,7 @@ msgstr ""
 "Errore nell'analisi della stringa della query: %s\n"
 "%s"
 
-#: ../src/gdaex.c:705
+#: ../src/gdaex.c:721
 #, c-format
 msgid ""
 "Error executing selection query: %s\n"
@@ -90,24 +90,24 @@ msgstr ""
 "Errore nell'esecuzione della query di selezione: %s\n"
 "%s"
 
-#: ../src/gdaex.c:713
+#: ../src/gdaex.c:729
 #, c-format
 msgid "Selection query executed: %s"
 msgstr "Query di selezione eseguita: %s"
 
-#: ../src/gdaex.c:757 ../src/gdaex.c:788 ../src/gdaex.c:818 ../src/gdaex.c:848
-#: ../src/gdaex.c:878 ../src/gdaex.c:908 ../src/gdaex.c:939 ../src/gdaex.c:970
-#: ../src/gdaex.c:1001 ../src/gdaex.c:1513 ../src/gdaex.c:1545
-#: ../src/gdaex.c:1576 ../src/gdaex.c:1607 ../src/gdaex.c:1638
-#: ../src/gdaex.c:1669 ../src/gdaex.c:1701 ../src/gdaex.c:1733
-#: ../src/gdaex.c:1765
+#: ../src/gdaex.c:773 ../src/gdaex.c:827 ../src/gdaex.c:857 ../src/gdaex.c:887
+#: ../src/gdaex.c:917 ../src/gdaex.c:947 ../src/gdaex.c:978 ../src/gdaex.c:1009
+#: ../src/gdaex.c:1040 ../src/gdaex.c:1582 ../src/gdaex.c:1635
+#: ../src/gdaex.c:1666 ../src/gdaex.c:1697 ../src/gdaex.c:1728
+#: ../src/gdaex.c:1759 ../src/gdaex.c:1791 ../src/gdaex.c:1823
+#: ../src/gdaex.c:1855
 #, c-format
 msgid "No column found with name «%s»."
 msgstr "Nessuna colonna trovata con il nome «%s»."
 
-#: ../src/gdaex.c:1039 ../src/gdaex.c:1079 ../src/gdaex.c:1118
-#: ../src/gdaex.c:1157 ../src/gdaex.c:1209 ../src/gdaex.c:1304
-#: ../src/gdaex.c:1364 ../src/gdaex.c:1430 ../src/gdaex.c:1480
+#: ../src/gdaex.c:1078 ../src/gdaex.c:1142 ../src/gdaex.c:1184
+#: ../src/gdaex.c:1226 ../src/gdaex.c:1278 ../src/gdaex.c:1373
+#: ../src/gdaex.c:1433 ../src/gdaex.c:1499 ../src/gdaex.c:1549
 #, c-format
 msgid ""
 "Error on retrieving field's value: «%s».\n"
@@ -116,7 +116,7 @@ msgstr ""
 "Errore nell'ottenere il valore del campo: «%s»\n"
 "%s\n"
 
-#: ../src/gdaex.c:1297 ../src/gdaex.c:1357 ../src/gdaex.c:1423
+#: ../src/gdaex.c:1366 ../src/gdaex.c:1426 ../src/gdaex.c:1492
 #, c-format
 msgid ""
 "Error on retrieving field's value: «%s».\n"
@@ -125,44 +125,44 @@ msgstr ""
 "Errore nell'ottenere il valore del campo: «%s».\n"
 "Tipo GValue sconosciuto."
 
-#: ../src/gdaex.c:1794 ../src/gdaex.c:1832 ../src/gdaex.c:1870
-#: ../src/gdaex.c:1908 ../src/gdaex.c:1946 ../src/gdaex.c:1999
-#: ../src/gdaex.c:2092 ../src/gdaex.c:2148 ../src/gdaex.c:2214
+#: ../src/gdaex.c:1884 ../src/gdaex.c:1942 ../src/gdaex.c:1983
+#: ../src/gdaex.c:2024 ../src/gdaex.c:2065 ../src/gdaex.c:2118
+#: ../src/gdaex.c:2211 ../src/gdaex.c:2267 ../src/gdaex.c:2333
 #, c-format
 msgid "Error on retrieving field's value: «%s»."
 msgstr "Errore nell'ottenere il valore del campo: «%s»."
 
-#: ../src/gdaex.c:2061 ../src/gdaex.c:2117 ../src/gdaex.c:2185
+#: ../src/gdaex.c:2180 ../src/gdaex.c:2236 ../src/gdaex.c:2304
 msgid "Error on retrieving field's value: unknown GValue type."
 msgstr "Impossibile ottenere il valore del campo: tipo GValue sconosciuto."
 
-#: ../src/gdaex.c:2312
+#: ../src/gdaex.c:2431
 #, c-format
 msgid "Error on retrieving column %d: %s"
 msgstr "Errore nell'ottenere la colonna %d: %s"
 
-#: ../src/gdaex.c:2408
+#: ../src/gdaex.c:2527
 msgid "Invalid GdaDataModel."
 msgstr "GdaDataModel non valido."
 
-#: ../src/gdaex.c:2422
+#: ../src/gdaex.c:2541
 msgid "Unable to create the GtkTreeModel."
 msgstr "Impossibile creare il GtkTreeModel."
 
-#: ../src/gdaex.c:2469
+#: ../src/gdaex.c:2588
 #, c-format
 msgid "Error opening transaction: %s\n"
 msgstr "Errore nell'apertura della transazione: %s\n"
 
-#: ../src/gdaex.c:2481
+#: ../src/gdaex.c:2600
 msgid "No transaction opened"
 msgstr "Nessuna transazione aperta"
 
-#: ../src/gdaex.c:2486
+#: ../src/gdaex.c:2605
 msgid "Transaction opened."
 msgstr "Transazione aperta."
 
-#: ../src/gdaex.c:2520
+#: ../src/gdaex.c:2639
 #, c-format
 msgid ""
 "REMAINS:\n"
@@ -175,7 +175,7 @@ msgstr ""
 "da\n"
 "%s"
 
-#: ../src/gdaex.c:2526 ../src/gdaex.c:2597
+#: ../src/gdaex.c:2645 ../src/gdaex.c:2716
 #, c-format
 msgid ""
 "Error parsing sql: %s\n"
@@ -184,7 +184,7 @@ msgstr ""
 "Errore nell'analisi dell'sql: %s\n"
 "%s"
 
-#: ../src/gdaex.c:2544
+#: ../src/gdaex.c:2663
 #, c-format
 msgid ""
 "Error executing command query: %s\n"
@@ -193,244 +193,272 @@ msgstr ""
 "Errore nell'esecuzione della query di comando: %s\n"
 "%s"
 
-#: ../src/gdaex.c:2552
+#: ../src/gdaex.c:2671
 #, c-format
 msgid "Query executed: %s"
 msgstr "Query eseguita: %s"
 
-#: ../src/gdaex.c:2646 ../src/gdaex.c:2696
+#: ../src/gdaex.c:2765 ../src/gdaex.c:2815
 msgid "No transaction opened."
 msgstr "Nessuna transazione aperta."
 
-#: ../src/gdaex.c:2656
+#: ../src/gdaex.c:2775
 #, c-format
 msgid "Error committing transaction: %s"
 msgstr "Errore nel committare la transazione: %s"
 
-#: ../src/gdaex.c:2662
+#: ../src/gdaex.c:2781
 msgid "Transaction committed."
 msgstr "Transazione committata."
 
-#: ../src/gdaex.c:2706
+#: ../src/gdaex.c:2825
 #, c-format
 msgid "Error rollbacking transaction: %s"
 msgstr "Errore nel rollbacking della transazione: %s"
 
-#: ../src/gdaex.c:2714
+#: ../src/gdaex.c:2833
 msgid "Transaction rolled back."
 msgstr "Transazione rolled back."
 
-#: ../src/gdaex.c:3155
+#: ../src/gdaex.c:3276
 msgid "HashTable fields cannot be empty."
 msgstr "I campi della HashTable non possono essere vuoti."
 
-#: ../src/gdaex.c:3198
+#: ../src/gdaex.c:3319
 #, c-format
 msgid "Unable to get a GdaStatement from GdaSqlBuilder: %s"
 msgstr "Impossibile ottenere il GdaStatement dal GdaSqlBuilder: %s"
 
-#: ../src/gdaex.c:3212
+#: ../src/gdaex.c:3333
 #, c-format
 msgid "Unable to get an SQL statement from GdaStatement: %s"
 msgstr "Impossibile ottenere una istruzione SQL dal GdaStatement: %s"
 
-#: ../src/gdaex.c:3286
+#: ../src/gdaex.c:3407
 #, c-format
 msgid "Error on creating regex: %s"
 msgstr "Errore nella creazione dell'espressione regolare: %s"
 
-#: ../src/gdaex.c:3304
+#: ../src/gdaex.c:3425
 #, c-format
 msgid "Error on regex replacing: %s"
 msgstr "Errore nell'espressione regolare di sostituzione: %s"
 
-#: ../src/queryeditor.c:374
+#: ../src/queryeditor.c:383
+msgid "Unable to load module of myself"
+msgstr "Impossibile caricare me stesso come modulo"
+
+#: ../src/queryeditor.c:413
+#, c-format
+msgid "Unable to load %s: %s."
+msgstr "Impossibile caricare %s: %s."
+
+#: ../src/queryeditor.c:421
+#, c-format
+msgid "Unable to open modules dir: %s."
+msgstr "Impossibile la directosy dei moduli: %s."
+
+#: ../src/queryeditor.c:427
+msgid "Modules not supported by this operating system."
+msgstr "Moduli non supportati in questo sistema operativo."
+
+#: ../src/queryeditor.c:478
 #, c-format
 msgid "Error on gui initialization: %s."
 msgstr "Errore nell'inizializzazione dell'interfaccia grafica: %s."
 
-#: ../src/queryeditor.c:611 ../src/queryeditor.c:769 ../src/queryeditor.c:777
+#: ../src/queryeditor.c:716 ../src/queryeditor.c:864 ../src/queryeditor.c:872
 #, c-format
 msgid "Table «%s» doesn't exists."
 msgstr "La tabella «%s» non esiste."
 
-#: ../src/queryeditor.c:620 ../src/queryeditor.c:628
+#: ../src/queryeditor.c:725 ../src/queryeditor.c:733
 msgid "No field added: the field must have a name."
 msgstr "Nessun campo aggiunto: il campo deve avere un nome."
 
-#: ../src/queryeditor.c:818
+#: ../src/queryeditor.c:913
 msgid "Relation not created: no field added to the relation."
 msgstr "Relazione non creata: nesuun campo aggiunto alla relazione."
 
-#: ../src/queryeditor.c:1163
+#: ../src/queryeditor.c:1295
 msgid "No table's definitions on xml file."
 msgstr "Nessuna definizione di tabella nel file xml."
 
-#: ../src/queryeditor.c:1293
+#: ../src/queryeditor.c:1421
+#, c-format
+msgid "Unknown iwidget_from type «%s»."
+msgstr "Tipo iwidget_from «%s» sconosciuto."
+
+#: ../src/queryeditor.c:1441
+#, c-format
+msgid "Unknown iwidget_to type «%s»."
+msgstr "Tipo iwidget_to «%s» sconosciuto."
+
+#: ../src/queryeditor.c:1474
 msgid "No field's definitions on xml file."
 msgstr "Nessuna definizione di campo nel file xml."
 
-#: ../src/queryeditor.c:1821 ../src/queryeditor.c:2283
+#: ../src/queryeditor.c:2010 ../src/queryeditor.c:2480
 #, c-format
 msgid "Where type «%d» not valid."
 msgstr "Tipo where «%d» non valido."
 
-#: ../src/queryeditor.c:2009
+#: ../src/queryeditor.c:2017
+msgid "Unable to create GdaSqlBuilder condition."
+msgstr "Impossibile creare la condizione GdaSqlBuilder."
+
+#: ../src/queryeditor.c:2206
 #, c-format
 msgid "Unable to create GdaStatement: %s."
 msgstr "Impossibile creare l'oggetto GdaStatement: %s."
 
-#: ../src/queryeditor.c:2021
+#: ../src/queryeditor.c:2218
 #, c-format
 msgid "Unable to create sql: %s."
 msgstr "Impossibile creare l'sql: %s."
 
-#: ../src/queryeditor.c:2216
+#: ../src/queryeditor.c:2413
 #, c-format
 msgid "Link type «%d» not valid."
 msgstr "Tipo collegamento «%d» non valido."
 
-#: ../src/queryeditor.c:2465
+#: ../src/queryeditor.c:2662
 #, c-format
 msgid "Table «%s» not found."
 msgstr "Tabella «%s» non trovata."
 
-#: ../src/queryeditor.c:2473
+#: ../src/queryeditor.c:2670
 #, c-format
 msgid "Field «%s» not found in table «%s»."
 msgstr "Campo «%s» non trovato nella tabella «%s»."
 
-#: ../src/queryeditor.c:2660 ../src/queryeditor.c:3557
+#: ../src/queryeditor.c:2867 ../src/queryeditor.c:3807
 msgid "ASC"
 msgstr "ASC"
 
-#: ../src/queryeditor.c:2661 ../src/queryeditor.c:3561
+#: ../src/queryeditor.c:2868 ../src/queryeditor.c:3811
 msgid "DESC"
 msgstr "DISC"
 
-#: ../src/queryeditor.c:2936
+#: ../src/queryeditor.c:3176
 msgid "Are you sure you want to remove the selected field?"
 msgstr "Eliminare il campo selezionato?"
 
-#: ../src/queryeditor.c:2957 ../src/queryeditor.c:3053
-#: ../src/queryeditor.c:3635 ../src/queryeditor.c:3839
-#: ../src/queryeditor.c:4411
+#: ../src/queryeditor.c:3197 ../src/queryeditor.c:3293
+#: ../src/queryeditor.c:3887 ../src/queryeditor.c:4103
+#: ../src/queryeditor.c:4681
 msgid "You must select a field before."
 msgstr "Occorre prima selezione un campo."
 
-#: ../src/queryeditor.c:3113
+#: ../src/queryeditor.c:3353
 msgid "Equal"
 msgstr "uguale a"
 
-#: ../src/queryeditor.c:3117
+#: ../src/queryeditor.c:3357
 msgid "Starts with"
 msgstr "inizia per"
 
-#: ../src/queryeditor.c:3121
+#: ../src/queryeditor.c:3361
 msgid "Contains"
 msgstr "contiene"
 
-#: ../src/queryeditor.c:3125
+#: ../src/queryeditor.c:3365
 msgid "Ends with"
 msgstr "finisce con"
 
-#: ../src/queryeditor.c:3129
+#: ../src/queryeditor.c:3369
 msgid "Case-insensitive starts with"
 msgstr "inizia per (no maiuscole/minuscole)"
 
-#: ../src/queryeditor.c:3133
+#: ../src/queryeditor.c:3373
 msgid "Case-insensitive contains"
 msgstr "contiene (no maiuscole/minuscole)"
 
-#: ../src/queryeditor.c:3137
+#: ../src/queryeditor.c:3377
 msgid "Case-insensitive ends with"
 msgstr "finisce con (no maiuscole/minuscole)"
 
-#: ../src/queryeditor.c:3141
+#: ../src/queryeditor.c:3381
 msgid "Greater"
 msgstr "maggiore di"
 
-#: ../src/queryeditor.c:3145
+#: ../src/queryeditor.c:3385
 msgid "Greater or equal"
 msgstr "maggiore di o uguale a"
 
-#: ../src/queryeditor.c:3149
+#: ../src/queryeditor.c:3389
 msgid "Lesser"
 msgstr "minore di"
 
-#: ../src/queryeditor.c:3153
+#: ../src/queryeditor.c:3393
 msgid "Lesser or equal"
 msgstr "minore di o uguale a"
 
-#: ../src/queryeditor.c:3157
+#: ../src/queryeditor.c:3397
 msgid "Between"
 msgstr "compreso tra"
 
-#: ../src/queryeditor.c:3161
+#: ../src/queryeditor.c:3401
 msgid "Is NULL"
 msgstr "è NULL"
 
-#: ../src/queryeditor.c:3182
+#: ../src/queryeditor.c:3422
 msgid "And"
 msgstr "e"
 
-#: ../src/queryeditor.c:3186
+#: ../src/queryeditor.c:3426
 msgid "Or"
 msgstr "o"
 
-#: ../src/queryeditor.c:3452
+#: ../src/queryeditor.c:3696
 msgid "You must select a link's type before."
 msgstr "Occorre selezionare prima un tipo di collegamento."
 
-#: ../src/queryeditor.c:3476
+#: ../src/queryeditor.c:3720
 msgid "You must select a condition's type before."
 msgstr "Occorre selezionare prima un tipo di condizione."
 
 #. if it is the first condition, "link" isn't visibile
-#: ../src/queryeditor.c:4036 ../data/libgdaex/gui/libgdaex.ui.h:5
+#: ../src/queryeditor.c:4310 ../data/libgdaex/gui/libgdaex.ui.h:5
 msgid "Link"
 msgstr "Collegamento"
 
-#: ../src/queryeditor.c:4040 ../data/libgdaex/gui/libgdaex.ui.h:6
+#: ../src/queryeditor.c:4314 ../data/libgdaex/gui/libgdaex.ui.h:6
 msgid "Not"
 msgstr "Non"
 
-#: ../src/queryeditor.c:4043 ../data/libgdaex/gui/libgdaex.ui.h:7
+#: ../src/queryeditor.c:4317 ../data/libgdaex/gui/libgdaex.ui.h:7
 msgid "Condition"
 msgstr "Condizione"
 
-#: ../src/queryeditor.c:4046
+#: ../src/queryeditor.c:4320
 msgid "Value"
 msgstr "Valore"
 
-#: ../src/queryeditor.c:4090
+#: ../src/queryeditor.c:4361
 msgid "and"
 msgstr "e"
 
-#: ../src/queryeditor.c:4266
+#: ../src/queryeditor.c:4540
 #, c-format
 msgid "Field's type «%d» not valid."
 msgstr "Il tipo campo «%d» non è valido."
 
-#: ../src/queryeditor.c:4503
+#: ../src/queryeditor.c:4794
 msgid "Ascending"
 msgstr "ascendente"
 
-#: ../src/queryeditor.c:4506
+#: ../src/queryeditor.c:4797
 msgid "Descending"
 msgstr "discendente"
 
-#: ../src/grid.c:589
-msgid "_Columns"
-msgstr "_Colonne"
-
-#: ../src/grid.c:662
-msgid "_Print..."
-msgstr "Stam_pa..."
+#: ../src/queryeditorcheck.c:139
+msgid "True"
+msgstr "Vero"
 
-#: ../src/grid.c:671
-msgid "_Export..."
-msgstr "_Esporta..."
+#: ../src/queryeditorcheck.c:139
+msgid "False"
+msgstr "Falso"
 
 #: ../data/libgdaex/gui/libgdaex.ui.h:1
 msgid "Fields"
@@ -467,3 +495,12 @@ msgstr "Condizioni"
 #: ../data/libgdaex/gui/libgdaex.ui.h:12
 msgid "Order"
 msgstr "Ordinamento"
+
+#~ msgid "_Columns"
+#~ msgstr "_Colonne"
+
+#~ msgid "_Print..."
+#~ msgstr "Stam_pa..."
+
+#~ msgid "_Export..."
+#~ msgstr "_Esporta..."
index 90a9f97a96d471ce104d6d7345c83482cf0cafce..5fe63c05914871d4636d95843317ba630f825208 100644 (file)
@@ -21,6 +21,7 @@ libgdaex_la_SOURCES = gdaex.c \
                       queryeditormarshal.c \
                       queryeditor.c \
                       queryeditor_widget_interface.c \
+                      queryeditorcheck.c \
                       queryeditorentry.c \
                       queryeditorentrydate.c \
                       sqlbuilder.c
@@ -31,6 +32,7 @@ libgdaex_include_HEADERS = libgdaex.h \
                            gdaex.h \
                            queryeditor.h \
                            queryeditor_widget_interface.h \
+                           queryeditorcheck.h \
                            queryeditorentry.h \
                            queryeditorentrydate.h \
                            sqlbuilder.h
index 1b7d6953cc0038f59ae80a263a094c50271e78b1..cb2eff980f6b1201e8cf6ad74f68db0ce2453f2c 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "queryeditormarshal.h"
 #include "queryeditor.h"
+#include "queryeditorcheck.h"
 #include "queryeditorentry.h"
 #include "queryeditorentrydate.h"
 
@@ -772,6 +773,10 @@ gdaex_query_editor_table_add_field (GdaExQueryEditor *qe,
                                                        gtk_entry_set_max_length (GTK_ENTRY (_field->iwidget_from), 8);
                                                }
                                }
+                       else if (_field->type == GDAEX_QE_FIELD_TYPE_BOOLEAN)
+                               {
+                                       _field->iwidget_from = GDAEX_QUERY_EDITOR_IWIDGET (gdaex_query_editor_check_new ());
+                               }
                        else
                                {
                                        _field->iwidget_from = GDAEX_QUERY_EDITOR_IWIDGET (gdaex_query_editor_entry_new ());
@@ -802,6 +807,10 @@ gdaex_query_editor_table_add_field (GdaExQueryEditor *qe,
                                                        gtk_entry_set_max_length (GTK_ENTRY (_field->iwidget_to), 8);
                                                }
                                }
+                       else if (_field->type == GDAEX_QE_FIELD_TYPE_BOOLEAN)
+                               {
+                                       _field->iwidget_to = GDAEX_QUERY_EDITOR_IWIDGET (gdaex_query_editor_check_new ());
+                               }
                        else
                                {
                                        _field->iwidget_to = GDAEX_QUERY_EDITOR_IWIDGET (gdaex_query_editor_entry_new ());
@@ -970,15 +979,23 @@ gdaex_query_editor_str_to_field_type (gchar *str)
 
        ret = 0;
 
-       if (g_strcmp0 (str, "text") == 0)
+       if (g_strcmp0 (str, "text") == 0
+               || g_strcmp0 (str, "string") == 0)
                {
                        ret = GDAEX_QE_FIELD_TYPE_TEXT;
                }
-       else if (g_strcmp0 (str, "integer") == 0)
+       else if (g_strcmp0 (str, "integer") == 0
+                        || g_strcmp0 (str, "int") == 0)
                {
                        ret = GDAEX_QE_FIELD_TYPE_INTEGER;
                }
-       else if (g_strcmp0 (str, "double") == 0)
+       else if (g_strcmp0 (str, "boolean") == 0
+                        || g_strcmp0 (str, "bool") == 0)
+               {
+                       ret = GDAEX_QE_FIELD_TYPE_BOOLEAN;
+               }
+       else if (g_strcmp0 (str, "double") == 0
+                        || g_strcmp0 (str, "float") == 0)
                {
                        ret = GDAEX_QE_FIELD_TYPE_DOUBLE;
                }
@@ -1904,6 +1921,14 @@ gdaex_query_editor_sql_where (GdaExQueryEditor *qe,
                                                                                        }
                                                                                break;
 
+                                                                       case GDAEX_QE_FIELD_TYPE_BOOLEAN:
+                                                                               id_value1 = gda_sql_builder_add_expr (sqlbuilder, NULL, G_TYPE_BOOLEAN, zak_utils_string_to_boolean (from_str));
+                                                                               if (to_str != NULL)
+                                                                                       {
+                                                                                               id_value2 = gda_sql_builder_add_expr (sqlbuilder, NULL, G_TYPE_BOOLEAN, zak_utils_string_to_boolean (to_str));
+                                                                                       }
+                                                                               break;
+
                                                                        case GDAEX_QE_FIELD_TYPE_DOUBLE:
                                                                                id_value1 = gda_sql_builder_add_expr (sqlbuilder, NULL, G_TYPE_DOUBLE, g_strtod (from_str, NULL));
                                                                                if (to_str != NULL)
@@ -3713,6 +3738,14 @@ gdaex_query_editor_on_btn_save_clicked (GtkButton *button,
                                                                        {
                                                                                val1 = g_strdup (val1);
                                                                        }
+                                                               if (val1_visible == NULL)
+                                                                       {
+                                                                               val1_visible = g_strdup ("");
+                                                                       }
+                                                               else
+                                                                       {
+                                                                               val1_visible = g_strdup (val1_visible);
+                                                                       }
                                                                if (val1_sql == NULL
                                                                        || g_strcmp0 (val1_sql, "NULL") == 0)
                                                                        {
@@ -3723,25 +3756,42 @@ gdaex_query_editor_on_btn_save_clicked (GtkButton *button,
                                                                                val1_sql = g_strdup (val1_sql);
                                                                        }
 
-                                                               val2 = (gchar *)gdaex_query_editor_iwidget_get_value (GDAEX_QUERY_EDITOR_IWIDGET (priv->txt_to));
-                                                               val2_visible = (gchar *)gdaex_query_editor_iwidget_get_value_visible (GDAEX_QUERY_EDITOR_IWIDGET (priv->txt_to));
-                                                               val2_sql = (gchar *)gdaex_query_editor_iwidget_get_value_sql (GDAEX_QUERY_EDITOR_IWIDGET (priv->txt_to));
-                                                               if (val2 == NULL)
+                                                               if (where_type != GDAEX_QE_WHERE_TYPE_BETWEEN)
                                                                        {
                                                                                val2 = g_strdup ("");
-                                                                       }
-                                                               else
-                                                                       {
-                                                                               val2 = g_strdup (val2);
-                                                                       }
-                                                               if (val2_sql == NULL
-                                                                       || g_strcmp0 (val2_sql, "NULL") == 0)
-                                                                       {
+                                                                               val2_visible = g_strdup ("");
                                                                                val2_sql = g_strdup ("");
                                                                        }
                                                                else
                                                                        {
-                                                                               val2_sql = g_strdup (val2_sql);
+                                                                               val2 = (gchar *)gdaex_query_editor_iwidget_get_value (GDAEX_QUERY_EDITOR_IWIDGET (priv->txt_to));
+                                                                               val2_visible = (gchar *)gdaex_query_editor_iwidget_get_value_visible (GDAEX_QUERY_EDITOR_IWIDGET (priv->txt_to));
+                                                                               val2_sql = (gchar *)gdaex_query_editor_iwidget_get_value_sql (GDAEX_QUERY_EDITOR_IWIDGET (priv->txt_to));
+                                                                               if (val2 == NULL)
+                                                                                       {
+                                                                                               val2 = g_strdup ("");
+                                                                                       }
+                                                                               else
+                                                                                       {
+                                                                                               val2 = g_strdup (val2);
+                                                                                       }
+                                                                               if (val2_visible == NULL)
+                                                                                       {
+                                                                                               val2_visible = g_strdup ("");
+                                                                                       }
+                                                                               else
+                                                                                       {
+                                                                                               val2_visible = g_strdup (val2_visible);
+                                                                                       }
+                                                                               if (val2_sql == NULL
+                                                                                       || g_strcmp0 (val2_sql, "NULL") == 0)
+                                                                                       {
+                                                                                               val2_sql = g_strdup ("");
+                                                                                       }
+                                                                               else
+                                                                                       {
+                                                                                               val2_sql = g_strdup (val2_sql);
+                                                                                       }
                                                                        }
                                                        }
                                                else
@@ -4498,6 +4548,7 @@ gdaex_query_editor_on_sel_where_changed (GtkTreeSelection *treeselection,
                                                {
                                                        case GDAEX_QE_FIELD_TYPE_TEXT:
                                                        case GDAEX_QE_FIELD_TYPE_INTEGER:
+                                                       case GDAEX_QE_FIELD_TYPE_BOOLEAN:
                                                        case GDAEX_QE_FIELD_TYPE_DOUBLE:
                                                        case GDAEX_QE_FIELD_TYPE_DATE:
                                                        case GDAEX_QE_FIELD_TYPE_DATETIME:
@@ -4546,6 +4597,7 @@ gdaex_query_editor_on_sel_where_changed (GtkTreeSelection *treeselection,
                                                {
                                                        case GDAEX_QE_FIELD_TYPE_TEXT:
                                                        case GDAEX_QE_FIELD_TYPE_INTEGER:
+                                                       case GDAEX_QE_FIELD_TYPE_BOOLEAN:
                                                        case GDAEX_QE_FIELD_TYPE_DOUBLE:
                                                        case GDAEX_QE_FIELD_TYPE_DATE:
                                                        case GDAEX_QE_FIELD_TYPE_DATETIME:
index 11454115e8d36593d84de3a5d70cd707c4a2bc74..b5f3dd28355d845654bf853df0d3de11ef450276 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2011-2016 Andrea Zagli <azagli@libero.it>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -72,10 +72,11 @@ typedef enum
        {
                GDAEX_QE_FIELD_TYPE_TEXT = 1,
                GDAEX_QE_FIELD_TYPE_INTEGER,
+               GDAEX_QE_FIELD_TYPE_BOOLEAN,
                GDAEX_QE_FIELD_TYPE_DOUBLE,
                GDAEX_QE_FIELD_TYPE_DATE,
                GDAEX_QE_FIELD_TYPE_DATETIME,
-               GDAEX_QE_FIELD_TYPE_TIME,
+               GDAEX_QE_FIELD_TYPE_TIME
        } GdaExQueryEditorFieldType;
 
 typedef enum
diff --git a/src/queryeditorcheck.c b/src/queryeditorcheck.c
new file mode 100644 (file)
index 0000000..dd99f01
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2016 Andrea Zagli <azagli@libero.it>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+       #include "config.h"
+#endif
+
+#include <glib/gi18n-lib.h>
+
+#include <libzakutils/libzakutils.h>
+
+#include "libgdaex.h"
+
+#include "queryeditorcheck.h"
+
+static void gdaex_query_editor_check_class_init (GdaExQueryEditorCheckClass *klass);
+static void gdaex_query_editor_check_init (GdaExQueryEditorCheck *masked_check);
+
+static void gdaex_query_editor_check_gdaex_query_editor_iwidget_interface_init (GdaExQueryEditorIWidgetIface *iface);
+
+static void gdaex_query_editor_check_set_property (GObject *object,
+                                           guint property_id,
+                                           const GValue *value,
+                                           GParamSpec *pspec);
+static void gdaex_query_editor_check_get_property (GObject *object,
+                                           guint property_id,
+                                           GValue *value,
+                                           GParamSpec *pspec);
+
+static const gchar *gdaex_query_editor_check_get_value (GdaExQueryEditorIWidget *iwidget);
+static const gchar *gdaex_query_editor_check_get_value_visible (GdaExQueryEditorIWidget *iwidget);
+static const gchar *gdaex_query_editor_check_get_value_sql (GdaExQueryEditorIWidget *iwidget);
+static void gdaex_query_editor_check_set_value (GdaExQueryEditorIWidget *iwidget, const gchar *value);
+
+#define GDAEX_QUERY_EDITOR_CHECK_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_CHECK_BUTTON, GdaExQueryEditorCheckPrivate))
+
+typedef struct _GdaExQueryEditorCheckPrivate GdaExQueryEditorCheckPrivate;
+struct _GdaExQueryEditorCheckPrivate
+       {
+               gpointer foo;
+       };
+
+G_DEFINE_TYPE_WITH_CODE (GdaExQueryEditorCheck, gdaex_query_editor_check, GTK_TYPE_CHECK_BUTTON,
+                         G_IMPLEMENT_INTERFACE (GDAEX_QUERY_EDITOR_TYPE_IWIDGET,
+                                                gdaex_query_editor_check_gdaex_query_editor_iwidget_interface_init));
+
+static void
+gdaex_query_editor_check_class_init (GdaExQueryEditorCheckClass *klass)
+{
+       GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+       g_type_class_add_private (object_class, sizeof (GdaExQueryEditorCheckPrivate));
+
+       object_class->set_property = gdaex_query_editor_check_set_property;
+       object_class->get_property = gdaex_query_editor_check_get_property;
+}
+
+static void
+gdaex_query_editor_check_init (GdaExQueryEditorCheck *check)
+{
+       GdaExQueryEditorCheckPrivate *priv = GDAEX_QUERY_EDITOR_CHECK_GET_PRIVATE (check);
+}
+
+static void
+gdaex_query_editor_check_gdaex_query_editor_iwidget_interface_init (GdaExQueryEditorIWidgetIface *iface)
+{
+       iface->get_value = gdaex_query_editor_check_get_value;
+       iface->get_value_visible = gdaex_query_editor_check_get_value_visible;
+       iface->get_value_sql = gdaex_query_editor_check_get_value_sql;
+       iface->set_value = gdaex_query_editor_check_set_value;
+}
+
+/**
+ * gdaex_query_editor_check_new:
+ *
+ * Creates a new #GdaExQueryEditorCheck widget.
+ *
+ * Returns: the newly created #GdaExQueryEditorCheck widget.
+ */
+GtkWidget*
+gdaex_query_editor_check_new ()
+{
+       return GTK_WIDGET (g_object_new (gdaex_query_editor_check_get_type (), NULL));
+}
+
+static void
+gdaex_query_editor_check_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
+{
+       GdaExQueryEditorCheck *check = GDAEX_QUERY_EDITOR_CHECK (object);
+       GdaExQueryEditorCheckPrivate *priv = GDAEX_QUERY_EDITOR_CHECK_GET_PRIVATE (check);
+
+       switch (property_id)
+               {
+                       default:
+                               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+                               break;
+               }
+}
+
+static void
+gdaex_query_editor_check_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
+{
+       GdaExQueryEditorCheck *check = GDAEX_QUERY_EDITOR_CHECK (object);
+       GdaExQueryEditorCheckPrivate *priv = GDAEX_QUERY_EDITOR_CHECK_GET_PRIVATE (check);
+
+       switch (property_id)
+               {
+                       default:
+                               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+                               break;
+               }
+}
+
+static const gchar
+*gdaex_query_editor_check_get_value (GdaExQueryEditorIWidget *iwidget)
+{
+       return g_strdup (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (iwidget)) ? "1" : "0");
+}
+
+static const gchar
+*gdaex_query_editor_check_get_value_visible (GdaExQueryEditorIWidget *iwidget)
+{
+       return g_strdup (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (iwidget)) ? _("True") : _("False"));
+}
+
+static const gchar
+*gdaex_query_editor_check_get_value_sql (GdaExQueryEditorIWidget *iwidget)
+{
+       return g_strdup (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (iwidget)) ? "TRUE" : "FALSE");
+}
+
+static void
+gdaex_query_editor_check_set_value (GdaExQueryEditorIWidget *iwidget,
+                            const gchar *value)
+{
+       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (iwidget), zak_utils_string_to_boolean (value));
+}
diff --git a/src/queryeditorcheck.h b/src/queryeditorcheck.h
new file mode 100644 (file)
index 0000000..20e8693
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2016 Andrea Zagli <azagli@libero.it>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GDAEX_QUERY_EDITOR_CHECK_H__
+#define __GDAEX_QUERY_EDITOR_CHECK_H__
+
+#include <gtk/gtk.h>
+
+
+G_BEGIN_DECLS
+
+
+#define GDAEX_QUERY_EDITOR_TYPE_CHECK                 (gdaex_query_editor_check_get_type ())
+#define GDAEX_QUERY_EDITOR_CHECK(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDAEX_QUERY_EDITOR_TYPE_CHECK, GdaExQueryEditorCheck))
+#define GDAEX_QUERY_EDITOR_CHECK_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GDAEX_QUERY_EDITOR_TYPE_CHECK, GdaExQueryEditorCheckClass))
+#define GDAEX_QUERY_EDITOR_IS_CHECK(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDAEX_QUERY_EDITOR_TYPE_CHECK))
+#define GDAEX_QUERY_EDITOR_IS_CHECK_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GDAEX_QUERY_EDITOR_TYPE_CHECK))
+#define GDAEX_QUERY_EDITOR_CHECK_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GDAEX_QUERY_EDITOR_TYPE_CHECK, GdaExQueryEditorCheckClass))
+
+
+typedef struct _GdaExQueryEditorCheck        GdaExQueryEditorCheck;
+typedef struct _GdaExQueryEditorCheckClass   GdaExQueryEditorCheckClass;
+
+
+struct _GdaExQueryEditorCheck
+{
+       GtkCheckButton check;
+};
+
+struct _GdaExQueryEditorCheckClass
+{
+       GtkCheckButtonClass parent_class;
+};
+
+
+GType gdaex_query_editor_check_get_type (void) G_GNUC_CONST;
+
+GtkWidget *gdaex_query_editor_check_new (void);
+
+
+G_END_DECLS
+
+
+#endif /* __GDAEX_QUERY_EDITOR_CHECK_H__ */
index 204bc1e6e5ce3937860ec836a11ff9928ca4a51a..60350d345a52c7985f0d87681df5031012631a8a 100644 (file)
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
 #define GDAEX_QUERY_EDITOR_ENTRY(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDAEX_QUERY_EDITOR_TYPE_ENTRY, GdaExQueryEditorEntry))
 #define GDAEX_QUERY_EDITOR_ENTRY_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GDAEX_QUERY_EDITOR_TYPE_ENTRY, GdaExQueryEditorEntryClass))
 #define GDAEX_QUERY_EDITOR_IS_ENTRY(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDAEX_QUERY_EDITOR_TYPE_ENTRY))
-#define GDAEX_QUERY_EDITOR_IS_ENTRY_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GDAEX_QUERY_EDITOR_TYPE__ENTRY))
+#define GDAEX_QUERY_EDITOR_IS_ENTRY_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GDAEX_QUERY_EDITOR_TYPE_ENTRY))
 #define GDAEX_QUERY_EDITOR_ENTRY_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GDAEX_QUERY_EDITOR_TYPE_ENTRY, GdaExQueryEditorEntryClass))
 
 
index 963515e47a5a12da49c30670ce5be367bb410b1a..3404fdc917f292c29c540ba4ab74dab7cc7290e9 100644 (file)
                        <type>integer</type>
                        <available_where_type>number</available_where_type>
                </field>
+               <field>
+                       <name>married</name>
+                       <name_visible>Married</name_visible>
+                       <description>If married</description>
+                       <type>boolean</type>
+                       <available_where_type>equal</available_where_type>
+               </field>
        </fields>
 
        <fields table="orders">