[anjal] Make the draft Account editor.
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: svn-commits-list gnome org
- Subject: [anjal] Make the draft Account editor.
- Date: Wed, 29 Apr 2009 13:50:01 -0400 (EDT)
commit e3e4f9da0a99e04d0b230011a37d1082c947276f
Author: Srinivasa Ragavan <sragavan novell com>
Date: Wed Apr 29 23:18:59 2009 +0530
Make the draft Account editor.
---
src/mail-account-view.c | 208 +++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 202 insertions(+), 6 deletions(-)
diff --git a/src/mail-account-view.c b/src/mail-account-view.c
index 8df19b8..60747d2 100644
--- a/src/mail-account-view.c
+++ b/src/mail-account-view.c
@@ -94,15 +94,195 @@ provider_compare (const CamelProvider *p1, const CamelProvider *p2)
}
}
+static GtkWidget *
+create_identity_page (MailAccountView *view)
+{
+ GtkWidget *table, *box, *tmp, *label, *entry;
+
+ table = gtk_table_new (4,2, FALSE);
+ gtk_table_set_row_spacings (table, 12);
+ label = gtk_label_new (_("Name:"));
+ entry = gtk_entry_new ();
+ gtk_widget_show(entry);
+ gtk_widget_show (label);
+ gtk_table_attach (table, label, 0, 1, 0, 1, GTK_SHRINK, GTK_SHRINK, 10, 3);
+ gtk_table_attach (table, entry, 1, 2, 0, 1, GTK_EXPAND|GTK_FILL, GTK_SHRINK, 10, 3);
+
+ label = gtk_label_new (_("Email:"));
+ gtk_widget_show (label);
+ entry = gtk_entry_new ();
+ gtk_widget_show(entry);
+ gtk_table_attach (table, label, 0, 1, 1, 2, GTK_SHRINK, GTK_SHRINK, 10, 3);
+ gtk_table_attach (table, entry, 1, 2, 1, 2, GTK_EXPAND|GTK_FILL, GTK_SHRINK, 10, 3);
+
+ label = gtk_label_new (_("Reply-to:"));
+ gtk_widget_show (label);
+ entry = gtk_entry_new ();
+ gtk_widget_show(entry);
+ gtk_table_attach (table, label, 0, 1, 2, 3, GTK_SHRINK, GTK_SHRINK, 10, 3);
+ gtk_table_attach (table, entry, 1, 2, 2, 3, GTK_EXPAND|GTK_FILL, GTK_SHRINK, 10, 3);
+
+ label = gtk_label_new (_("Organization:"));
+ gtk_widget_show (label);
+ entry = gtk_entry_new ();
+ gtk_widget_show(entry);
+ gtk_table_attach (table, label, 0, 1, 3, 4, GTK_SHRINK, GTK_SHRINK, 10, 3);
+ gtk_table_attach (table, entry, 1, 2, 3, 4, GTK_EXPAND|GTK_FILL, GTK_SHRINK, 10, 3);
+ gtk_widget_show(table);
+
+ return table;
+}
+
+static GtkWidget *
+create_receive_page (MailAccountView *view)
+{
+ GtkWidget *table, *box, *tmp, *label, *entry;
+
+ table = gtk_table_new (6,2, FALSE);
+ gtk_table_set_row_spacings (table, 12);
+
+ label = gtk_label_new (_("Email:"));
+ entry = gtk_entry_new ();
+ gtk_widget_show(entry);
+ gtk_widget_show (label);
+ gtk_table_attach (table, label, 0, 1, 0, 1, GTK_SHRINK, GTK_SHRINK, 10, 3);
+ gtk_table_attach (table, entry, 1, 2, 0, 1, GTK_EXPAND|GTK_FILL, GTK_SHRINK, 10, 3);
+
+ label = gtk_label_new (_("Server type:"));
+ gtk_widget_show (label);
+ entry = gtk_combo_box_new_text ();
+ gtk_combo_box_append_text (entry, _("IMAP"));
+ gtk_combo_box_append_text (entry, _("POP"));
+ gtk_combo_box_set_active (entry, 0);
+
+ gtk_widget_show(entry);
+ gtk_table_attach (table, label, 0, 1, 1, 2, GTK_SHRINK, GTK_SHRINK, 10, 3);
+ gtk_table_attach (table, entry, 1, 2, 1, 2, GTK_EXPAND|GTK_FILL, GTK_SHRINK, 10, 3);
+
+ label = gtk_label_new (_("Server address:"));
+ gtk_widget_show (label);
+ entry = gtk_entry_new ();
+ gtk_widget_show(entry);
+ gtk_table_attach (table, label, 0, 1, 2, 3, GTK_SHRINK, GTK_SHRINK, 10, 3);
+ gtk_table_attach (table, entry, 1, 2, 2, 3, GTK_EXPAND|GTK_FILL, GTK_SHRINK, 10, 3);
+
+ label = gtk_label_new (_("Username:"));
+ gtk_widget_show (label);
+ entry = gtk_entry_new ();
+ gtk_widget_show(entry);
+ gtk_table_attach (table, label, 0, 1, 3, 4, GTK_SHRINK, GTK_SHRINK, 10, 3);
+ gtk_table_attach (table, entry, 1, 2, 3, 4, GTK_EXPAND|GTK_FILL, GTK_SHRINK, 10, 3);
+
+ label = gtk_label_new (_("Use encryption:"));
+ gtk_widget_show (label);
+ box = gtk_hbox_new (FALSE, 0);
+ entry = gtk_combo_box_new_text ();
+ gtk_widget_show(entry);
+ gtk_combo_box_append_text (entry, _("SSL"));
+ gtk_combo_box_append_text (entry, _("TLS"));
+ gtk_combo_box_append_text (entry, _("None"));
+ gtk_combo_box_set_active (entry, 0);
+ gtk_box_pack_start (box, entry, FALSE, FALSE, 0);
+ tmp = gtk_label_new (_("Port:"));
+ gtk_widget_show(tmp);
+ gtk_box_pack_start (box, tmp, FALSE, FALSE, 12);
+ entry = gtk_entry_new ();
+ gtk_entry_set_max_length (entry, 3);
+ gtk_widget_show(entry);
+ gtk_box_pack_start (box, entry, FALSE, FALSE, 0);
+ gtk_widget_show(box);
+ gtk_table_attach (table, label, 0, 1, 4, 5, GTK_SHRINK, GTK_SHRINK, 10, 3);
+ gtk_table_attach (table, box, 1, 2, 4, 5, GTK_EXPAND|GTK_FILL, GTK_SHRINK, 10, 3);
+
+ label = gtk_label_new (_("Password:"));
+ gtk_widget_show (label);
+ entry = gtk_entry_new ();
+ gtk_widget_show(entry);
+ gtk_entry_set_visibility (entry, FALSE);
+ gtk_table_attach (table, label, 0, 1, 5, 6, GTK_SHRINK, GTK_SHRINK, 10, 3);
+ gtk_table_attach (table, entry, 1, 2, 5, 6, GTK_EXPAND|GTK_FILL, GTK_SHRINK, 10, 3);
+
+
+ gtk_widget_show(table);
+
+ return table;
+}
+
+static GtkWidget *
+create_send_page (MailAccountView *view)
+{
+ GtkWidget *table, *box, *tmp, *label, *entry;
+
+ table = gtk_table_new (6,2, FALSE);
+ gtk_table_set_row_spacings (table, 12);
+
+ label = gtk_label_new (_("Server address:"));
+ entry = gtk_entry_new ();
+ gtk_widget_show(entry);
+ gtk_widget_show (label);
+ gtk_table_attach (table, label, 0, 1, 0, 1, GTK_SHRINK, GTK_SHRINK, 10, 3);
+ gtk_table_attach (table, entry, 1, 2, 0, 1, GTK_EXPAND|GTK_FILL, GTK_SHRINK, 10, 3);
+
+ label = gtk_label_new (_("Username:"));
+ gtk_widget_show (label);
+ entry = gtk_entry_new ();
+ gtk_widget_show(entry);
+ gtk_table_attach (table, label, 0, 1, 1, 2, GTK_SHRINK, GTK_SHRINK, 10, 3);
+ gtk_table_attach (table, entry, 1, 2, 1, 2, GTK_EXPAND|GTK_FILL, GTK_SHRINK, 10, 3);
+
+ label = gtk_label_new (_("Use encryption:"));
+ gtk_widget_show (label);
+ box = gtk_hbox_new (FALSE, 0);
+ entry = gtk_combo_box_new_text ();
+ gtk_widget_show(entry);
+ gtk_combo_box_append_text (entry, _("SSL"));
+ gtk_combo_box_append_text (entry, _("TLS"));
+ gtk_combo_box_append_text (entry, _("None"));
+ gtk_combo_box_set_active (entry, 0);
+ gtk_box_pack_start (box, entry, FALSE, FALSE, 0);
+ tmp = gtk_label_new (_("Port:"));
+ gtk_widget_show(tmp);
+ gtk_box_pack_start (box, tmp, FALSE, FALSE, 12);
+ entry = gtk_entry_new ();
+ gtk_entry_set_max_length (entry, 3);
+ gtk_widget_show(entry);
+ gtk_box_pack_start (box, entry, FALSE, FALSE, 0);
+ gtk_widget_show(box);
+ gtk_table_attach (table, label, 0, 1, 2, 3, GTK_SHRINK, GTK_SHRINK, 10, 3);
+ gtk_table_attach (table, box, 1, 2, 2, 3, GTK_EXPAND|GTK_FILL, GTK_SHRINK, 10, 3);
+
+ label = gtk_label_new (_("Password:"));
+ gtk_widget_show (label);
+ entry = gtk_entry_new ();
+ gtk_widget_show(entry);
+ gtk_entry_set_visibility (entry, FALSE);
+ gtk_table_attach (table, label, 0, 1, 3, 4, GTK_SHRINK, GTK_SHRINK, 10, 3);
+ gtk_table_attach (table, entry, 1, 2, 3, 4, GTK_EXPAND|GTK_FILL, GTK_SHRINK, 10, 3);
+
+ gtk_widget_show(table);
+
+ return table;
+}
+
+#define IDENTITY_DETAIL N_("To use the email application you'll need to setup an account. Put your email address and password in below \nand we'll try and work out all the settings. If we can't do it automatically you'll need your server details as well.")
+
+#define RECEIVE_DETAIL N_("Sorry, we can't work out the settings to get your mail automatically. Please enter them below. We've tried \n to make a start with the details you just entered but you may need to change them.")
+
+#define SEND_DETAIL N_("Now we need your settings for sending mail. We've tried to make some guesses but you should check them over to make sure.")
+
+#define REVIEW_DETAIL N_("Time to check things over before we try and connect to the server and bring down your mail.")
struct _page_text {
+ int id;
char *head;
char *next;
char *prev;
+ char *detail;
+ GtkWidget * (*create_page) (MailAccountView *view);
} mail_account_pages[] = {
- { N_("Identity"), N_("Next - Receiving mail"), NULL },
- { N_("Receiving mail"), N_("Next - Sending mail"), N_("Back - Identity")},
- { N_("Sending mail"), N_("Next - Review account"), N_("Back - Receiving mail")},
- { N_("Review account"), N_("Finish"), N_("Back - Sending")},
+ { MAV_IDENTITY_PAGE, N_("Identity"), N_("Next - Receiving mail"), NULL, IDENTITY_DETAIL, create_identity_page },
+ { MAV_RECV_PAGE, N_("Receiving mail"), N_("Next - Sending mail"), N_("Back - Identity"), RECEIVE_DETAIL, create_receive_page},
+ { MAV_SEND_PAGE, N_("Sending mail"), N_("Next - Review account"), N_("Back - Receiving mail"), SEND_DETAIL, create_send_page},
+ { MAV_REVIEW_PAGE, N_("Review account"), N_("Finish"), N_("Back - Sending"), REVIEW_DETAIL, NULL},
};
static void
@@ -140,12 +320,28 @@ mav_construct_page(MailAccountView *view, MAVPageType type)
page->box = gtk_vbox_new (FALSE, 2);
+
+ box = gtk_hbox_new (FALSE, 12);
+ gtk_widget_show(box);
+ gtk_box_pack_start(page->box, box, FALSE, FALSE, 12);
tmp = gtk_label_new (NULL);
- str = g_strdup_printf("<span size=\"x-large\">%s</span>", mail_account_pages[type].head);
+ str = g_strdup_printf("<span size=\"xx-large\" weight=\"heavy\">%s</span>", mail_account_pages[type].head);
gtk_label_set_markup (tmp, str);
g_free(str);
gtk_widget_show (tmp);
- gtk_box_pack_start(page->box, tmp, FALSE, FALSE, 3);
+ gtk_box_pack_start(box, tmp, FALSE, FALSE, 12);
+
+ box = gtk_hbox_new (FALSE, 12);
+ gtk_widget_show(box);
+ gtk_box_pack_start(page->box, box, FALSE, FALSE, 12);
+ tmp = gtk_label_new (mail_account_pages[type].detail);
+ gtk_widget_show(tmp);
+ gtk_box_pack_start(box, tmp, FALSE, FALSE, 12);
+
+ if (mail_account_pages[type].create_page) {
+ tmp = (*mail_account_pages[type].create_page) (view);
+ gtk_box_pack_start (page->box, tmp, FALSE, FALSE, 3);
+ }
if (mail_account_pages[type].prev) {
box = gtk_hbox_new(FALSE, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]