Attempt to commit. See ChangeLog2
[modest] / src / maemo / modest-account-settings-dialog.c
index 8a37e2a..e04aaf0 100644 (file)
@@ -51,6 +51,9 @@ struct _ModestAccountSettingsDialogPrivate
 static void
 enable_buttons (ModestAccountSettingsDialog *self);
 
+static gboolean
+save_configuration (ModestAccountSettingsDialog *dialog);
+
 static void
 modest_account_settings_dialog_get_property (GObject *object, guint property_id,
                                                                                                                        GValue *value, GParamSpec *pspec)
@@ -83,16 +86,20 @@ modest_account_settings_dialog_finalize (GObject *object)
 {
        ModestAccountSettingsDialog *self = MODEST_ACCOUNT_SETTINGS_DIALOG (object);
        
+       if (self->original_account_name)
+               g_free (self->original_account_name);
+               
        if (self->account_manager)
                g_object_unref (G_OBJECT (self->account_manager));
        
        G_OBJECT_CLASS (modest_account_settings_dialog_parent_class)->finalize (object);
 }
 
-#if 0
 static void
 show_error (GtkWindow *parent_window, const gchar* text);
-#endif
+
+static void
+show_ok (GtkWindow *parent_window, const gchar* text);
 
 
 static void
@@ -365,8 +372,6 @@ static GtkWidget* create_page_incoming (ModestAccountSettingsDialog *self)
        /* This will be filled by update_incoming_server_security_choices(). */
        if (!self->combo_incoming_security)
                self->combo_incoming_security = GTK_WIDGET (easysetup_serversecurity_combo_box_new ());
-       easysetup_serversecurity_combo_box_set_active_serversecurity (
-               EASYSETUP_SERVERSECURITY_COMBO_BOX (self->combo_incoming_security), MODEST_PROTOCOL_SECURITY_NONE);
        GtkWidget *caption = hildon_caption_new (sizegroup, _("mcen_li_emailsetup_secure_connection"), 
                self->combo_incoming_security, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->combo_incoming_security);
@@ -374,6 +379,7 @@ static GtkWidget* create_page_incoming (ModestAccountSettingsDialog *self)
        gtk_widget_show (caption);
        
        /* The port widgets: */
+       /* TODO: There are various rules about this in the UI spec. */
        if (!self->entry_incoming_port)
                self->entry_incoming_port = GTK_WIDGET (gtk_entry_new ());
        caption = hildon_caption_new (sizegroup, _("mcen_fi_emailsetup_port"), 
@@ -563,6 +569,46 @@ static GtkWidget* create_page_outgoing (ModestAccountSettingsDialog *self)
        return GTK_WIDGET (box);
 }
 
+static gboolean
+check_data (ModestAccountSettingsDialog *self)
+{
+       /* Check that the title is not already in use: */
+       const gchar* account_name = gtk_entry_get_text (GTK_ENTRY (self->entry_account_title));
+       if ((!account_name) || (strlen(account_name) == 0))
+               return FALSE; /* Should be prevented already anyway. */
+               
+       if (strcmp(account_name, self->original_account_name) != 0) {
+               /* Check the changed title: */
+               const gboolean name_in_use  = modest_account_mgr_account_with_display_name_exists (self->account_manager,
+                       account_name);
+       
+               if (name_in_use) {
+                       /* Warn the user via a dialog: */
+                       show_error (GTK_WINDOW (self), _("mail_ib_account_name_already_existing"));
+               
+                       return FALSE;
+               }
+       }
+
+       /* Check that the email address is valud: */
+       const gchar* email_address = gtk_entry_get_text (GTK_ENTRY (self->entry_user_email));
+       if ((!email_address) || (strlen(email_address) == 0))
+               return FALSE;
+                       
+       if (!modest_text_utils_validate_email_address (email_address)) {
+               /* Warn the user via a dialog: */
+               show_error (GTK_WINDOW (self), _("mcen_ib_invalid_email"));
+                                         
+        /* Return focus to the email address entry: */
+        gtk_widget_grab_focus (self->entry_user_email);
+        
+               return FALSE;
+       }
+       
+       /* TODO: The UI Spec wants us to check that the servernames are valid, 
+        * but does not specify how.
+        */
+}
 /*
  */
 static void 
