#include <sql-parser/gda-sql-parser.h>
+#include <libgtkform/field.h>
+#include <libgtkform/fielddatetime.h>
+#include <libgtkform/fieldinteger.h>
+#include <libgtkform/fieldtext.h>
+#include <libgtkform/widget.h>
+#include <libgtkform/widgetentry.h>
+
#include "allegato.h"
static void solipa_allegato_class_init (SolipaAllegatoClass *class);
return TRUE;
}
+void solipa_allegato_add_to_gtkform (SolipaAllegato *solipa_allegato, GtkForm *form,
+ const gchar *percorso_field,
+ const gchar *data_field,
+ const gchar *dimensione_field)
+{
+ SolipaAllegatoPrivate *priv;
+
+ GtkFormWidget *wentry;
+ 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);
+
+ wentry = gtk_form_widget_entry_new ();
+ gtk_form_widget_set_from_gtkbuilder (wentry, priv->gtkbuilder, "entry42");
+
+ ftext = gtk_form_field_text_new ();
+ g_object_set (ftext,
+ "field", percorso_field,
+ "obligatory", TRUE,
+ "form-widget", wentry,
+ NULL);
+ gtk_form_add_field (form, ftext);
+
+ if (data_field != NULL)
+ {
+ wentry = gtk_form_widget_entry_new ();
+ gtk_form_widget_set_from_gtkbuilder (wentry, priv->gtkbuilder, "entry44");
+
+ fdatetime = gtk_form_field_datetime_new ();
+ g_object_set (fdatetime,
+ "field", data_field,
+ "form-widget", wentry,
+ "type", GTK_FORM_FIELD_DATETIME_TYPE_DATETIME,
+ "display-format", "%d/%m/%Y %H.%M.%S",
+ NULL);
+ gtk_form_add_field (form, fdatetime);
+ }
+
+ if (dimensione_field != NULL)
+ {
+ wentry = gtk_form_widget_entry_new ();
+ gtk_form_widget_set_from_gtkbuilder (wentry, priv->gtkbuilder, "entry45");
+
+ fint = gtk_form_field_integer_new ();
+ g_object_set (fint,
+ "field", dimensione_field,
+ "form-widget", wentry,
+ NULL);
+ gtk_form_add_field (form, fint);
+ }
+}
+
/* PRIVATE */
static void
solipa_allegato_set_property (GObject *object,
#include <glib-object.h>
#include <libgda/libgda.h>
+#include <libgtkform/form.h>
#include "solipa.h"
guint solipa_allegato_get_dimensione (SolipaAllegato *solipa_allegato);
gboolean solipa_allegato_get_salva_in_db (SolipaAllegato *solipa_allegato);
+void solipa_allegato_add_to_gtkform (SolipaAllegato *solipa_allegato, GtkForm *form,
+ const gchar *percorso_field,
+ const gchar *data_field,
+ const gchar *dimensione_field);
+
void solipa_allegato_apri_allegato (GtkWindow *transient, const gchar *filename);
gboolean solipa_allegato_salva_in_db (GdaConnection *gda_con, const gchar *sql,