From: Andrea Zagli Date: Thu, 3 Dec 2015 15:09:58 +0000 (+0100) Subject: Tested load. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=f7f67e41798327d3653f712de7d090ffd232615a;p=zakform%2Ftests Tested load. --- diff --git a/configure.ac b/configure.ac index 794b7c3..88f65b1 100644 --- a/configure.ac +++ b/configure.ac @@ -70,6 +70,7 @@ AC_CONFIG_FILES([ src/Makefile data/Makefile data/zakformtests/Makefile + data/zakformtests/db/Makefile data/zakformtests/gui/Makefile data/zakformtests/xml/Makefile ]) diff --git a/data/zakformtests/Makefile.am b/data/zakformtests/Makefile.am index 24edb2f..c87de49 100644 --- a/data/zakformtests/Makefile.am +++ b/data/zakformtests/Makefile.am @@ -1 +1 @@ -SUBDIRS = gui xml +SUBDIRS = db gui xml diff --git a/data/zakformtests/db/Makefile.am b/data/zakformtests/db/Makefile.am new file mode 100644 index 0000000..5995dc6 --- /dev/null +++ b/data/zakformtests/db/Makefile.am @@ -0,0 +1 @@ +noinst_DATA = main.db diff --git a/data/zakformtests/db/main.db b/data/zakformtests/db/main.db new file mode 100644 index 0000000..8925b31 Binary files /dev/null and b/data/zakformtests/db/main.db differ diff --git a/data/zakformtests/gui/main.ui b/data/zakformtests/gui/main.ui index 4befde9..db8a37a 100644 --- a/data/zakformtests/gui/main.ui +++ b/data/zakformtests/gui/main.ui @@ -35,7 +35,7 @@ 0 - 0 + 1 @@ -47,7 +47,7 @@ 1 - 0 + 1 @@ -59,7 +59,7 @@ 0 - 1 + 2 @@ -72,7 +72,7 @@ 1 - 1 + 2 @@ -84,7 +84,7 @@ 0 - 2 + 3 @@ -100,7 +100,7 @@ 1 - 2 + 3 @@ -112,7 +112,7 @@ 0 - 3 + 4 @@ -126,7 +126,7 @@ 1 - 3 + 4 @@ -139,7 +139,7 @@ 0 - 4 + 5 @@ -156,7 +156,7 @@ 1 - 4 + 5 @@ -168,7 +168,7 @@ 0 - 5 + 6 @@ -182,7 +182,7 @@ 1 - 5 + 6 @@ -194,7 +194,7 @@ 0 - 6 + 7 @@ -252,7 +252,7 @@ 1 - 6 + 7 @@ -264,7 +264,7 @@ 0 - 7 + 8 @@ -277,7 +277,29 @@ 1 - 7 + 8 + + + + + True + False + ID to load + 0 + + + 0 + 0 + + + + + True + True + + + 1 + 0 @@ -288,10 +310,49 @@ - + + True + False + vertical + 5 + start + + + Select + True + True + True + + + True + True + 0 + + + + + False + True + 1 + - + + True + True + in + + + True + True + + + + + True + True + 2 + diff --git a/data/zakformtests/xml/main.xml b/data/zakformtests/xml/main.xml index bcce5b1..bb6f505 100644 --- a/data/zakformtests/xml/main.xml +++ b/data/zakformtests/xml/main.xml @@ -1,31 +1,51 @@ + + id + integer + TRUE + FALSE + FALSE + entry1 + + + + id + integer 999 lbl_id + name + string John Doe txt_name + age + integer 33 spn_age + married + boolean TRUE chk_married + description + string dafault value for textview with line break and some tabs @@ -35,11 +55,15 @@ and some tabs + birthday + datetime txt_birthday + sex + string M rbtnNone @@ -47,6 +71,8 @@ and some tabs + sex + string M rbtnMale @@ -54,6 +80,8 @@ and some tabs + sex + string M rbtnFemale @@ -61,6 +89,8 @@ and some tabs + income + float txt_income diff --git a/src/Makefile.am b/src/Makefile.am index de5e8c8..1ca58cc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,7 @@ AM_CPPFLAGS = $(WARN_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) \ $(ZAKFORMTESTS_CFLAGS) \ + -DDBDIR="\"$(datadir)/$(PACKAGE)/db\"" \ -DGUIDIR="\"$(datadir)/$(PACKAGE)/gui\"" \ -DXMLDIR="\"$(datadir)/$(PACKAGE)/xml\"" diff --git a/src/main.c b/src/main.c index 0e460c8..a0900b1 100644 --- a/src/main.c +++ b/src/main.c @@ -24,13 +24,23 @@ #include #include +ZakFormGtkForm *form; +ZakFormGdaexProvider *provider; + +void +select_clicked (GtkButton *button, + gpointer user_data) +{ + zak_form_form_load (ZAK_FORM_FORM (form), ZAK_FORM_IPROVIDER (provider)); +} + int main (int argc, char *argv[]) { GtkBuilder *builder; GtkWidget *w; - ZakFormGtkForm *form; + GdaEx *gdaex; gtk_init (&argc, &argv); @@ -44,11 +54,17 @@ main (int argc, char *argv[]) g_signal_connect (w, "delete-event", gtk_main_quit, NULL); + g_signal_connect (gtk_builder_get_object (builder, "button1"), "clicked", + G_CALLBACK (select_clicked), NULL); + form = zak_form_gtk_form_new (); zak_form_gtk_form_set_gtkbuilder (form, builder); zak_form_form_load_from_file (ZAK_FORM_FORM (form), XMLDIR "/main.xml"); zak_form_form_clear (ZAK_FORM_FORM (form)); + gdaex = gdaex_new_from_string ("SQLite://DB_DIR=" DBDIR ";DB_NAME=main.db;"); + provider = zak_form_gdaex_provider_new (gdaex, "clients"); + gtk_widget_show_all (w); gtk_main ();