return GTK_WIDGET (box);
}
+static void
+on_user_username_changed(GtkWidget* widget, ModestEasysetupWizardDialog *self)
+{
+ ModestEasysetupWizardDialogPrivate* priv;
+ gchar* provider_id = NULL;
+ EasysetupProviderComboBox *combo;
+
+ priv = MODEST_EASYSETUP_WIZARD_DIALOG_GET_PRIVATE (self);
+
+ /* Work out the user email address */
+ combo = EASYSETUP_PROVIDER_COMBO_BOX (priv->combo_account_serviceprovider);
+ provider_id = easysetup_provider_combo_box_get_active_provider_id (combo);
+
+ if (provider_id) {
+ gchar *email_address;
+ gchar *domain_name = modest_presets_get_domain (priv->presets, provider_id);
+
+ email_address = g_strdup_printf ("%s@%s",
+ gtk_entry_get_text (GTK_ENTRY (priv->entry_user_username)),
+ domain_name);
+
+ /* Update the email address */
+ gtk_entry_set_text (GTK_ENTRY (priv->entry_user_email), email_address);
+
+ g_free (email_address);
+ g_free (domain_name);
+ g_free (provider_id);
+ }
+
+ /* Update state */
+ on_easysetup_changed(widget, self);
+}
+
static GtkWidget*
create_page_user_details (ModestEasysetupWizardDialog *self)
{
gtk_widget_show (priv->entry_user_username);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
g_signal_connect(G_OBJECT(priv->entry_user_username), "changed",
- G_CALLBACK(on_easysetup_changed), self);
+ G_CALLBACK(on_user_username_changed), self);
gtk_widget_show (caption);
/* Prevent the use of some characters in the username,
/* This is mostly copied from
* src/maemo/modest-account-settings-dialog.c */
if (priv->dirty) {
- GtkDialog *dialog = GTK_DIALOG (hildon_note_new_confirmation (GTK_WINDOW (self),
- _("imum_nc_wizard_confirm_lose_changes")));
- /* TODO: These button names will be ambiguous, and not
- * specified in the UI specification. */
+ gint dialog_response;
+ GtkWidget *dialog;
+
+ dialog = hildon_note_new_confirmation ((GtkWindow *) self,
+ _("imum_nc_wizard_confirm_lose_changes"));
+
+ modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
+ (GtkWindow *) dialog,
+ (GtkWindow *) wizard_dialog);
- const gint dialog_response = gtk_dialog_run (dialog);
+ dialog_response = gtk_dialog_run ((GtkDialog *) dialog);
gtk_widget_destroy (GTK_WIDGET (dialog));
if (dialog_response != GTK_RESPONSE_OK) {