From 6cb6ec0a3bb1e500af39285eb9ca0462466de0bc Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Thu, 17 Nov 2011 08:41:31 +0100 Subject: [PATCH] Adattamento per nuovi controlli di libgtkform. --- .anjuta_sym_db.db | Bin 983040 -> 983040 bytes data/libsolipa/gui/libsolipa.ui | 23 +++++++++++++++- src/allegato.c | 45 +++++++++++++++++++++++--------- 3 files changed, 54 insertions(+), 14 deletions(-) diff --git a/.anjuta_sym_db.db b/.anjuta_sym_db.db index 3dbbcb5d8f48a1530b4ba1fbb7d22c95650bc750..1dba8fde0d6281cba3fb69748a36d8e200f6b75e 100644 GIT binary patch delta 5812 zcmbVQ3s98T6~5=+y}Jwk{}0H+psp;)0zOa>1RuO{K?EemPGbUbSzuKJc6qFc))jW8 zscptKn%3MVaYk)SWAkLqW1EMGPMw&vHnE-B*0x3z6B`LHYcgq*&i35>VIjI`Qf8L3 zd+#~tp4UC+`+t`!$K}e|GXpN}ommVQ-LlSYP+xn-s zzf^f-!}^vzEYnSMt9Gn^=dLuz3ELx%Cu|oh>s#~fzuZz+ajspk*R=i3o?-85PpmlF zX0@$o^Vmb|XSO_4scN0tHmlNP|7^?il_{+wEpJsk*z##xj%|8-b;VlmQ8#@I!q&AE zRPJioy!G>~S6WsS}AUHk>!HWVQ)^S)$GIojfr(^b(n1y^uEJkH`i~n*fv@l zwD2Yjv#=35SCs`rtZRrSYL3Cc99qt0BALEl45M1|B7Dlu4ABJRlh8ktW&m)-jja~5 zrMcO<(SrJH)(5nk;HsW324H7;#TZo$e8SR(X?)^rvd2J|qYO8op|Qnk>u9vwtN~lJ ztKgFN$nWX7Sjh42yh2~6U9D+EJ&n$}Nk&^nUX7sov2}~XqFqT|iKfQUl~!wey}iA| zt}P`mhtXJEeW0;nqt&4`k(VNAJpSJ3XsX-N*xX=k*A|nbv2-5zgT#Glv~94P>n!a$ z4SQpNrm6**^su)EsGc3nqoPg=XUU7Bfr()SeWFOUaEiRZgEoV?MyO5=&ywf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W|w8vXZB@I&L~aqO^=`RMp{K$QtHFhv#GDEnOF|Ou$qxWxW(>i z0qRSP{Oc%&{1LwWUY_$rY!6C7ct*^(XiEUXix|9|KHjE9nEnJ`SD-I8ZQhkyH=p=p_}zRt5R&$Y66|R<8U*(7W26O8 z@6VDYth;=?fIiw@JO8JMzrI&HTP|1e4A~@5+0PDYGID5bbl=rt!`Oo_z6vTS)Gw-BROpvy{vBa__o zsFF5WO&J=Y{RjM5yUiQ3icWSXQ!Cnd|Ho>q1?Os(6)|#n@OTit7iW)!h??u3LqnK- zAt=&B|LM<}nq6`yCbOUOy2>d0x}hQs}C``!>NLj$6FRf v8dE1wx)yI$0kNpuBElI}p+tU|$QLg_JJQpFRKX=D({6;*)U=cG>8yVPmn95B diff --git a/data/libsolipa/gui/libsolipa.ui b/data/libsolipa/gui/libsolipa.ui index c3a3070..ba25b77 100644 --- a/data/libsolipa/gui/libsolipa.ui +++ b/data/libsolipa/gui/libsolipa.ui @@ -796,7 +796,7 @@ True False - 4 + 5 2 5 5 @@ -846,6 +846,7 @@ True False gtk-open + 1 @@ -975,6 +976,26 @@ GTK_FILL + + + + + + True + False + • + False + False + True + True + + + 4 + 5 + GTK_FILL + GTK_FILL + + diff --git a/src/allegato.c b/src/allegato.c index 52f1fbe..2dd1170 100644 --- a/src/allegato.c +++ b/src/allegato.c @@ -44,6 +44,9 @@ static void solipa_allegato_get_property (GObject *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, @@ -68,6 +71,7 @@ struct _SolipaAllegatoPrivate GtkWidget *txt_percorso; GtkWidget *txt_data; GtkWidget *txt_dimensione; + GtkWidget *txt_dimensione_nascosto; GtkWidget *chk_salva_nel_db; }; @@ -138,14 +142,19 @@ SolipaAllegato 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; } @@ -209,7 +218,7 @@ solipa_allegato_get_dimensione (SolipaAllegato *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 @@ -385,7 +394,7 @@ void solipa_allegato_add_to_gtkform (SolipaAllegato *solipa_allegato, GtkForm *f 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, @@ -404,7 +413,6 @@ solipa_allegato_set_property (GObject *object, GParamSpec *pspec) { SolipaAllegato *solipa_allegato = (SolipaAllegato *)object; - SolipaAllegatoPrivate *priv = SOLIPA_ALLEGATO_GET_PRIVATE (solipa_allegato); switch (property_id) @@ -422,7 +430,6 @@ solipa_allegato_get_property (GObject *object, GParamSpec *pspec) { SolipaAllegato *solipa_allegato = (SolipaAllegato *)object; - SolipaAllegatoPrivate *priv = SOLIPA_ALLEGATO_GET_PRIVATE (solipa_allegato); switch (property_id) @@ -432,6 +439,18 @@ solipa_allegato_get_property (GObject *object, 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, @@ -443,7 +462,7 @@ solipa_allegato_on_file_pulisci (GtkEntry *entry, 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 @@ -479,7 +498,7 @@ solipa_allegato_on_btn_file_clicked (GtkButton *button, 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 { @@ -495,7 +514,7 @@ solipa_allegato_on_btn_file_clicked (GtkButton *button, 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); -- 2.49.0