From 7707245105dca4dfe4c0510bf3d3144d6a077915 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Mon, 14 Nov 2011 18:42:43 +0100 Subject: [PATCH] Iniziato lo sviluppo degli allegati in SolipaMailUI (refs #96). Aggiunti i file di progetto di eclipse. --- .cproject | 62 ++ .project | 288 ++++++++ data/libsolipa/gui/libsolipa.ui | 1101 ++++++++++++++++++------------- src/mailui.c | 68 +- 4 files changed, 1073 insertions(+), 446 deletions(-) create mode 100644 .cproject create mode 100644 .project diff --git a/.cproject b/.cproject new file mode 100644 index 0000000..62d84c1 --- /dev/null +++ b/.cproject @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..1652055 --- /dev/null +++ b/.project @@ -0,0 +1,288 @@ + + + libsolipa + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.buildLocation + ${workspace_loc:/libsolipa/Default} + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + 1321292489312 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-*.o + + + + 1321292489312 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-*.exe + + + + 1321292489312 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-Makefile + + + + 1321292489328 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-Makefile.in + + + + 1321292489328 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-*.lo + + + + 1321292489328 + + 30 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-autom4te.cache + + + + 1321292489328 + + 30 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-m4 + + + + 1321292489328 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-*.la + + + + 1321292489328 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-*.pc + + + + 1321292489328 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-config.h + + + + 1321292489343 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-config.h.in + + + + 1321292489343 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-configure + + + + 1321292489343 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-*.anjuta + + + + 1321292489343 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-missing + + + + 1321292489343 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-stamp-h1 + + + + 1321292489343 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-ltmain.sh + + + + 1321292489343 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-depcomp + + + + 1321292489359 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-aclocal.m4 + + + + 1321292489359 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-config.guess + + + + 1321292489359 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-config.status + + + + 1321292489359 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-config.sub + + + + 1321292489359 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-config.log + + + + 1321292489359 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-install-sh + + + + 1321292489375 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-libtool + + + + diff --git a/data/libsolipa/gui/libsolipa.ui b/data/libsolipa/gui/libsolipa.ui index b74b61d..91ebc06 100644 --- a/data/libsolipa/gui/libsolipa.ui +++ b/data/libsolipa/gui/libsolipa.ui @@ -1,209 +1,454 @@ - + - - Allegato - Gestione mezzi + + False + 5 True - center-on-parent - 480 + 550 + 400 True - - + normal + True + + True - 4 - 2 - 5 - 5 - - + False + 2 + + True - 0 - Percorso + False + end + + + gtk-cancel + False + True + True + True + True + + + False + False + 0 + + + + + gtk-ok + False + True + True + True + True + + + False + False + 1 + + - GTK_FILL - GTK_FILL + False + True + end + 0 - + True - 5 + False + 8 + 2 + 5 + 5 - + + True + False + 0 + Da: + + + GTK_FILL + GTK_FILL + + + + + True + False + 0 + A: + + + 1 + 2 + GTK_FILL + GTK_FILL + + + + True True - False - - gtk-clear - True + ● + False + False + True True - 0 + 1 + 2 + GTK_FILL - + True True - True + ● + False + False + True + True + + + 1 + 2 + 1 + 2 + GTK_FILL + + + + + True + False + 0 + Oggetto: + + + 4 + 5 + GTK_FILL + GTK_FILL + + + + + True + True + ● + False + False + True + True + + + 1 + 2 + 4 + 5 + GTK_FILL + + + + + True + False + + + 2 + 5 + 6 + GTK_FILL + + + + + True + True + automatic + automatic + etched-in - + True - gtk-open + True + word - False - 1 + 2 + 6 + 7 - - ... + + True + False + 0 + Cc: + + + 2 + 3 + GTK_FILL + GTK_FILL + + + + + True + False + 0 + Ccn: + + + 3 + 4 + GTK_FILL + GTK_FILL + + + + True True - True + ● + False + False + True + True - False - 2 + 1 + 2 + 2 + 3 + GTK_FILL + + + + + True + True + ● + False + False + True + True + + + 1 + 2 + 3 + 4 + GTK_FILL + + + + + True + True + + + True + False + 5 + + + True + True + automatic + automatic + etched-in + + + True + True + lstore_mail_attachments + + + + + True + True + 0 + + + + + True + False + 5 + + + gtk-add + False + True + True + True + True + + + False + False + 0 + + + + + gtk-remove + False + True + True + True + True + + + False + False + 1 + + + + + False + True + 1 + + + + + + + True + False + Allegati + + + + + 2 + 7 + 8 - 1 - 2 - GTK_FILL - - - - - True - 0 - Data - - - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - True - False - - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - - True - 0 - Dimensione - - - 2 - 3 - GTK_FILL - GTK_FILL - - - - - True - True - False - - - - 1 - 2 - 2 - 3 - GTK_FILL - - - - - True - True - False - True - 0.52999997138977051 - True - - - 1 - 2 - 3 - 4 - GTK_FILL + True + True + 1 - - + + + + button6 + button7 + + + + + + + + + + + + + + + + + + + + + + + + False + 5 + Esporta CSV + normal + + + True + False + 2 + + True - True - 0 - Salva nel database + False + end + + + gtk-cancel + False + True + True + True + True + + + False + False + 0 + + + + + gtk-save + False + True + True + True + True + + + False + False + 1 + + - 3 - 4 - GTK_FILL - GTK_FILL + False + True + end + 0 - - - - - - - - - - - - - - - 5 - Esporta CSV - normal - - - True - vertical - 2 True - vertical + False 5 True + False True + False 0 True + False 5 5 5 @@ -211,7 +456,7 @@ True - vertical + False 5 @@ -252,17 +497,21 @@ + True + True 0 True + False 5 end Deseleziona tutti + False True True True @@ -276,6 +525,7 @@ Seleziona tutti + False True True True @@ -289,6 +539,7 @@ False + True 1 @@ -299,26 +550,32 @@ True + False <b>Seleziona i campi</b> True + True + True 0 True + False 0 True + False 12 True + False 4 2 5 @@ -326,6 +583,7 @@ True + False 0 Quotatura @@ -338,8 +596,12 @@ True True - + ● " + False + False + True + True 1 @@ -350,6 +612,7 @@ True + False 0 Quotare tutto @@ -362,6 +625,7 @@ + False True True False @@ -378,6 +642,7 @@ True + False 0 Separatore @@ -392,8 +657,12 @@ True True - + ● , + False + False + True + True 1 @@ -406,6 +675,7 @@ True + False 0 Nomi dei campi come prima riga @@ -418,6 +688,7 @@ + False True True False @@ -432,347 +703,281 @@ - - - - - - True - <b>Opzioni di esportazione</b> - True - - - - - 1 - - - - - 0 - - - - - True - 0 - - - True - 5 - 5 - 5 - 5 - - - True - vertical - save - False - False - False - - - - - - - True - <b>Seleziona il file</b> - True - - - - - 1 - - - - - 2 - - - - - True - end - - - gtk-cancel - True - True - True - True - - - False - False - 0 - - - - - gtk-save - True - True - True - True - - - False - False - 1 - - - - - False - end - 0 - - - - - - button1 - button2 - - - - 5 - True - 550 - 400 - True - normal - True - - - True - vertical - 2 - - - True - 7 - 2 - 5 - 5 - - - True - 0 - Da: - - - GTK_FILL - GTK_FILL - - - - - True - 0 - A: - - - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - True - - - - 1 - 2 - GTK_FILL - - - - - True - True - - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - - True - 0 - Oggetto: - - - 4 - 5 - GTK_FILL - GTK_FILL - - - - - True - True - - - - 1 - 2 - 4 - 5 - GTK_FILL - - - - - True - - - 2 - 5 - 6 - GTK_FILL - - - - - True - True - automatic - automatic - etched-in - - - True - True - word + + + + + + True + False + <b>Opzioni di esportazione</b> + True + + + + True + True + 1 + - 2 - 6 - 7 - - - - - True - 0 - Cc: - - - 2 - 3 - GTK_FILL - GTK_FILL - - - - - True - 0 - Ccn: - - - 3 - 4 - GTK_FILL - GTK_FILL + True + True + 0 - + True - True - + False + 0 + + + True + False + 5 + 5 + 5 + 5 + + + True + False + vertical + save + False + False + False + + + + + + + True + False + <b>Seleziona il file</b> + True + + - 1 - 2 - 2 - 3 - GTK_FILL + True + True + 1 + + + True + True + 2 + + + + + + button1 + button2 + + + + False + Allegato - Gestione mezzi + True + center-on-parent + 480 + True + + + True + False + 4 + 2 + 5 + 5 + + + True + False + 0 + Percorso + + + GTK_FILL + GTK_FILL + + + + + True + False + 5 - + True True - + False + ● + gtk-clear + False + True + True + True - 1 - 2 - 3 - 4 - GTK_FILL + True + True + 0 - - - 1 - - - - - True - end - - gtk-cancel + + False True True True - True + + + True + False + gtk-open + + False - False - 0 + True + 1 - - gtk-ok + + ... + False True True True - True False - False - 1 + True + 2 - False - end - 0 + 1 + 2 + GTK_FILL + + + + + True + False + 0 + Data + + + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + True + False + ● + False + False + True + True + + + 1 + 2 + 1 + 2 + GTK_FILL + + + + + True + False + 0 + Dimensione + + + 2 + 3 + GTK_FILL + GTK_FILL + + + + + True + True + False + ● + False + False + True + True + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + False + True + True + False + True + 0.52999997138977051 + True + + + 1 + 2 + 3 + 4 + GTK_FILL + + + + + True + False + True + 0 + Salva nel database + + + 3 + 4 + GTK_FILL + GTK_FILL - - button6 - button7 - + False True center-on-parent 550 @@ -781,35 +986,42 @@ True + False 5 - vertical 5 True + False True label False + True 0 True + False + True + True 1 True + False center gtk-cancel + False True True True @@ -825,6 +1037,7 @@ False + True 2 diff --git a/src/mailui.c b/src/mailui.c index 59cf531..3e04c1c 100644 --- a/src/mailui.c +++ b/src/mailui.c @@ -43,6 +43,13 @@ enum PROP_BODY_EDITABLE }; +enum +{ + COL_ATTACHMENTS_FILE_NAME, + COL_ATTACHMENTS_FILE_NAME_BASE, + COL_ATTACHMENTS_ICON +}; + static void solipa_mail_ui_class_init (SolipaMailUIClass *klass); static void solipa_mail_ui_init (SolipaMailUI *solipa_mail_ui); @@ -55,6 +62,11 @@ static void solipa_mail_ui_get_property (GObject *object, GValue *value, GParamSpec *pspec); +static void solipa_mail_ui_on_btn_attachment_add_clicked (GtkButton *button, + gpointer user_data); +static void solipa_mail_ui_on_btn_attachment_remove_clicked (GtkButton *button, + gpointer user_data); + static void solipa_mail_ui_on_cancel_clicked (GtkButton *button, gpointer user_data); static void solipa_mail_ui_on_ok_clicked (GtkButton *button, @@ -81,6 +93,9 @@ struct _SolipaMailUIPrivate GtkWidget *bcc_lbl; GtkWidget *subject; GtkWidget *body; + GtkWidget *iv_attachments; + + GtkListStore *lstore_attachments; }; G_DEFINE_TYPE (SolipaMailUI, solipa_mail_ui, G_TYPE_OBJECT) @@ -271,7 +286,8 @@ SolipaMailUI error = NULL; gtk_builder_add_objects_from_file (builder, solipa_get_guifile (solipa), - g_strsplit ("diag_mail", + g_strsplit ("lstore_mail_attachments" + "|diag_mail", "|", -1), &error); if (error != NULL) @@ -294,6 +310,16 @@ SolipaMailUI priv->subject = GTK_WIDGET (gtk_builder_get_object (builder, "entry5")); priv->body = GTK_WIDGET (gtk_builder_get_object (builder, "textview1")); + priv->lstore_attachments = GTK_LIST_STORE (gtk_builder_get_object (builder, "lstore_mail_attachments")); + priv->iv_attachments = GTK_WIDGET (gtk_builder_get_object (builder, "iconview1")); + + gtk_icon_view_set_text_column (GTK_ICON_VIEW (priv->iv_attachments), COL_ATTACHMENTS_FILE_NAME); + + g_signal_connect (gtk_builder_get_object (builder, "button9"), "clicked", + G_CALLBACK (solipa_mail_ui_on_btn_attachment_add_clicked), (gpointer)solipa_mail_ui); + g_signal_connect (gtk_builder_get_object (builder, "button10"), "clicked", + G_CALLBACK (solipa_mail_ui_on_btn_attachment_remove_clicked), (gpointer)solipa_mail_ui); + g_signal_connect (gtk_builder_get_object (builder, "button6"), "clicked", G_CALLBACK (solipa_mail_ui_on_cancel_clicked), (gpointer)solipa_mail_ui); g_signal_connect (gtk_builder_get_object (builder, "button7"), "clicked", @@ -682,6 +708,44 @@ solipa_mail_ui_get_property (GObject *object, } /* CALLBACK */ +static void +solipa_mail_ui_on_btn_attachment_add_clicked (GtkButton *button, + gpointer user_data) +{ + SolipaMailUI *solipa_mail_ui = (SolipaMailUI *)user_data; + SolipaMailUIPrivate *priv = SOLIPA_MAIL_UI_GET_PRIVATE (solipa_mail_ui); + + GtkWidget *dialog; + + gchar *filename; + GtkTreeIter iter; + + dialog = gtk_file_chooser_dialog_new ("Choose a file to attach.", + NULL, + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + NULL); + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) + { + filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); + gtk_list_store_append (priv->lstore_attachments, &iter); + gtk_list_store_set (priv->lstore_attachments, &iter, + COL_ATTACHMENTS_FILE_NAME, filename, + -1); + g_free (filename); + } + gtk_widget_destroy (dialog); +} + +static void +solipa_mail_ui_on_btn_attachment_remove_clicked (GtkButton *button, + gpointer user_data) +{ + SolipaMailUI *solipa_mail_ui = (SolipaMailUI *)user_data; + SolipaMailUIPrivate *priv = SOLIPA_MAIL_UI_GET_PRIVATE (solipa_mail_ui); +} + static void solipa_mail_ui_on_cancel_clicked (GtkButton *button, gpointer user_data) @@ -721,4 +785,4 @@ solipa_mail_ui_on_ok_clicked (GtkButton *button, /* send email */ solipa_mail_ui_send (solipa_mail_ui); } -} \ No newline at end of file +} -- 2.49.0