* docs/reference/modest-design.sgml: Corrected spelling mistake.
* src/maemo/easysetup/modest-easysetup-wizard.c: (create_account):
Create the 2 server accounts and then create the account, using the names of the 2 server accounts.
This seems to be how this should be used. If it is, then I will update the AccountMgr documentation
to make that clearer.
* src/modest-account-mgr.h: Corrected the modest_account_mgr_search_server_account() documentation.
pmo-trunk-r1516
2007-04-05 Murray Cumming <murrayc@murrayc.com>
2007-04-05 Murray Cumming <murrayc@murrayc.com>
+ * docs/reference/modest-design.sgml: Corrected spelling mistake.
+ * src/maemo/easysetup/modest-easysetup-wizard.c: (create_account):
+ Create the 2 server accounts and then create the account, using the names of the 2 server accounts.
+ This seems to be how this should be used. If it is, then I will update the AccountMgr documentation
+ to make that clearer.
+ * src/modest-account-mgr.h: Corrected the modest_account_mgr_search_server_account() documentation.
+
+2007-04-05 Murray Cumming <murrayc@murrayc.com>
+
* src/maemo/modest-account-view-window.c:
(modest_account_view_window_init),
(modest_account_view_window_new):
* src/maemo/modest-account-view-window.c:
(modest_account_view_window_init),
(modest_account_view_window_new):
used by other accounts as well.
</para>
used by other accounts as well.
</para>
- <para>The reason two keep accounts and server accounts separately, is a bit of
+ <para>The reason to keep accounts and server accounts separately, is a bit of
flexibility. In mobile use-cases, quite often it's desirable to use a
network-specific smtp-server. The chosen structure makes it easy to iterate
over all smtp-servers and find the right one.
flexibility. In mobile use-cases, quite often it's desirable to use a
network-specific smtp-server. The chosen structure makes it easy to iterate
over all smtp-servers and find the right one.
recipient (<command>RCPT TO:</command>) is on the same network.
</para>
</chapter>
recipient (<command>RCPT TO:</command>) is on the same network.
</para>
</chapter>
- </part>
\ No newline at end of file
* but let's check again just in case:
*/
if (modest_account_mgr_account_exists (self->account_manager, account_name, FALSE))
* but let's check again just in case:
*/
if (modest_account_mgr_account_exists (self->account_manager, account_name, FALSE))
/* username and password (for both incoming and outgoing): */
const gchar* username = gtk_entry_get_text (GTK_ENTRY (self->entry_user_username));
/* username and password (for both incoming and outgoing): */
const gchar* username = gtk_entry_get_text (GTK_ENTRY (self->entry_user_username));
+ /* First we add the 2 server accounts, and then we add the account that uses them.
+ * If we don't do it in this order then we will experience a crash. */
+
+ /* Add a (incoming) server account, to be used by the account: */
+ gchar *store_name = g_strconcat (account_name, "_store", NULL);
gboolean created = modest_account_mgr_add_server_account (self->account_manager,
gboolean created = modest_account_mgr_add_server_account (self->account_manager,
servername_incoming,
username, password,
protocol_incoming,
servername_incoming,
username, password,
protocol_incoming,
+ /* Add a (outgoing) server account to be used by the account: */
+ gchar *transport_name = g_strconcat (account_name, "_transport", NULL); /* What is this good for? */
created = modest_account_mgr_add_server_account (self->account_manager,
created = modest_account_mgr_add_server_account (self->account_manager,
servername_outgoing,
username, password,
protocol_outgoing,
servername_outgoing,
username, password,
protocol_outgoing,
/* TODO: Provide a Logical ID for the text: */
show_error (GTK_WINDOW (self), _("An error occurred while creating the outgoing account."));
return FALSE;
/* TODO: Provide a Logical ID for the text: */
show_error (GTK_WINDOW (self), _("An error occurred while creating the outgoing account."));
return FALSE;
+ }
+
+
+ /* Create the account, which will contain the two "server accounts": */
+ created = modest_account_mgr_add_account (self->account_manager, account_name,
+ store_name, /* The name of our POP/IMAP server account. */
+ transport_name /* The name of our SMTP server account. */);
+ g_free (store_name);
+ g_free (transport_name);
+
+ if (!created) {
+ /* TODO: Provide a Logical ID for the text: */
+ show_error (GTK_WINDOW (self), _("An error occurred while creating the account."));
+ return FALSE;
+ }
- * modest_account_mgr_server_account_names:
+ * modest_account_mgr_search_server_account:
* @self: a ModestAccountMgr instance
* @account_name: get only server accounts for @account_name, or NULL for any
* @self: a ModestAccountMgr instance
* @account_name: get only server accounts for @account_name, or NULL for any
- * @type: get only server accounts from protocol type @type, or MODEST_PROTO_TYPE_ANY
- * @proto: get only server account with protocol @proto, or NULL for any
- * @only_enabled: get only enabled server accounts if TRUE
+ * @type: get only server accounts from protocol type @type, or MODEST_PROTOCOL_TYPE_UNKNOWN
+ * @proto: get only server account with protocol @proto, or MODEST_PROTOCOL_UNKNOWN for any
- * list all the server account names
+ * List all the server account names, optionally narrowing the result down to one account.
*
* Returns: a newly allocated list of server account names, or NULL in case of
* error or if there are no server accounts. The caller must free the returned GSList
*
* Returns: a newly allocated list of server account names, or NULL in case of
* error or if there are no server accounts. The caller must free the returned GSList
modest_ui_actions_on_accounts (GtkAction *action, ModestWindow *win)
{
GSList *account_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr());
modest_ui_actions_on_accounts (GtkAction *action, ModestWindow *win)
{
GSList *account_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr());
+
+#if 0
+ GSList *account_names = modest_account_mgr_search_server_accounts (
+ modest_runtime_get_account_mgr(),
+ NULL /* account_name, any */,
+ MODEST_PROTOCOL_TYPE_UNKNOWN /* type */,
+ MODEST_PROTOCOL_UNKNOWN /* proto */);
+#endif
+
gboolean accounts_exist = account_names != NULL;
g_slist_free (account_names);
gboolean accounts_exist = account_names != NULL;
g_slist_free (account_names);
#ifdef MODEST_PLATFORM_MAEMO /* Defined in config.h */
/* To test, while modest_account_mgr_account_names() is broken: accounts_exist = TRUE; */
if (!accounts_exist) {
#ifdef MODEST_PLATFORM_MAEMO /* Defined in config.h */
/* To test, while modest_account_mgr_account_names() is broken: accounts_exist = TRUE; */
if (!accounts_exist) {
- printf ("debug: modest_account_mgr_account_names() returned NULL.");
+ printf ("debug: modest_account_mgr_account_names() returned NULL.\n");
/* If there are no accounts yet, just show the easy-setup wizard, as per the UI spec: */
ModestEasysetupWizardDialog *wizard = modest_easysetup_wizard_dialog_new ();
gtk_window_set_transient_for (GTK_WINDOW (wizard), GTK_WINDOW (win));
/* If there are no accounts yet, just show the easy-setup wizard, as per the UI spec: */
ModestEasysetupWizardDialog *wizard = modest_easysetup_wizard_dialog_new ();
gtk_window_set_transient_for (GTK_WINDOW (wizard), GTK_WINDOW (win));