<object class="GtkTable" id="table22">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">4</property>
+ <property name="n_rows">5</property>
<property name="n_columns">2</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-open</property>
+ <property name="icon-size">1</property>
</object>
</child>
</object>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry8">
+ <property name="can_focus">True</property>
+ <property name="editable">False</property>
+ <property name="invisible_char">•</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
</object>
</child>
</object>
GValue *value,
GParamSpec *pspec);
+static void solipa_allegato_on_txt_dimensione_nascosto_changed (GtkEditable *editable,
+ gpointer user_data);
+
static void solipa_allegato_on_file_pulisci (GtkEntry *entry,
GtkEntryIconPosition icon_pos,
GdkEvent *event,
GtkWidget *txt_percorso;
GtkWidget *txt_data;
GtkWidget *txt_dimensione;
+ GtkWidget *txt_dimensione_nascosto;
GtkWidget *chk_salva_nel_db;
};
priv->txt_percorso = GTK_WIDGET (gtk_builder_get_object (priv->gtkbuilder, "entry42"));
priv->txt_data = GTK_WIDGET (gtk_builder_get_object (priv->gtkbuilder, "entry44"));
priv->txt_dimensione = GTK_WIDGET (gtk_builder_get_object (priv->gtkbuilder, "entry45"));
+ priv->txt_dimensione_nascosto = GTK_WIDGET (gtk_builder_get_object (priv->gtkbuilder, "entry8"));
priv->chk_salva_nel_db = GTK_WIDGET (gtk_builder_get_object (priv->gtkbuilder, "checkbutton2"));
- g_signal_connect (priv->txt_percorso,
- "icon-press", G_CALLBACK (solipa_allegato_on_file_pulisci), (gpointer *)solipa_allegato);
- g_signal_connect (gtk_builder_get_object (priv->gtkbuilder, "button5"),
- "clicked", G_CALLBACK (solipa_allegato_on_btn_apri_clicked), (gpointer *)solipa_allegato);
- g_signal_connect (gtk_builder_get_object (priv->gtkbuilder, "button144"),
- "clicked", G_CALLBACK (solipa_allegato_on_btn_file_clicked), (gpointer *)solipa_allegato);
+ g_signal_connect (priv->txt_dimensione_nascosto, "changed",
+ G_CALLBACK (solipa_allegato_on_txt_dimensione_nascosto_changed), (gpointer)solipa_allegato);
+
+ g_signal_connect (priv->txt_percorso, "icon-press",
+ G_CALLBACK (solipa_allegato_on_file_pulisci), (gpointer)solipa_allegato);
+ g_signal_connect (gtk_builder_get_object (priv->gtkbuilder, "button5"), "clicked",
+ G_CALLBACK (solipa_allegato_on_btn_apri_clicked), (gpointer)solipa_allegato);
+
+ g_signal_connect (gtk_builder_get_object (priv->gtkbuilder, "button144"), "clicked",
+ G_CALLBACK (solipa_allegato_on_btn_file_clicked), (gpointer)solipa_allegato);
return solipa_allegato;
}
priv = SOLIPA_ALLEGATO_GET_PRIVATE (solipa_allegato);
- return strtol (gtk_entry_get_text (GTK_ENTRY (priv->txt_dimensione)), NULL, 10);
+ return strtol (gtk_entry_get_text (GTK_ENTRY (priv->txt_dimensione_nascosto)), NULL, 10);
}
gboolean
if (dimensione_field != NULL)
{
wentry = gtk_form_widget_entry_new ();
- gtk_form_widget_set_from_gtkbuilder (wentry, priv->gtkbuilder, "entry45");
+ gtk_form_widget_set_from_gtkbuilder (wentry, priv->gtkbuilder, "entry8");
fint = gtk_form_field_integer_new ();
g_object_set (fint,
GParamSpec *pspec)
{
SolipaAllegato *solipa_allegato = (SolipaAllegato *)object;
-
SolipaAllegatoPrivate *priv = SOLIPA_ALLEGATO_GET_PRIVATE (solipa_allegato);
switch (property_id)
GParamSpec *pspec)
{
SolipaAllegato *solipa_allegato = (SolipaAllegato *)object;
-
SolipaAllegatoPrivate *priv = SOLIPA_ALLEGATO_GET_PRIVATE (solipa_allegato);
switch (property_id)
break;
}
}
+
+static void
+solipa_allegato_on_txt_dimensione_nascosto_changed (GtkEditable *editable,
+ gpointer user_data)
+{
+ SolipaAllegato *allegato = (SolipaAllegato *)user_data;
+ SolipaAllegatoPrivate *priv = SOLIPA_ALLEGATO_GET_PRIVATE (allegato);
+
+ gtk_entry_set_text (GTK_ENTRY (priv->txt_dimensione),
+ solipa_format_money (g_strtod (gtk_entry_get_text (GTK_ENTRY (priv->txt_dimensione_nascosto)), NULL), 0, FALSE));
+}
+
static void
solipa_allegato_on_file_pulisci (GtkEntry *entry,
GtkEntryIconPosition icon_pos,
gtk_entry_set_text (GTK_ENTRY (priv->txt_percorso), "");
gtk_entry_set_text (GTK_ENTRY (priv->txt_data), "");
- gtk_entry_set_text (GTK_ENTRY (priv->txt_dimensione), "");
+ gtk_entry_set_text (GTK_ENTRY (priv->txt_dimensione_nascosto), "0");
}
static void
g_strdup_printf ("%02d/%02d/%04d %02d.%02d.%02d",
tm->tm_mday, tm->tm_mon + 1, tm->tm_year + 1900,
tm->tm_hour, tm->tm_min, tm->tm_sec));
- gtk_entry_set_text (GTK_ENTRY (priv->txt_dimensione), solipa_format_money (buf.st_size, 0, FALSE));
+ gtk_entry_set_text (GTK_ENTRY (priv->txt_dimensione_nascosto), g_strdup_printf ("%d", buf.st_size));
}
else
{
gtk_entry_set_text (GTK_ENTRY (priv->txt_percorso), "");
gtk_entry_set_text (GTK_ENTRY (priv->txt_data), "");
- gtk_entry_set_text (GTK_ENTRY (priv->txt_dimensione), "");
+ gtk_entry_set_text (GTK_ENTRY (priv->txt_dimensione_nascosto), "0");
}
g_free (filename);