From: Andrea Zagli Date: Thu, 3 Dec 2015 16:00:18 +0000 (+0100) Subject: Tested insert and update. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=261960d0ce05a0225e17bf26048551d964adda0a;p=zakform%2Ftests Tested insert and update. --- diff --git a/data/zakformtests/db/main.db b/data/zakformtests/db/main.db index 8925b31..8851f6b 100644 Binary files a/data/zakformtests/db/main.db and b/data/zakformtests/db/main.db differ diff --git a/data/zakformtests/gui/main.ui b/data/zakformtests/gui/main.ui index db8a37a..d1a6092 100644 --- a/data/zakformtests/gui/main.ui +++ b/data/zakformtests/gui/main.ui @@ -313,12 +313,11 @@ True False - vertical 5 - start + center - Select + Load True True True @@ -329,6 +328,32 @@ 0 + + + Insert + True + True + True + + + True + True + 1 + + + + + Update + True + True + True + + + True + True + 2 + + False diff --git a/data/zakformtests/xml/main.xml b/data/zakformtests/xml/main.xml index bb6f505..336425f 100644 --- a/data/zakformtests/xml/main.xml +++ b/data/zakformtests/xml/main.xml @@ -6,7 +6,6 @@ integer TRUE FALSE - FALSE entry1 @@ -14,6 +13,7 @@ id integer + FALSE 999 lbl_id @@ -57,6 +57,7 @@ and some tabs birthday datetime + FALSE txt_birthday diff --git a/src/main.c b/src/main.c index a0900b1..7d1aaf0 100644 --- a/src/main.c +++ b/src/main.c @@ -28,12 +28,26 @@ ZakFormGtkForm *form; ZakFormGdaexProvider *provider; void -select_clicked (GtkButton *button, - gpointer user_data) +load_clicked (GtkButton *button, + gpointer user_data) { zak_form_form_load (ZAK_FORM_FORM (form), ZAK_FORM_IPROVIDER (provider)); } +void +insert_clicked (GtkButton *button, + gpointer user_data) +{ + zak_form_form_insert (ZAK_FORM_FORM (form), ZAK_FORM_IPROVIDER (provider)); +} + +void +update_clicked (GtkButton *button, + gpointer user_data) +{ + zak_form_form_update (ZAK_FORM_FORM (form), ZAK_FORM_IPROVIDER (provider)); +} + int main (int argc, char *argv[]) { @@ -55,7 +69,11 @@ main (int argc, char *argv[]) gtk_main_quit, NULL); g_signal_connect (gtk_builder_get_object (builder, "button1"), "clicked", - G_CALLBACK (select_clicked), NULL); + G_CALLBACK (load_clicked), NULL); + g_signal_connect (gtk_builder_get_object (builder, "button2"), "clicked", + G_CALLBACK (insert_clicked), NULL); + g_signal_connect (gtk_builder_get_object (builder, "button3"), "clicked", + G_CALLBACK (update_clicked), NULL); form = zak_form_gtk_form_new (); zak_form_gtk_form_set_gtkbuilder (form, builder);