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);
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
-on_account_country_selector_changed (HildonTouchSelector *widget, gint column, gpointer user_data)
+on_account_country_selector_changed (HildonTouchSelector *widget, gpointer user_data)
{
ModestEasysetupWizardDialog *self = MODEST_EASYSETUP_WIZARD_DIALOG (user_data);
g_assert(self);
modest_country_picker_load_data(
MODEST_COUNTRY_PICKER (priv->account_country_picker));
/* connect to country picker's changed signal, so we can fill the provider picker: */
- g_signal_connect (G_OBJECT (hildon_picker_button_get_selector
- (HILDON_PICKER_BUTTON (priv->account_country_picker))),
- "changed",
+ g_signal_connect ((GObject *) priv->account_country_picker,
+ "value-changed",
G_CALLBACK (on_account_country_selector_changed), self);
modest_country_picker_set_active_country_locale (
priv->settings = modest_account_settings_new ();
- check_support_of_protocols (self);
}
ModestEasysetupWizardDialog*
/* */
static void
-remove_non_common_tabs (GtkNotebook *notebook,
+remove_non_common_tabs (ModestEasysetupWizardDialog *self,
gboolean remove_user_details)
{
gint starting_tab;
+ GtkNotebook *notebook;
+ ModestEasysetupWizardDialogPrivate *priv;
+
+ priv = MODEST_EASYSETUP_WIZARD_DIALOG_GET_PRIVATE (self);
+ g_object_get (self, "wizard-notebook", ¬ebook, NULL);
+
/* The first 2 tabs are the common ones (welcome tab and the
providers tab), so we always remove starting from the
end */
-
starting_tab = (remove_user_details) ? 2 : 3;
- while (gtk_notebook_get_n_pages (notebook) > starting_tab)
+ while (gtk_notebook_get_n_pages (notebook) > starting_tab) {
+ /* Disconnect signal */
+ GtkWidget *page = gtk_notebook_get_nth_page (notebook, -1);
+ if (modest_signal_mgr_is_connected (priv->missing_data_signals, (GObject *) page, "missing-mandatory-data")) {
+ priv->missing_data_signals = modest_signal_mgr_disconnect (priv->missing_data_signals,
+ (GObject *) page,
+ "missing-mandatory-data");
+ }
+ /* Remove page from notebook */
gtk_notebook_remove_page (notebook, -1);
+ }
}
static void
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) {
/* If we come from a rollbacked easysetup */
if (priv->page_complete_easysetup) {
- remove_non_common_tabs (notebook, FALSE);
+ remove_non_common_tabs (self, FALSE);
priv->page_complete_easysetup = NULL;
}
/* If we come from a rollbacked plugin protocol setup */
if (priv->last_plugin_protocol_selected != MODEST_PROTOCOL_REGISTRY_TYPE_INVALID) {
- remove_non_common_tabs (notebook, TRUE);
+ remove_non_common_tabs (self, TRUE);
priv->last_plugin_protocol_selected = MODEST_PROTOCOL_REGISTRY_TYPE_INVALID;
modest_signal_mgr_disconnect_all_and_destroy (priv->missing_data_signals);
priv->missing_data_signals = NULL;
} else {
/* If we come from a rollbacked custom setup */
if (priv->page_custom_incoming) {
- remove_non_common_tabs (notebook, TRUE);
+ remove_non_common_tabs (self, TRUE);
init_user_page (priv);
init_incoming_page (priv);
init_outgoing_page (priv);
ModestProtocol *protocol;
gchar *proto_name;
ModestProtocolType proto_type;
+ ModestWizardDialogResponseOverrideFunc response_override;
/* Get protocol data */
proto_name = modest_provider_picker_get_active_provider_id (picker);
/* If we come from a rollbacked easy setup */
if (priv->last_plugin_protocol_selected != proto_type &&
priv->page_complete_easysetup) {
- remove_non_common_tabs (notebook, TRUE);
+ remove_non_common_tabs (self, TRUE);
init_user_page (priv);
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;
} else {
if (priv->last_plugin_protocol_selected !=
MODEST_PROTOCOL_REGISTRY_TYPE_INVALID) {
- remove_non_common_tabs (notebook, TRUE);
+ remove_non_common_tabs (self, TRUE);
init_user_page (priv);
priv->page_complete_easysetup = NULL;
priv->last_plugin_protocol_selected = MODEST_PROTOCOL_REGISTRY_TYPE_INVALID;
* 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)
/* 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),
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);