From: Andrea Zagli Date: Mon, 29 Aug 2011 10:12:28 +0000 (+0200) Subject: Aggiunto il parametro smtp server nel test di SolipaMailUI. X-Git-Tag: 0.5.0~36 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=bc90c8bb832c92cdee8f7d01f94915d547e0dd25;p=solipa%2Flibsolipa Aggiunto il parametro smtp server nel test di SolipaMailUI. Test sotto win della compilazione condizionale (closes #38). --- diff --git a/tests/mailui.c b/tests/mailui.c index 8ebe31c..1f03545 100644 --- a/tests/mailui.c +++ b/tests/mailui.c @@ -21,6 +21,8 @@ Solipa *solipa; SolipaMailUI *mailui; +GtkBuilder *builder; + GtkWidget *w; GtkWidget *mailui_w; @@ -34,7 +36,27 @@ on_btn_cancel_clicked (gpointer instance, gpointer user_data) static void on_btn_ok_clicked (gpointer instance, gpointer user_data) { + gchar *smtp; + g_debug ("OK clicked"); + + smtp = (gchar *)gtk_entry_get_text (GTK_ENTRY (gtk_builder_get_object (builder, "entry1"))); + if (smtp == NULL) + { + smtp = g_strdup ("smtp://localhost/"); + } + else + { + if (g_strcmp0 (g_strstrip (smtp), "") == 0) + { + smtp = g_strdup ("smtp://localhost/"); + } + } + + g_object_set (G_OBJECT (mailui), + "smtp-uri", smtp, + NULL); + solipa_mail_ui_send (mailui); } @@ -50,7 +72,6 @@ int main (int argc, char *argv[]) { GError *error; - GtkBuilder *builder; gtk_init (&argc, &argv); @@ -91,16 +112,18 @@ main (int argc, char *argv[]) mailui_w, TRUE, TRUE, 5); + gtk_entry_set_text (GTK_ENTRY (gtk_builder_get_object (builder, "entry1")), "smtp://localhost/"); + g_signal_connect (gtk_builder_get_object (builder, "button1"), "clicked", G_CALLBACK (on_btn_cancel_clicked), NULL); g_signal_connect (gtk_builder_get_object (builder, "button2"), "clicked", G_CALLBACK (on_btn_ok_clicked), NULL); g_object_set (G_OBJECT (mailui), - "smtp-uri", "smtp://mail.comune.scandicci.fi.it/", - "from", "Andrea Zagli ", + "smtp-uri", "smtp://localhost/", + "from", "Andrea Zagli ", "from-editable", FALSE, - "to", "a.zagli@comune.scandicci.fi.it", + "to", "azagli@libero.it", "bcc-visible", FALSE, "subject", "Da SolipaMailUI", "body", "Il body della mail\n" diff --git a/tests/tests.ui b/tests/tests.ui index 47a76e5..52305eb 100644 --- a/tests/tests.ui +++ b/tests/tests.ui @@ -24,6 +24,41 @@ 5 vertical 5 + + + True + 2 + 5 + 5 + + + True + 0 + SMTP server: + + + GTK_FILL + GTK_FILL + + + + + True + True + + + + 1 + 2 + GTK_FILL + + + + + False + 0 + + True @@ -33,7 +68,7 @@ - 0 + 1 @@ -72,7 +107,7 @@ False - 1 + 2