X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-utils.c;h=9753267bcaa0d40b91d2402fe16d02d7d16ac530;hp=6f60b4080770de3a342b969c4bb1ea2bc3518c18;hb=a1d576310d8fd6c92053672e0f7d8c69e416807d;hpb=7bbdd063b06f67912cad510a15dcef5555170c81 diff --git a/src/modest-utils.c b/src/modest-utils.c index 6f60b40..9753267 100644 --- a/src/modest-utils.c +++ b/src/modest-utils.c @@ -275,6 +275,26 @@ on_secure_auth_cancel(GtkWidget* dialog, int response, gpointer user_data) info->cancel = TRUE; } } +typedef struct { + GtkProgressBar *progress; + gboolean not_finished; +} KeepPulsing; + +static gboolean +keep_pulsing (gpointer user_data) +{ + KeepPulsing *info = (KeepPulsing *) user_data; + + gtk_progress_bar_pulse (info->progress); + + if (!info->not_finished) { + g_object_unref (info->progress); + g_slice_free (KeepPulsing, info); + return FALSE; + } + + return TRUE; +} GList* modest_utils_get_supported_secure_authentication_methods (ModestTransportStoreProtocol proto, @@ -341,8 +361,11 @@ modest_utils_get_supported_secure_authentication_methods (ModestTransportStorePr info->cancel = FALSE; info->error = NULL; info->progress = gtk_progress_bar_new(); - /* TODO: Need logical_ID for the title: */ - info->dialog = gtk_dialog_new_with_buttons(_("accountwizard_fi_authentication"), + + /* FIXME: the title (first arg) here is empty; there should be 'accountwizard_fi_authentication', + * but that does not exist yet; see bug #82487. so, for now, we simply leave it empty + */ + info->dialog = gtk_dialog_new_with_buttons(" ", parent_window, GTK_DIALOG_MODAL, _("mcen_bd_dialog_cancel"), GTK_RESPONSE_REJECT, @@ -355,9 +378,16 @@ modest_utils_get_supported_secure_authentication_methods (ModestTransportStorePr gtk_label_new(_("emev_ni_checking_supported_auth_methods"))); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(info->dialog)->vbox), info->progress); gtk_widget_show_all(info->dialog); - gtk_progress_bar_pulse(GTK_PROGRESS_BAR(info->progress)); + + KeepPulsing *pi = g_slice_new (KeepPulsing); + pi->progress = (GtkProgressBar *) g_object_ref (info->progress); + pi->not_finished = TRUE; + + /* Starts the pulsing of the progressbar */ + g_timeout_add (500, keep_pulsing, pi); printf ("DEBUG: %s: STARTING.\n", __FUNCTION__); + tny_camel_account_get_supported_secure_authentication ( TNY_CAMEL_ACCOUNT (tny_account), on_camel_account_get_supported_secure_authentication, @@ -366,6 +396,9 @@ modest_utils_get_supported_secure_authentication_methods (ModestTransportStorePr gtk_dialog_run (GTK_DIALOG (info->dialog)); + pi->not_finished = FALSE; + /* pi is freed in the timeout itself to avoid a GCond here */ + gtk_widget_destroy(info->dialog); GList *result = info->result;