From 5e563dd044e0fbaa6b96ccf120abcb55a73076ba Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sat, 2 Jan 2016 23:41:27 +0100 Subject: [PATCH] Aggiunta la funzione SolipaAllegato::add_to_zakformgtk. --- configure.ac | 16 +- data/libsolipa/gui/libsolipa.ui | 1371 ++++++++++++++++--------------- src/allegato.c | 50 +- src/allegato.h | 16 +- 4 files changed, 765 insertions(+), 688 deletions(-) diff --git a/configure.ac b/configure.ac index 9111364..60ce102 100644 --- a/configure.ac +++ b/configure.ac @@ -29,12 +29,22 @@ AC_PROG_MAKE_SET AC_PROG_LIBTOOL AC_PROG_RANLIB +dnl ****************************** +dnl Translations +dnl ****************************** +GETTEXT_PACKAGE=libzakform +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", + [The prefix for our gettext translation domains.]) +AM_GLIB_GNU_GETTEXT + # Checks for libraries. PKG_CHECK_MODULES(SOLIPA, [libgdaex >= 0.5.0 libgtkform >= 0.5.0 gio-2.0 >= 2.36 gtk+-3.0 >= 3.0 - libzakutils]) + libzakutils + libzakformgtk]) AC_SUBST(SOLIPA_CFLAGS) AC_SUBST(SOLIPA_LIBS) @@ -86,10 +96,6 @@ AC_HEADER_STDC # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST -# Checks for library functions. - -# Checks for library functions. - dnl ****************************** dnl Check for Operating System dnl ****************************** diff --git a/data/libsolipa/gui/libsolipa.ui b/data/libsolipa/gui/libsolipa.ui index acfbd00..6d878c5 100644 --- a/data/libsolipa/gui/libsolipa.ui +++ b/data/libsolipa/gui/libsolipa.ui @@ -2,59 +2,24 @@ - - - - - - - - - - - - - - - - - - - - 0 - Nessuno - - - 1 - SSL/TLS - - - 2 - STARTTLS - - - - + False 5 - True - 550 - 400 - True + Esporta CSV normal - + True False vertical 2 - + True False end - + gtk-cancel True True @@ -68,8 +33,8 @@ - - gtk-ok + + gtk-save True True True @@ -90,354 +55,447 @@ - + True True True True + vertical - + True False True True - 5 - 5 - 5 - - - True - False - 0 - Da: - - - 0 - 0 - - - - - True - False - 0 - A: - - - 0 - 1 - - - - - True - True - True - ● - False - False - - - 1 - 0 - - - - - True - True - True - ● - False - False - - - 1 - 1 - - - - - True - False - 0 - Oggetto: - - - 0 - 4 - - - - - True - True - True - ● - False - False - - - 1 - 4 - - - - - True - False - 0 - Cc: - - - 0 - 2 - - + 5 - + True False - 0 - Ccn: - - - 0 - 3 - - - - - True - True - True - ● - False - False - - - 1 - 2 - - - - - True - True - True - ● - False - False - - - 1 - 3 - - - - - True - True - True - True - etched-in - - - True - True - word - - - - - 0 - 8 - 2 - - - - - True - True - True - True + 0 - + True False - True - True - 5 - - - True - True - etched-in - - - True - True - 5 - multiple - lstore_mail_attachments - 5 - 5 - True - - - - - True - True - 0 - - + 5 + 5 + 5 + 5 - + True False vertical 5 - start - - gtk-add + True True - True - True - - - False - False + etched-in + + + True + True + lstore_treemodel_campi + False + 0 + + + + + + + + + 0 + + + + + + + Campo + + + + 2 + + + + + + + + + True + True 0 - - gtk-remove + True - False - True - True - True + False + 5 + end + + + Deseleziona tutti + True + True + True + + + False + False + 0 + + + + + Seleziona tutti + True + True + True + + + False + False + 1 + + False - False + True 1 - - False - True - 1 - - + True False - Allegati + <b>Seleziona i campi</b> + True - 0 - 9 - 2 + True + True + 0 - + True False - True - 5 + 0 - + True False - 0 - Richiedere ricevuta di ritorno + 12 + + + True + False + 5 + 5 + + + True + False + Quotatura + 0 + + + 0 + 0 + + + + + True + True + ● + " + False + False + + + 1 + 0 + + + + + True + False + Quotare tutto + 0 + + + 0 + 1 + + + + + True + True + False + 0 + True + + + 1 + 1 + + + + + True + False + Separatore + 0 + + + 0 + 2 + + + + + True + True + ● + , + False + False + + + 1 + 2 + + + + + True + False + Nomi dei campi come prima riga + 0 + + + 0 + 3 + + + + + True + True + False + 0 + True + + + 1 + 3 + + + + - - False - True - 0 - - - + + True - True - False - 0 - True + False + <b>Opzioni di esportazione</b> + True - - True - True - 1 - - 0 - 6 - 2 + True + True + 1 + + + False + True + + + + + True + False + True + True + 0 - + True False - - - 0 - 5 - 2 - + 5 + 5 + 5 + 5 + + + True + False + save + False + False + False + + + - - + + True False + <b>Seleziona il file</b> + True - - 0 - 7 - 2 - + + True + True + - - + + + False + True + 0 + + + + + + button1 + button2 + + + + + + + + + + + + + + + + + + + + + + 0 + Nessuno + + + 1 + SSL/TLS + + + 2 + STARTTLS + + + + + False + 5 + True + 550 + 400 + True + normal + + + True + False + vertical + 2 + + + True + False + end + + + gtk-cancel True - False - Mail + True + True + True - False + False + False + 0 - + + gtk-ok + True + True + True + True + + + False + False + 1 + + + + + False + True + end + 0 + + + + + True + True + True + True + + True False + True + True 5 5 5 - + True False + Da: 0 - Server 0 @@ -445,10 +503,25 @@ - + + True + False + A: + 0 + + + 0 + 1 + + + + True True True + ● + False + False 1 @@ -456,43 +529,51 @@ - + + True + True + True + ● + False + False + + + 1 + 1 + + + + True False + Oggetto: 0 - Metodo di sicurezza 0 - 1 + 4 - + True - False + True True - lstore_metodo_sicurezza - 0 - 0 - - - - 1 - - + ● + False + False 1 - 1 + 4 - + True False + Cc: 0 - Utente 0 @@ -500,10 +581,25 @@ - + + True + False + Ccn: + 0 + + + 0 + 3 + + + + True True True + ● + False + False 1 @@ -511,451 +607,360 @@ - + True - False - 0 - Password + True + True + ● + False + False - 0 + 1 3 - + True True True - False - ● + True + etched-in + + + True + True + word + + - 1 - 3 + 0 + 8 + 2 - - - 1 - - - - - True - False - Server - - - 1 - False - - - - - False - True - 1 - - - - - - button6 - button7 - - - - - - - - - - - - - - False - 5 - Esporta CSV - normal - - - True - False - vertical - 2 - - - True - False - end - - - gtk-cancel - True - True - True - True - - - False - False - 0 - - - - - gtk-save - True - True - True - True - - - False - False - 1 - - - - - False - True - end - 0 - - - - - True - False - vertical - - - True - False - + True - False - 0 + True + True + True - + True False - 5 - 5 - 5 - 5 + True + True + 5 - + True - False - vertical - 5 + True + etched-in - + True True - etched-in - - - True - True - lstore_treemodel_campi - False - 0 - - - - - - - - - 0 - - - - - - - Campo - - - - 2 - - - - - - - - - True - True - 0 - - - - - True - False - 5 - end - - - Deseleziona tutti - True - True - True - - - False - False - 0 - - - - - Seleziona tutti - True - True - True - - - False - False - 1 - - + 5 + multiple + lstore_mail_attachments + 5 + 5 + True - - False - True - 1 - + + True + True + 0 + - - - - - True - False - <b>Seleziona i campi</b> - True - - - - - True - True - 0 - - - - - True - False - 0 - - - True - False - 12 - + True False - 5 - 5 - - - True - False - 0 - Quotatura - - - 0 - 0 - - - - - True - True - ● - " - False - False - - - 1 - 0 - - - - - True - False - 0 - Quotare tutto - - - 0 - 1 - - - - - True - True - False - 0 - True - - - 1 - 1 - - - - - True - False - 0 - Separatore - - - 0 - 2 - - + vertical + 5 + start - + + gtk-add True True - ● - , - False - False - - - 1 - 2 - - - - - True - False - 0 - Nomi dei campi come prima riga + True + True - 0 - 3 + False + False + 0 - + + gtk-remove True + False True - False - 0 - True + True + True - 1 - 3 + False + False + 1 + + False + True + 1 + - + True False - <b>Opzioni di esportazione</b> - True + Allegati - True - True - 1 + 0 + 9 + 2 + + + + + True + False + True + 5 + + + True + False + Richiedere ricevuta di ritorno + 0 + + + False + True + 0 + + + + + True + True + False + 0 + True + + + True + True + 1 + + + + + 0 + 6 + 2 + + + + + True + False + + + 0 + 5 + 2 + + + + + True + False + + + 0 + 7 + 2 + + + + True + False + Mail + - False - True - 1 + False - + True False - 0 + 5 + 5 + 5 - + True False - 5 - 5 - 5 - 5 + Server + 0 + + + 0 + 0 + + + + + True + True + True + + + 1 + 0 + + + + + True + False + Metodo di sicurezza + 0 + + + 0 + 1 + + + + + True + False + True + lstore_metodo_sicurezza + 0 + 0 - - True - False - save - False - False - False - + + + 1 + + + 1 + 1 + - - + + True False - <b>Seleziona il file</b> - True + Utente + 0 + + + 0 + 2 + + + + + True + True + True + + + 1 + 2 + + + + + True + False + Password + 0 + + + 0 + 3 + + + + + True + True + True + False + ● + + 1 + 3 + - True - True - 2 + 1 + + + + + True + False + Server + + + 1 + False - True + False True - 2 + 1 - button1 - button2 + button6 + button7 + + + + + + + + + + False Allegato - Gestione mezzi @@ -967,14 +972,16 @@ True False + True + True 5 5 True False - 0 Percorso + 0 0 @@ -1053,8 +1060,8 @@ True False - 0 Data + 0 0 @@ -1065,6 +1072,7 @@ True True + True False ● False @@ -1079,8 +1087,8 @@ True False - 0 Dimensione + 0 0 @@ -1120,8 +1128,8 @@ True False True - 0 Salva nel database + 0 0 @@ -1131,6 +1139,7 @@ True + True False • False diff --git a/src/allegato.c b/src/allegato.c index fe8af78..b486250 100644 --- a/src/allegato.c +++ b/src/allegato.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015 Andrea Zagli + * Copyright (C) 2010-2016 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -373,6 +373,54 @@ solipa_allegato_add_to_gtkform (SolipaAllegato *solipa_allegato, GtkForm *form, } } +void +solipa_allegato_add_to_zakform (SolipaAllegato *solipa_allegato, + ZakFormGtkForm *form, + const gchar *percorso_field, + const gchar *data_field, + const gchar *dimensione_field) +{ + SolipaAllegatoPrivate *priv; + + ZakFormElement *element; + ZakFormElementValidator *validator; + GtkFormField *ftext; + GtkFormField *fdatetime; + GtkFormField *fint; + + g_return_if_fail (IS_SOLIPA_ALLEGATO (solipa_allegato)); + g_return_if_fail (IS_GTK_FORM (form)); + g_return_if_fail (percorso_field != NULL); + + priv = SOLIPA_ALLEGATO_GET_PRIVATE (solipa_allegato); + + element = zak_form_gtk_form_element_entry_new (); + zak_form_gtk_form_element_set_widget_from_gtkbuilder (ZAK_FORM_GTK_FORM_ELEMENT (element), priv->gtkbuilder, "entry42"); + zak_form_gtk_form_element_set_label (ZAK_FORM_GTK_FORM_ELEMENT (element), gtk_builder_get_object (priv->gtkbuilder, "label139")); + zak_form_element_set_name (element, percorso_field); + validator = zak_form_element_validator_notempty_new (); + zak_form_element_add_validator (element, validator); + + if (data_field != NULL) + { + element = zak_form_gtk_form_element_entry_new (); + zak_form_gtk_form_element_set_widget_from_gtkbuilder (element, priv->gtkbuilder, "entry44"); + zak_form_gtk_form_element_set_label (ZAK_FORM_GTK_FORM_ELEMENT (element), gtk_builder_get_object (priv->gtkbuilder, "label141")); + zak_form_element_set_name (element, data_field); + validator = zak_form_element_validator_date_new (); + zak_form_element_validator_date_set_format (ZAK_FORM_ELEMENT_VALIDATOR_DATE (validator), "%d/%m/%Y %H.%M.%S"); + zak_form_element_add_validator (element, validator); + } + + if (dimensione_field != NULL) + { + element = zak_form_gtk_form_element_entry_new (); + zak_form_gtk_form_element_set_widget_from_gtkbuilder (element, priv->gtkbuilder, "entry8"); + zak_form_gtk_form_element_set_label (ZAK_FORM_GTK_FORM_ELEMENT (element), gtk_builder_get_object (priv->gtkbuilder, "label142")); + zak_form_element_set_name (element, dimensione_field); + } +} + /* PRIVATE */ static void solipa_allegato_set_property (GObject *object, diff --git a/src/allegato.h b/src/allegato.h index f9ba902..84e66bf 100644 --- a/src/allegato.h +++ b/src/allegato.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015 Andrea Zagli + * Copyright (C) 2010-2016 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,11 +19,19 @@ #ifndef __SOLIPA_ALLEGATO_H__ #define __SOLIPA_ALLEGATO_H__ + +#ifdef HAVE_CONFIG_H + #include +#endif + + #include #include #include #include +#include + #include "solipa.h" @@ -78,6 +86,12 @@ void solipa_allegato_add_to_gtkform (SolipaAllegato *solipa_allegato, GtkForm *f const gchar *data_field, const gchar *dimensione_field); +void solipa_allegato_add_to_zakformgtk (SolipaAllegato *solipa_allegato, + ZakFormGtkForm *form, + const gchar *percorso_field, + const gchar *data_field, + const gchar *dimensione_field); + void solipa_allegato_apri_allegato (GtkWindow *transient, const gchar *filename); G_DEPRECATED_FOR (gdaex_save_file_in_blob) -- 2.49.0