@@ -572,6 +618,47 @@ on_response (GtkDialog *wizard_dialog,
 {
        ModestAccountSettingsDialog *self = MODEST_ACCOUNT_SETTINGS_DIALOG (wizard_dialog);
        enable_buttons (self);
+       
+       /* TODO: Prevent the OK response if the data is invalid. */
+       
+       gboolean prevent_response = FALSE;
+       
+       /* Warn about unsaved changes: */
+       /* TODO: Actually detect whether changes were made. */
+       if (response_id == GTK_RESPONSE_CANCEL) {
+               GtkDialog *dialog = GTK_DIALOG (gtk_message_dialog_new (GTK_WINDOW (self),
+               (GtkDialogFlags)0,
+                GTK_MESSAGE_INFO,
+                GTK_BUTTONS_OK_CANCEL, /* TODO: These button names are ambiguous, and not specified in the UI specification. */
+                _("imum_nc_wizard_confirm_lose_changes") ));
+                
+                const gint dialog_response = gtk_dialog_run (dialog);
+                gtk_widget_destroy (GTK_WIDGET (dialog));
+                
+               if (dialog_response != GTK_RESPONSE_OK)
+                       prevent_response = TRUE;
+       }
+       /* Check for invalid input: */
+       else if (!check_data (self)) {
+               prevent_response = TRUE;
+       }
+               
+       if (prevent_response) {
+               /* This is a nasty hack. murrayc. */
+               /* Don't let the dialog close */
+       g_signal_stop_emission_by_name (wizard_dialog, "response");
+               return; 
+       }
+               
+               
+       if (response_id == GTK_RESPONSE_OK) {
+               /* Try to save the changes: */  
+               const gboolean saved = save_configuration (self);
+               if (saved)
+                       show_ok (GTK_WINDOW (self), _("mcen_ib_advsetup_settings_saved"));
+               else
+                       show_error (GTK_WINDOW (self), _("mail_ib_setting_failed"));
+       }
 }
 
 static void
@@ -617,7 +704,11 @@ modest_account_settings_dialog_init (ModestAccountSettingsDialog *self)
     gtk_dialog_add_button (GTK_DIALOG(self), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
     
     /* Connect to the dialog's response signal: */
-    g_signal_connect_after (G_OBJECT (self), "response",
+    /* We use connect-before 
+     * so we can stop the signal emission, 
+     * to stop the default signal handler from closing the dialog.
+     */
+    g_signal_connect (G_OBJECT (self), "response",
             G_CALLBACK (on_response), self);       
 }
 
@@ -632,6 +723,15 @@ modest_account_settings_dialog_new (void)
  */
 void modest_account_settings_dialog_set_account_name (ModestAccountSettingsDialog *dialog, const gchar* account_name)
 {
+       if (!account_name)
+               return;
+               
+       /* Save the account name so we can refer to it if the user changes it: */
+       if (dialog->original_account_name)
+               g_free (dialog->original_account_name);
+       dialog->original_account_name = g_strdup (account_name);
+       
+       /* Get the account data for this account name: */
        ModestAccountData *account_data = modest_account_mgr_get_account_data (dialog->account_manager, 
                account_name);
        if (!account_data) {
@@ -644,13 +744,23 @@ void modest_account_settings_dialog_set_account_name (ModestAccountSettingsDialo
                return;
        }
                
+       /* Show the account data in the widgets: */
+       
+       /* Note that we never show the non-display name in the UI.
+        * (Though the display name defaults to the non-display name at the start.) */
        gtk_entry_set_text( GTK_ENTRY (dialog->entry_account_title),
-               account_name ? account_name : "");
+               account_data->display_name ? account_data->display_name : "");
+               
        gtk_entry_set_text( GTK_ENTRY (dialog->entry_user_name), 
-               account_data->fullname ? account_data->fullname : ""); /* TODO: Not working. */
-       gtk_entry_set_text( GTK_ENTRY (dialog->entry_user_email),  /* TODO: Not working. */
+               account_data->fullname ? account_data->fullname : "");
+       gtk_entry_set_text( GTK_ENTRY (dialog->entry_user_email), 
                account_data->email ? account_data->email : "");
                
+       const gboolean leave_on_server = modest_account_mgr_get_bool (dialog->account_manager, account_name,
+               MODEST_ACCOUNT_LEAVE_ON_SERVER, FALSE /* not server account */);
+       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->checkbox_leave_messages), leave_on_server);
+               
+               
        ModestServerAccountData *incoming_account = account_data->store_account;
        if (incoming_account) {
                gtk_entry_set_text( GTK_ENTRY (dialog->entry_user_username),
@@ -661,6 +771,8 @@ void modest_account_settings_dialog_set_account_name (ModestAccountSettingsDialo
                gtk_entry_set_text( GTK_ENTRY (dialog->entry_incomingserver), 
                        incoming_account->hostname ? incoming_account->hostname : "");
                        
+               easysetup_serversecurity_combo_box_set_active_serversecurity (
+                       EASYSETUP_SERVERSECURITY_COMBO_BOX (dialog->combo_incoming_security), incoming_account->proto);
                update_incoming_server_title (dialog, incoming_account->proto);
                update_incoming_server_security_choices (dialog, incoming_account->proto);
                
@@ -685,7 +797,9 @@ void modest_account_settings_dialog_set_account_name (ModestAccountSettingsDialo
                gtk_entry_set_text( GTK_ENTRY (dialog->entry_outgoing_password), 
                        outgoing_account->password ? outgoing_account->password : "");
                
-               /* How do we get the auth setting from the server account struct?: */
+               /* TODO: How do we get the auth setting from the server account struct?: */
+               /* This seems to be in ->options, with hard-coded option names.
+                * This will need new API in ModestAccountMgr. */
                easysetup_secureauth_combo_box_set_active_secureauth (
                        EASYSETUP_SECUREAUTH_COMBO_BOX (dialog->combo_outgoing_auth), MODEST_PROTOCOL_AUTH_NONE);
                on_combo_outgoing_auth_changed (GTK_COMBO_BOX (dialog->combo_outgoing_auth), dialog);
@@ -706,77 +820,122 @@ void modest_account_settings_dialog_set_account_name (ModestAccountSettingsDialo
 
        modest_account_mgr_free_account_data (dialog->account_manager, account_data);
 }
-       
-#if 0
+
 static gboolean
-on_before_next (GtkDialog *dialog, GtkWidget *current_page, GtkWidget *next_page)
+save_configuration (ModestAccountSettingsDialog *dialog)
 {
-       ModestAccountSettingsDialog *self = MODEST_ACCOUNT_SETTINGS_DIALOG (dialog);
+       g_assert (dialog->original_account_name);
        
-       /* Do extra validation that couldn't be done for every key press,
-        * either because it was too slow,
-        * or because it requires interaction:
+       const gchar* account_name = dialog->original_account_name;
+               
+       /* Set the account data from the widgets: */
+       const gchar* user_name = gtk_entry_get_text (GTK_ENTRY (dialog->entry_user_name));
+       gboolean test = modest_account_mgr_set_string (dialog->account_manager, account_name,
+               MODEST_ACCOUNT_FULLNAME, user_name, FALSE /* not server account */);
+       if (!test)
+               return FALSE;
+               
+       const gchar* emailaddress = gtk_entry_get_text (GTK_ENTRY (dialog->entry_user_email));
+       test = modest_account_mgr_set_string (dialog->account_manager, account_name,
+               MODEST_ACCOUNT_EMAIL, emailaddress, FALSE /* not server account */);
+       if (!test)
+               return FALSE;
+                               
+       /* TODO: Change name: */
+       /* Possibly the account name may never change, but that should be hidden, 
+        * and the display name may change, defaulting to the account name.
         */
-       if (current_page == self->page_account_details) {       
-               /* Check that the title is not already in use: */
-               const gchar* account_name = gtk_entry_get_text (GTK_ENTRY (self->entry_account_title));
-               if ((!account_name) || (strlen(account_name) == 0))
-                       return FALSE;
+       
+       const gboolean leave_on_server = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->checkbox_leave_messages));
+       test = modest_account_mgr_set_bool (dialog->account_manager, account_name,
+               MODEST_ACCOUNT_LEAVE_ON_SERVER, leave_on_server, FALSE /* not server account */);
+       if (!test)
+               return FALSE;
                        
-               gboolean name_in_use = FALSE;
-               name_in_use = modest_account_mgr_account_exists (self->account_manager,
-                       account_name, FALSE /*  server_account */);
-               
-               if (name_in_use) {
-                       /* Warn the user via a dialog: */
-                       show_error (GTK_WINDOW (self), _("mail_ib_account_name_already_existing."));
-            
-                       return FALSE;
-               }
-       }
-       else if (current_page == self->page_user_details) {
-               /* Check that the email address is valud: */
-               const gchar* email_address = gtk_entry_get_text (GTK_ENTRY (self->entry_user_email));
-               if ((!email_address) || (strlen(email_address) == 0))
-                       return FALSE;
+       /* Incoming: */
+       gchar* incoming_account_name = modest_account_mgr_get_string (dialog->account_manager, account_name,
+               MODEST_ACCOUNT_STORE_ACCOUNT, FALSE /* not server account */);
+       g_assert (incoming_account_name);
+       
+       const gchar* hostname = gtk_entry_get_text (GTK_ENTRY (dialog->entry_incomingserver));
+       test = modest_account_mgr_set_string (dialog->account_manager, incoming_account_name,
+               MODEST_ACCOUNT_HOSTNAME, hostname, TRUE /* server account */);
+       if (!test)
+               return FALSE;
+                               
+       const gchar* username = gtk_entry_get_text (GTK_ENTRY (dialog->entry_user_username));
+       test = modest_account_mgr_set_string (dialog->account_manager, incoming_account_name,
+               MODEST_ACCOUNT_USERNAME, username, TRUE /* server account */);
+       if (!test)
+               return FALSE;
+                               
+       const gchar* password = gtk_entry_get_text (GTK_ENTRY (dialog->entry_user_password));
+       test = modest_account_mgr_set_string (dialog->account_manager, incoming_account_name,
+               MODEST_ACCOUNT_PASSWORD, password, TRUE /*  server account */);
+       if (!test)
+               return FALSE;
                        
-               if (!modest_text_utils_validate_email_address (email_address)) {
-                       /* Warn the user via a dialog: */
-                       show_error (GTK_WINDOW (self), _("mcen_ib_invalid_email"));
-                                             
-            /* Return focus to the email address entry: */
-            gtk_widget_grab_focus (self->entry_user_email);
-            
-                       return FALSE;
-               }
+       /* TODO: How can we set these in the server account?:   
+       ModestProtocol protocol_authentication_incoming = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->checkbox_incoming_auth)) 
+                       ? MODEST_PROTOCOL_AUTH_PASSWORD
+                       : MODEST_PROTOCOL_AUTH_NONE;
+                       
+       ModestProtocol protocol_security_incoming = easysetup_serversecurity_combo_box_get_active_serversecurity (
+               EASYSETUP_SERVERSECURITY_COMBO_BOX (self->combo_incoming_security));
+       
+       */
+       
+       g_free (incoming_account_name);
+       
+       /* Outgoing: */
+       gchar* outgoing_account_name = modest_account_mgr_get_string (dialog->account_manager, account_name,
+               MODEST_ACCOUNT_TRANSPORT_ACCOUNT, FALSE /* not server account */);
+       g_assert (outgoing_account_name);
+       
+       hostname = gtk_entry_get_text (GTK_ENTRY (dialog->entry_outgoingserver));
+       test = modest_account_mgr_set_string (dialog->account_manager, outgoing_account_name,
+               MODEST_ACCOUNT_HOSTNAME, hostname, TRUE /* server account */);
+       if (!test)
+               return FALSE;
                
-               /* Make sure that the subsequent pages are appropriate for the provider choice. */
-               create_subsequent_pages (self);
-       }
+       username = gtk_entry_get_text (GTK_ENTRY (dialog->entry_outgoing_username));
+       test = modest_account_mgr_set_string (dialog->account_manager, outgoing_account_name,
+               MODEST_ACCOUNT_USERNAME, username, TRUE /* server account */);
+       if (!test)
+               return FALSE;
+               
+       password = gtk_entry_get_text (GTK_ENTRY (dialog->entry_outgoing_password));
+       test = modest_account_mgr_set_string (dialog->account_manager, outgoing_account_name,
+               MODEST_ACCOUNT_PASSWORD, password, TRUE /*  server account */);
+       if (!test)
+               return FALSE;
        
-       /* TODO: The UI Spec wants us to check that the servernames are valid, 
-        * but does not specify how.
-        */
-         
-       if(next_page == self->page_incoming) {
-               set_default_custom_servernames (self);
-       }
-       else if (next_page == self->page_outgoing) {
-               set_default_custom_servernames (self);
-       }
+       /* TODO: How do we set these in the account data?:
+       ModestProtocol protocol_security_outgoing = easysetup_serversecurity_combo_box_get_active_serversecurity (
+               EASYSETUP_SERVERSECURITY_COMBO_BOX (self->combo_outgoing_security));
        
-       /* If this is the last page, and this is a click on Finish, 
-        * then attempt to create the dialog.
+       ModestProtocol protocol_authentication_outgoing = easysetup_secureauth_combo_box_get_active_secureauth (
+               EASYSETUP_SECUREAUTH_COMBO_BOX (self->combo_outgoing_auth));
         */
-       if(!next_page) /* This is NULL when this is a click on Finish. */
-       {
-               create_account (self);
-       }
+               
+       g_free (outgoing_account_name);
        
        
+       /* Set the changed account title last, to simplify the previous code: */
+       const gchar* account_title = gtk_entry_get_text (GTK_ENTRY (dialog->entry_account_title));
+       if ((!account_title) || (strlen(account_title) == 0))
+               return FALSE; /* Should be prevented already anyway. */
+               
+       if (strcmp(account_title, account_name) != 0) {
+               /* Change the title: */
+               gboolean test = modest_account_mgr_set_string (dialog->account_manager, account_name,
+               MODEST_ACCOUNT_DISPLAY_NAME, account_title, FALSE /* not server account */);
+               if (!test)
+                       return FALSE;
+       }
+       
        return TRUE;
 }
-#endif
 
 static gboolean entry_is_empty (GtkWidget *entry)
 {
@@ -833,7 +992,6 @@ modest_account_settings_dialog_class_init (ModestAccountSettingsDialogClass *kla
        object_class->finalize = modest_account_settings_dialog_finalize;
 }
  
-#if 0
 static void
 show_error (GtkWindow *parent_window, const gchar* text)
 {
@@ -846,147 +1004,19 @@ show_error (GtkWindow *parent_window, const gchar* text)
                 gtk_dialog_run (dialog);
                 gtk_widget_destroy (GTK_WIDGET (dialog));
 }
-#endif
 
-#if 0
-/** Attempt to create the account from the information that the user has entered.
- * @result: TRUE if the account was successfully created.
- */
-gboolean
-create_account (ModestAccountSettingsDialog *self)
+static void
+show_ok (GtkWindow *parent_window, const gchar* text)
 {
-       ModestAccountSettingsDialogPrivate *priv = ACCOUNT_SETTINGS_DIALOG_GET_PRIVATE (self);
-       
-       const gchar* account_name = gtk_entry_get_text (GTK_ENTRY (self->entry_account_title));
-
-       /* Some checks: */
-       if (!account_name)
-               return FALSE;
-               
-       /* We should have checked for this already, 
-        * and changed that name accordingly, 
-        * but let's check again just in case:
-        */
-       if (modest_account_mgr_account_exists (self->account_manager, account_name, FALSE)) 
-               return FALSE;   
-               
-       /* username and password (for both incoming and outgoing): */
-       const gchar* username = gtk_entry_get_text (GTK_ENTRY (self->entry_user_username));
-       const gchar* password = gtk_entry_get_text (GTK_ENTRY (self->entry_user_password));
-       
-       /* Incoming server: */
-       /* Note: We need something as default for the ModestProtocol values, 
-        * or modest_account_mgr_add_server_account will fail. */
-       gchar* servername_incoming = NULL;
-       ModestProtocol protocol_incoming = MODEST_PROTOCOL_STORE_POP;
-       ModestProtocol protocol_security_incoming = MODEST_PROTOCOL_SECURITY_NONE;
-       ModestProtocol protocol_authentication_incoming = MODEST_PROTOCOL_AUTH_NONE;
-       
-       
-       /* Use custom pages because no preset was specified: */
-       servername_incoming = g_strdup (gtk_entry_get_text (GTK_ENTRY (self->entry_incomingserver) ));
-       
-       protocol_incoming = easysetup_servertype_combo_box_get_active_servertype (
-       EASYSETUP_SERVERTYPE_COMBO_BOX (self->combo_incoming_servertype));
-       
-       protocol_security_incoming = easysetup_serversecurity_combo_box_get_active_serversecurity (
-       EASYSETUP_SERVERSECURITY_COMBO_BOX (self->combo_incoming_security));
-       
-       protocol_authentication_incoming = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->checkbox_incoming_auth)) 
-               ? MODEST_PROTOCOL_AUTH_PASSWORD
-               : MODEST_PROTOCOL_AUTH_NONE;
-               
-
-       
-       /* 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,
-               store_name,
-               servername_incoming,
-               username, password,
-               protocol_incoming,
-               protocol_security_incoming,
-               protocol_authentication_incoming);              
-               
-       g_free (servername_incoming);
-       
-       if (!created) {
-               /* TODO: Provide a Logical ID for the text: */
-               show_error (GTK_WINDOW (self), _("An error occurred while creating the incoming account."));
-               return FALSE;   
-       }
-       
-       /* Sanity check: */
-       /* There must be at least one account now: */
-       GSList *account_names = modest_account_mgr_account_names (self->account_manager);
-       if(account_names != NULL)
-       {
-               g_warning ("modest_account_mgr_account_names() returned NULL after adding an account.");
-       }
-       g_slist_free (account_names);
-       
-       
-       /* Outgoing server: */
-       gchar* servername_outgoing = NULL;
-       ModestProtocol protocol_outgoing = MODEST_PROTOCOL_STORE_POP;
-       ModestProtocol protocol_security_outgoing = MODEST_PROTOCOL_SECURITY_NONE;
-       ModestProtocol protocol_authentication_outgoing = MODEST_PROTOCOL_AUTH_NONE;
-       
-       
-       /* Use custom pages because no preset was specified: */
-       servername_outgoing = g_strdup (gtk_entry_get_text (GTK_ENTRY (self->entry_outgoingserver) ));
-       
-       protocol_outgoing = MODEST_PROTOCOL_TRANSPORT_SMTP; /* It's always SMTP for outgoing. */
-
-       protocol_security_outgoing = easysetup_serversecurity_combo_box_get_active_serversecurity (
-               EASYSETUP_SERVERSECURITY_COMBO_BOX (self->combo_outgoing_security));
-       
-       protocol_authentication_outgoing = easysetup_secureauth_combo_box_get_active_secureauth (
-               EASYSETUP_SECUREAUTH_COMBO_BOX (self->combo_outgoing_auth));
-       
-       /* TODO: 
-       gboolean specific = gtk_toggle_button_get_active (
-               GTK_TOGGLE_BUTTON (self->checkbox_outgoing_smtp_specific));
-       */
-               
-           
-       /* 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,
-               transport_name,
-               servername_outgoing,
-               username, password,
-               protocol_outgoing,
-               protocol_security_outgoing,
-               protocol_authentication_outgoing);
-               
-       g_free (servername_outgoing);
-               
-       if (!created) {
-               /* 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;   
-       }
-       
-       return FALSE;
+       GtkDialog *dialog = GTK_DIALOG (gtk_message_dialog_new (parent_window,
+               (GtkDialogFlags)0,
+                GTK_MESSAGE_INFO,
+                GTK_BUTTONS_OK,
+                text ));
+                
+                gtk_dialog_run (dialog);
+                gtk_widget_destroy (GTK_WIDGET (dialog));
 }
-#endif
+