X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fhildon2%2Fmodest-easysetup-wizard-dialog.c;h=64207d383fb680fc07e4c29cd874a724040a5142;hp=b0b47efce764d75d80d321001bdaddc17330f9c0;hb=87bae85f05ddc2249aed07193ca8ab73e814bd4f;hpb=e7c74909cfb4fd631b9c60344825a6ca117b9c8b diff --git a/src/hildon2/modest-easysetup-wizard-dialog.c b/src/hildon2/modest-easysetup-wizard-dialog.c index b0b47ef..64207d3 100644 --- a/src/hildon2/modest-easysetup-wizard-dialog.c +++ b/src/hildon2/modest-easysetup-wizard-dialog.c @@ -387,10 +387,12 @@ create_page_welcome (ModestEasysetupWizardDialog *self) GtkWidget *box; GtkWidget *align; GtkWidget *label; + GtkWidget *pannable; ModestEasysetupWizardDialogPrivate *priv; priv = MODEST_EASYSETUP_WIZARD_DIALOG_GET_PRIVATE (self); box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE); + pannable = hildon_pannable_area_new (); label = gtk_label_new(_("mcen_ia_emailsetup_intro")); align = gtk_alignment_new (0.0, 0.0, 1.0, 1.0); gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0, MODEST_MARGIN_DOUBLE, 0); @@ -402,8 +404,13 @@ create_page_welcome (ModestEasysetupWizardDialog *self) gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0); gtk_container_add (GTK_CONTAINER (align), box); gtk_widget_show (label); + + hildon_pannable_area_add_with_viewport (HILDON_PANNABLE_AREA (pannable), align); gtk_widget_show (GTK_WIDGET (box)); - return GTK_WIDGET (align); + gtk_widget_show (GTK_WIDGET (align)); + gtk_widget_show (pannable); + + return GTK_WIDGET (pannable); } static void @@ -1484,7 +1491,6 @@ modest_easysetup_wizard_dialog_init (ModestEasysetupWizardDialog *self) priv->settings = modest_account_settings_new (); - check_support_of_protocols (self); } ModestEasysetupWizardDialog* @@ -1618,8 +1624,12 @@ create_subsequent_pages (ModestEasysetupWizardDialog *self) picker = MODEST_PROVIDER_PICKER (priv->account_serviceprovider_picker); id_type = modest_provider_picker_get_active_id_type (picker); g_object_get (self, "wizard-notebook", ¬ebook, NULL); - modest_wizard_dialog_set_response_override_handler (MODEST_WIZARD_DIALOG (self), - NULL); + + /* Remove the response override handler for non-plugin + protocols. For plugins it'll be overriden later */ + if (id_type != MODEST_PROVIDER_PICKER_ID_PLUGIN_PROTOCOL) + modest_wizard_dialog_set_response_override_handler (MODEST_WIZARD_DIALOG (self), + NULL); if (id_type == MODEST_PROVIDER_PICKER_ID_OTHER) { @@ -1656,6 +1666,7 @@ create_subsequent_pages (ModestEasysetupWizardDialog *self) ModestProtocol *protocol; gchar *proto_name; ModestProtocolType proto_type; + ModestWizardDialogResponseOverrideFunc response_override; /* Get protocol data */ proto_name = modest_provider_picker_get_active_provider_id (picker); @@ -1673,22 +1684,25 @@ create_subsequent_pages (ModestEasysetupWizardDialog *self) priv->page_complete_easysetup = NULL; } + /* Ensure that the response override handler + is set. It might happen that plugins clear + them incorrectly */ + response_override = modest_account_protocol_get_wizard_response_override + (MODEST_ACCOUNT_PROTOCOL (protocol)); + modest_wizard_dialog_set_response_override_handler (MODEST_WIZARD_DIALOG (self), + response_override); + if (protocol && MODEST_IS_ACCOUNT_PROTOCOL (protocol) && proto_type != priv->last_plugin_protocol_selected) { ModestPairList *tabs; GSList *tmp; gboolean first_page = TRUE; - ModestWizardDialogResponseOverrideFunc response_override; /* Remember the last selected plugin protocol */ priv->last_plugin_protocol_selected = proto_type; /* Get tabs */ tabs = modest_account_protocol_get_easysetupwizard_tabs (MODEST_ACCOUNT_PROTOCOL (protocol)); - response_override = modest_account_protocol_get_wizard_response_override - (MODEST_ACCOUNT_PROTOCOL (protocol)); - modest_wizard_dialog_set_response_override_handler (MODEST_WIZARD_DIALOG (self), - response_override); tmp = (GSList *) tabs; while (tmp) { ModestPair *pair = (ModestPair *) tmp->data; @@ -1875,7 +1889,12 @@ on_before_next (ModestWizardDialog *dialog, GtkWidget *current_page, GtkWidget * * either because it was too slow, * or because it requires interaction: */ - if (current_page == priv->page_account_details) { + if (current_page == priv->page_welcome) { + if (!priv->check_support_done) { + check_support_of_protocols (self); + return priv->check_support_done; + } + } else if (current_page == priv->page_account_details) { /* Check that the title is not already in use: */ gchar* account_title = get_entered_account_title (self); if (!account_title) @@ -2022,7 +2041,7 @@ real_enable_buttons (ModestWizardDialog *dialog, gboolean enable_next) /* If the check support is not done then do not enable the wizard to continue */ - enable_next = enable_next && priv->check_support_done; + enable_next = enable_next && priv->pending_check_support == 0; } gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), @@ -2477,6 +2496,7 @@ check_support_callback (ModestAccountProtocol *protocol, fill_providers (self); hildon_gtk_window_set_progress_indicator (GTK_WINDOW (self), FALSE); invoke_enable_buttons_vfunc (self); + gtk_dialog_response (GTK_DIALOG (self), MODEST_WIZARD_DIALOG_NEXT); } } g_object_unref (self);