From 261960d0ce05a0225e17bf26048551d964adda0a Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Thu, 3 Dec 2015 17:00:18 +0100 Subject: [PATCH] Tested insert and update. --- data/zakformtests/db/main.db | Bin 2048 -> 2048 bytes data/zakformtests/gui/main.ui | 31 ++++++++++++++++++++++++++++--- data/zakformtests/xml/main.xml | 3 ++- src/main.c | 24 +++++++++++++++++++++--- 4 files changed, 51 insertions(+), 7 deletions(-) diff --git a/data/zakformtests/db/main.db b/data/zakformtests/db/main.db index 8925b312b7a99c40de694f9a33836b50dffd8d53..8851f6ba040362a97a4143e7d169b0a47201a679 100644 GIT binary patch delta 237 zcmZn=Xb_kn&B!}Z#+jd&LH8L0F9QPuBeM?!v(IKhmU~Q-eVDg$Gw)_#Vism#7G};} zEXcxK59B9mGIB;Raxwv_LPdT?ChgqBqDqCV#Jtor5Dra}_dDi&7O86%8#dEp-hHfym9ohl!I(m60QvfuEgmPhw7@ z0u1@)<(FibWagzSl;kTECsyj|>2U!O7mx(P0tL=e&U}T;!YqaIOioTWhw2j#9l|+O MfnIW*yr10>0Q}}W$N&HU delta 63 zcmZn=Xb_kn&B!)U#+jduLHFe=UIqpRMrI!dW}nT1Ecciu`!H|i1PkqEVBQTB`pq=4 PVH=AxBPY}3{p^ka+X4^5 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); -- 2.49.0