X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fgnome%2Fmodest-account-assistant.c;h=36d670ae1320d8334f010a5b41e019563f7be7a5;hb=74e08db4fa22d92bdd87f31bde34b076248ece1e;hp=02834ed52b5eb4c3c8c9d6c47e8d6f99115692f2;hpb=bb718435aa49c50a6eb73fa0a77f1a13900cd5bc;p=modest diff --git a/src/gnome/modest-account-assistant.c b/src/gnome/modest-account-assistant.c index 02834ed..36d670a 100644 --- a/src/gnome/modest-account-assistant.c +++ b/src/gnome/modest-account-assistant.c @@ -59,15 +59,21 @@ struct _ModestAccountAssistantPrivate { GtkWidget *account_name; GtkWidget *fullname; GtkWidget *email; + + GtkWidget *username; + GtkWidget *password; + GtkWidget *store_server_widget; + GtkWidget *store_protocol_combo; + GtkWidget *store_security_combo; + GtkWidget *store_secure_auth; - GtkWidget *store_widget; GtkWidget *transport_widget; GtkWidget *transport_holder; - GtkWidget *store_holder; ModestPairList *receiving_transport_store_protos; ModestPairList *sending_transport_store_protos; + ModestPairList *security_protos; }; #define MODEST_ACCOUNT_ASSISTANT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ @@ -129,18 +135,20 @@ add_intro_page (ModestAccountAssistant *assistant) { GtkWidget *page, *label; - page = gtk_vbox_new (FALSE, 6); + page = gtk_vbox_new (FALSE, 12); - label = gtk_label_new ( - _("Welcome to the account assistant\n\n" - "It will help to set up a new e-mail account\n")); - gtk_box_pack_start (GTK_BOX(page), label, FALSE, FALSE, 6); + label = gtk_label_new (_("mcen_ia_emailsetup_intro")); + gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5); + gtk_misc_set_padding (GTK_MISC (label), 12, 12); + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); + gtk_box_pack_start (GTK_BOX(page), label, FALSE, FALSE, 0); + gtk_widget_set_size_request (label, 400, -1); gtk_widget_show_all (page); gtk_assistant_append_page (GTK_ASSISTANT(assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT(assistant), page, - _("Modest Account Assistant")); + _("mcen_ti_emailsetup_welcome")); gtk_assistant_set_page_type (GTK_ASSISTANT(assistant), page, GTK_ASSISTANT_PAGE_INTRO); gtk_assistant_set_page_complete (GTK_ASSISTANT(assistant), @@ -180,58 +188,151 @@ identity_page_update_completeness (GtkEditable *editable, /* FIXME: regexp check for email address */ txt = gtk_entry_get_text (GTK_ENTRY(priv->email)); - if (!modest_text_utils_validate_email_address (txt)) + if (!modest_text_utils_validate_email_address (txt, NULL)) { + set_current_page_complete (self, FALSE); + return; + } + + txt = gtk_entry_get_text (GTK_ENTRY(priv->username)); + if (!txt || txt[0] == '\0') { set_current_page_complete (self, FALSE); - else - set_current_page_complete (self, TRUE); + return; + } + set_current_page_complete (self, TRUE); } +static GtkWidget * +field_name_label (const gchar *text) +{ + GtkWidget *label; + gchar *fixed_text; + + fixed_text = g_strconcat (text, ":", NULL); + label = gtk_label_new (fixed_text); + g_free (fixed_text); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + + return label; +} static void add_identity_page (ModestAccountAssistant *self) { - GtkWidget *page, *label, *table; + GtkWidget *page, *label, *table, *frame; + GtkWidget *alignment; ModestAccountAssistantPrivate *priv; priv = MODEST_ACCOUNT_ASSISTANT_GET_PRIVATE(self); - priv->fullname = gtk_entry_new_with_max_length (40); - priv->email = gtk_entry_new_with_max_length (40); + priv->account_name = gtk_entry_new (); + gtk_entry_set_max_length (GTK_ENTRY (priv->fullname), 40); + priv->fullname = gtk_entry_new (); + gtk_entry_set_max_length (GTK_ENTRY (priv->fullname), 40); + priv->email = gtk_entry_new (); + gtk_entry_set_width_chars (GTK_ENTRY (priv->email), 40); + priv->username = gtk_entry_new (); + gtk_entry_set_width_chars (GTK_ENTRY (priv->username), 40); + priv->password = gtk_entry_new (); + gtk_entry_set_width_chars (GTK_ENTRY (priv->password), 40); + gtk_entry_set_visibility (GTK_ENTRY (priv->password), FALSE); - page = gtk_vbox_new (FALSE, 6); + page = gtk_vbox_new (FALSE, 24); label = gtk_label_new ( - _("Please enter your name and your e-mail address below.\n\n")); - gtk_box_pack_start (GTK_BOX(page), label, FALSE, FALSE, 6); - + _("Please enter below the name for the account you're creating.")); + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); + alignment = gtk_alignment_new (0.0, 0.0, 1.0, 0.0); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 12, 0, 12, 12); + gtk_container_add (GTK_CONTAINER (alignment), label); + gtk_box_pack_start (GTK_BOX(page), alignment, FALSE, FALSE, 0); + + table = gtk_table_new (1,2, FALSE); + gtk_table_set_col_spacings (GTK_TABLE (table), 6); + gtk_table_set_row_spacings (GTK_TABLE (table), 1); + gtk_table_attach_defaults (GTK_TABLE(table),field_name_label (_("Account name")), + 0,1,0,1); + gtk_table_attach_defaults (GTK_TABLE(table),priv->account_name, + 1,2,0,1); + alignment = gtk_alignment_new (0.0, 0.0, 1.0, 0.0); + gtk_container_add (GTK_CONTAINER (alignment), table); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 12, 0, 12, 0); + gtk_box_pack_start (GTK_BOX(page), alignment, FALSE, FALSE, 0); + + frame = gtk_frame_new (NULL); + label = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (label), _("Public information ")); + gtk_frame_set_label_widget (GTK_FRAME (frame), label); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE); table = gtk_table_new (2,2, FALSE); - gtk_table_attach_defaults (GTK_TABLE(table),gtk_label_new (_("Full name")), + gtk_table_set_col_spacings (GTK_TABLE (table), 6); + gtk_table_set_row_spacings (GTK_TABLE (table), 3); + gtk_table_attach_defaults (GTK_TABLE(table),field_name_label (_("Full name")), 0,1,0,1); - gtk_table_attach_defaults (GTK_TABLE(table),gtk_label_new (_("E-mail address")), + gtk_table_attach_defaults (GTK_TABLE(table),field_name_label (_("Email address")), 0,1,1,2); gtk_table_attach_defaults (GTK_TABLE(table),priv->fullname, 1,2,0,1); gtk_table_attach_defaults (GTK_TABLE(table),priv->email, 1,2,1,2); + alignment = gtk_alignment_new (0.0, 0.0, 1.0, 0.0); + gtk_container_add (GTK_CONTAINER (alignment), table); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0); + gtk_container_add (GTK_CONTAINER (frame), alignment); + gtk_box_pack_start (GTK_BOX(page), frame, FALSE, FALSE, 0); + + + frame = gtk_frame_new (NULL); + label = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (label), _("Server account ")); + gtk_frame_set_label_widget (GTK_FRAME (frame), label); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE); + table = gtk_table_new (2,2, FALSE); + gtk_table_set_col_spacings (GTK_TABLE (table), 6); + gtk_table_set_row_spacings (GTK_TABLE (table), 3); + gtk_table_attach_defaults (GTK_TABLE(table),field_name_label (_("User name")), + 0,1,0,1); + gtk_table_attach_defaults (GTK_TABLE(table),field_name_label (_("Password")), + 0,1,1,2); + gtk_table_attach_defaults (GTK_TABLE(table),priv->username, + 1,2,0,1); + gtk_table_attach_defaults (GTK_TABLE(table),priv->password, + 1,2,1,2); + alignment = gtk_alignment_new (0.0, 0.0, 1.0, 0.0); + gtk_container_add (GTK_CONTAINER (alignment), table); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0); + gtk_container_add (GTK_CONTAINER (frame), alignment); + gtk_box_pack_start (GTK_BOX(page), frame, FALSE, FALSE, 0); g_signal_connect (G_OBJECT(priv->fullname), "changed", G_CALLBACK(identity_page_update_completeness), self); + g_signal_connect (G_OBJECT(priv->username), "changed", + G_CALLBACK(identity_page_update_completeness), + self); + g_signal_connect (G_OBJECT(priv->password), "changed", + G_CALLBACK(identity_page_update_completeness), + self); g_signal_connect (G_OBJECT(priv->email), "changed", G_CALLBACK(identity_page_update_completeness), self); + g_signal_connect (G_OBJECT(priv->account_name), "changed", + G_CALLBACK(identity_page_update_completeness), + self); - gtk_box_pack_start (GTK_BOX(page), table, FALSE, FALSE, 6); - gtk_widget_show_all (page); - gtk_assistant_append_page (GTK_ASSISTANT(self), page); + alignment = gtk_alignment_new (0.0, 0.0, 1.0, 1.0); + gtk_container_add (GTK_CONTAINER (alignment), page); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 12, 12, 12, 12); + gtk_widget_show_all (alignment); + gtk_assistant_append_page (GTK_ASSISTANT(self), alignment); - gtk_assistant_set_page_title (GTK_ASSISTANT(self), page, + gtk_assistant_set_page_title (GTK_ASSISTANT(self), alignment, _("Identity")); - gtk_assistant_set_page_type (GTK_ASSISTANT(self), page, - GTK_ASSISTANT_PAGE_INTRO); + gtk_assistant_set_page_type (GTK_ASSISTANT(self), alignment, + GTK_ASSISTANT_PAGE_CONTENT); gtk_assistant_set_page_complete (GTK_ASSISTANT(self), - page, FALSE); + alignment, FALSE); } @@ -244,13 +345,7 @@ receiving_page_update_completeness (GtkEditable *editable, priv = MODEST_ACCOUNT_ASSISTANT_GET_PRIVATE(self); - txt = modest_store_widget_get_username (MODEST_STORE_WIDGET (priv->store_widget)); - if (!txt || strlen(txt) == 0) { - set_current_page_complete (self, FALSE); - return; - } - - txt = modest_store_widget_get_servername (MODEST_STORE_WIDGET (priv->store_widget)); + txt = gtk_entry_get_text (GTK_ENTRY (priv->store_server_widget)); if (!txt || strlen(txt) == 0) { set_current_page_complete (self, FALSE); return; @@ -259,85 +354,104 @@ receiving_page_update_completeness (GtkEditable *editable, } static void -on_receiving_combo_box_changed (GtkComboBox *combo, ModestAccountAssistant *self) -{ - ModestAccountAssistantPrivate *priv; - gchar *chosen; - ModestTransportStoreProtocol proto; - - priv = MODEST_ACCOUNT_ASSISTANT_GET_PRIVATE(self); - chosen = gtk_combo_box_get_active_text (GTK_COMBO_BOX(combo)); - if (priv->store_widget) - gtk_container_remove (GTK_CONTAINER(priv->store_holder), - priv->store_widget); - - proto = modest_protocol_info_get_transport_store_protocol (chosen); - - /* FIXME: we could have these widgets cached instead of - creating them every time */ - priv->store_widget = modest_store_widget_new (proto); - if (proto == MODEST_PROTOCOL_STORE_POP || proto == MODEST_PROTOCOL_STORE_IMAP) { - g_signal_connect (priv->store_widget, - "data_changed", - G_CALLBACK (receiving_page_update_completeness), - self); - set_current_page_complete (self, FALSE); - } else - set_current_page_complete (self, TRUE); - - gtk_container_add (GTK_CONTAINER(priv->store_holder), - priv->store_widget); - - gtk_widget_show_all (priv->store_holder); - -} - -static void add_receiving_page (ModestAccountAssistant *self) { - GtkWidget *page, *box, *combo; + GtkWidget *page, *vbox; + GtkWidget *table, *frame; + GtkWidget *alignment; ModestAccountAssistantPrivate *priv; + GtkWidget *label; - priv = MODEST_ACCOUNT_ASSISTANT_GET_PRIVATE(self); - page = gtk_vbox_new (FALSE, 6); - - gtk_box_pack_start (GTK_BOX(page), - gtk_label_new ( - _("Please select among the following options")), - FALSE, FALSE, 6); - box = gtk_hbox_new (FALSE, 6); - gtk_box_pack_start (GTK_BOX(box), - gtk_label_new(_("Server type")), - FALSE,FALSE,6); + priv = MODEST_ACCOUNT_ASSISTANT_GET_PRIVATE(self); + page = gtk_alignment_new (0.5, 0.0, 1.0, 0.0); + gtk_alignment_set_padding (GTK_ALIGNMENT (page), 12, 12, 12, 12); + vbox = gtk_vbox_new (FALSE, 24); + gtk_container_add (GTK_CONTAINER (page), vbox); + + /* Warning label on top */ + label = gtk_label_new (_("TODO: Note unable to...")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); + gtk_box_pack_start (GTK_BOX(vbox), + label, + FALSE, FALSE, 0); /* Note: This ModestPairList* must exist for as long as the combo * that uses it, because the ModestComboBox uses the ID opaquely, * so it can't know how to manage its memory. */ priv->receiving_transport_store_protos = - modest_protocol_info_get_transport_store_protocol_pair_list (); - combo = modest_combo_box_new (priv->receiving_transport_store_protos, g_str_equal); - - g_signal_connect (G_OBJECT(combo), "changed", - G_CALLBACK(on_receiving_combo_box_changed), self); - - gtk_box_pack_start (GTK_BOX(box), combo, FALSE,FALSE,6); - gtk_box_pack_start (GTK_BOX(page), box, FALSE,FALSE, 6); - - gtk_box_pack_start (GTK_BOX(page), gtk_hseparator_new(), FALSE, FALSE, 0); - - priv->store_holder = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX(page), priv->store_holder, - TRUE, TRUE, 0); - - /* Force the selection */ - on_receiving_combo_box_changed (GTK_COMBO_BOX (combo), self); - + modest_protocol_info_get_supported_store_protocol_pair_list (); + priv->store_protocol_combo = modest_combo_box_new (priv->receiving_transport_store_protos, g_str_equal); + priv->store_server_widget = gtk_entry_new (); + + /* Setup incoming server frame */ + frame = gtk_frame_new (NULL); + label = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (label), _("Incoming server")); + gtk_frame_set_label_widget (GTK_FRAME (frame), label); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE); + table = gtk_table_new (2, 2, FALSE); + gtk_table_set_col_spacings (GTK_TABLE (table), 6); + gtk_table_set_row_spacings (GTK_TABLE (table), 3); + gtk_table_attach (GTK_TABLE (table), field_name_label (_("Account type")), + 0, 1, 0, 1, + GTK_FILL, 0, 0, 0); + alignment = gtk_alignment_new (0.0, 0.5, 1.0, 1.0); + gtk_container_add (GTK_CONTAINER (alignment), priv->store_protocol_combo); + gtk_table_attach (GTK_TABLE (table), alignment, + 1, 2, 0, 1, + GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0); + gtk_table_attach (GTK_TABLE (table), field_name_label (_("Incoming server")), + 0, 1, 1, 2, + GTK_FILL, GTK_FILL, 0, 0); + gtk_table_attach (GTK_TABLE (table), priv->store_server_widget, + 1, 2, 1, 2, + GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0); + gtk_container_add (GTK_CONTAINER (alignment), table); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0); + gtk_container_add (GTK_CONTAINER (frame), alignment); + gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0); + + /* Setup security information widgets */ + priv->security_protos = + modest_protocol_info_get_connection_protocol_pair_list (); + priv->store_security_combo = modest_combo_box_new (priv->security_protos, g_str_equal); + priv->store_secure_auth = gtk_check_button_new (); + + /* Setup security frame */ + frame = gtk_frame_new (NULL); + label = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (label), _("Security options")); + gtk_frame_set_label_widget (GTK_FRAME (frame), label); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE); + table = gtk_table_new (2, 2, FALSE); + gtk_table_set_col_spacings (GTK_TABLE (table), 6); + gtk_table_set_row_spacings (GTK_TABLE (table), 3); + gtk_table_attach (GTK_TABLE (table), field_name_label (_("Secure connection")), + 0, 1, 0, 1, + GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (table), priv->store_security_combo, + 1, 2, 0, 1, + GTK_FILL | GTK_EXPAND, 0, 0, 0); + gtk_table_attach (GTK_TABLE (table), field_name_label (_("Use secure authentication")), + 0, 1, 1, 2, + GTK_FILL, GTK_FILL, 0, 0); + gtk_table_attach_defaults (GTK_TABLE (table), priv->store_secure_auth, + 1, 2, 1, 2); + alignment = gtk_alignment_new (0.0, 0.0, 1.0, 0.0); + gtk_container_add (GTK_CONTAINER (alignment), table); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0); + gtk_container_add (GTK_CONTAINER (frame), alignment); + gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, FALSE, 0); + + /* Setup assistant page */ gtk_assistant_append_page (GTK_ASSISTANT(self), page); gtk_assistant_set_page_title (GTK_ASSISTANT(self), page, _("Receiving mail")); gtk_assistant_set_page_type (GTK_ASSISTANT(self), page, - GTK_ASSISTANT_PAGE_INTRO); + GTK_ASSISTANT_PAGE_CONTENT); gtk_assistant_set_page_complete (GTK_ASSISTANT(self), page, FALSE); gtk_widget_show_all (page); @@ -467,7 +581,7 @@ modest_account_assistant_init (ModestAccountAssistant *obj) priv->account_mgr = NULL; - priv->store_widget = NULL; + priv->store_server_widget = NULL; priv->transport_widget = NULL; } @@ -614,79 +728,74 @@ get_new_server_account_name (ModestAccountMgr* acc_mgr, ModestTransportStoreProt static void on_apply (ModestAccountAssistant *self, gpointer user_data) { - ModestAccountAssistantPrivate *priv; - ModestTransportStoreProtocol proto = MODEST_PROTOCOL_TRANSPORT_STORE_UNKNOWN; - ModestAuthProtocol security = MODEST_PROTOCOL_CONNECTION_NORMAL; - ModestConnectionProtocol auth = MODEST_PROTOCOL_AUTH_NONE; - gchar *store_name, *transport_name; - const gchar *account_name, *username, *servername, *path; - ModestStoreWidget *store; - ModestTransportWidget *transport; - - priv = MODEST_ACCOUNT_ASSISTANT_GET_PRIVATE(self); - - /* create server account -> store */ - store = MODEST_STORE_WIDGET(priv->store_widget); - proto = modest_store_widget_get_proto (store); - username = modest_store_widget_get_username (store); - servername = modest_store_widget_get_servername (store); - path = modest_store_widget_get_path (store); - security = modest_store_widget_get_security (store); - auth = modest_store_widget_get_auth (store); - store_name = get_new_server_account_name (priv->account_mgr, proto,username, servername); - - if (proto == MODEST_PROTOCOL_STORE_MAILDIR || - proto == MODEST_PROTOCOL_STORE_MBOX) { - gchar *uri = get_account_uri (proto, path); - modest_account_mgr_add_server_account_uri (priv->account_mgr, store_name, proto, uri); - g_free (uri); - } else - modest_account_mgr_add_server_account (priv->account_mgr, - store_name, - servername, - 0, /* FIXME: does this mean default?*/ - username, - NULL, - proto, - security, - auth); +/* ModestAccountAssistantPrivate *priv; */ +/* ModestTransportStoreProtocol proto = MODEST_PROTOCOL_TRANSPORT_STORE_UNKNOWN; */ +/* ModestAuthProtocol security = MODEST_PROTOCOL_CONNECTION_NORMAL; */ +/* ModestConnectionProtocol auth = MODEST_PROTOCOL_AUTH_NONE; */ +/* gchar *store_name, *transport_name; */ +/* const gchar *account_name, *username, *servername, *path; */ +/* ModestTransportWidget *transport; */ + +/* priv = MODEST_ACCOUNT_ASSISTANT_GET_PRIVATE(self); */ + +/* /\* create server account -> store *\/ */ +/* store = MODEST_STORE_WIDGET(priv->store_widget); */ +/* proto = modest_store_widget_get_proto (store); */ +/* username = modest_store_widget_get_username (store); */ +/* servername = modest_store_widget_get_servername (store); */ +/* path = modest_store_widget_get_path (store); */ +/* security = modest_store_widget_get_security (store); */ +/* auth = modest_store_widget_get_auth (store); */ +/* store_name = get_new_server_account_name (priv->account_mgr, proto,username, servername); */ + +/* if (proto == MODEST_PROTOCOL_STORE_MAILDIR || */ +/* proto == MODEST_PROTOCOL_STORE_MBOX) { */ +/* gchar *uri = get_account_uri (proto, path); */ +/* modest_account_mgr_add_server_account_uri (priv->account_mgr, store_name, proto, uri); */ +/* g_free (uri); */ +/* } else */ +/* modest_account_mgr_add_server_account (priv->account_mgr, */ +/* store_name, */ +/* servername, */ +/* 0, /\* FIXME: does this mean default?*\/ */ +/* username, */ +/* NULL, */ +/* proto, */ +/* security, */ +/* auth); */ - /* create server account -> transport */ - transport = MODEST_TRANSPORT_WIDGET(priv->transport_widget); - proto = modest_transport_widget_get_proto (transport); - username = NULL; - servername = NULL; - if (proto == MODEST_PROTOCOL_TRANSPORT_SMTP) { - servername = modest_transport_widget_get_servername (transport); - if (modest_transport_widget_get_requires_auth (transport)) - username = modest_transport_widget_get_username (transport); - } - - transport_name = get_new_server_account_name (priv->account_mgr, proto,username, servername); - modest_account_mgr_add_server_account (priv->account_mgr, - transport_name, servername, - 0, /* FIXME: does this mean default?*/ - username, NULL, - proto, security, auth); - - /* create account */ - account_name = get_account_name (self); - modest_account_mgr_add_account (priv->account_mgr, - account_name, - store_name, - transport_name, TRUE); - modest_account_mgr_set_string (priv->account_mgr, - account_name, - MODEST_ACCOUNT_FULLNAME, - get_fullname(self), FALSE); - modest_account_mgr_set_string (priv->account_mgr, - account_name, - MODEST_ACCOUNT_EMAIL, - get_email(self), FALSE); - - /* Frees */ - g_free (store_name); - g_free (transport_name); +/* /\* create server account -> transport *\/ */ +/* transport = MODEST_TRANSPORT_WIDGET(priv->transport_widget); */ +/* proto = modest_transport_widget_get_proto (transport); */ +/* username = NULL; */ +/* servername = NULL; */ +/* if (proto == MODEST_PROTOCOL_TRANSPORT_SMTP) { */ +/* servername = modest_transport_widget_get_servername (transport); */ +/* if (modest_transport_widget_get_requires_auth (transport)) */ +/* username = modest_transport_widget_get_username (transport); */ +/* } */ + +/* transport_name = get_new_server_account_name (priv->account_mgr, proto,username, servername); */ +/* modest_account_mgr_add_server_account (priv->account_mgr, */ +/* transport_name, servername, */ +/* 0, /\* FIXME: does this mean default?*\/ */ +/* username, NULL, */ +/* proto, security, auth); */ + +/* /\* create account *\/ */ +/* account_name = get_account_name (self); */ +/* modest_account_mgr_add_account (priv->account_mgr, */ +/* account_name, */ +/* account_name, */ +/* get_fullname (self), */ +/* get_email (self), */ +/* MODEST_ACCOUNT_RETRIEVE_HEADERS_ONLY, */ +/* store_name, */ +/* transport_name, TRUE); */ + +/* /\* Frees *\/ */ +/* g_free (store_name); */ +/* g_free (transport_name); */ }