diff options
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/comp-editor-factory.c | 6 | ||||
-rw-r--r-- | calendar/gui/e-memos.c | 15 | ||||
-rw-r--r-- | calendar/gui/e-tasks.c | 12 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 32 |
4 files changed, 47 insertions, 18 deletions
diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c index f90649760a..908293a151 100644 --- a/calendar/gui/comp-editor-factory.c +++ b/calendar/gui/comp-editor-factory.c @@ -421,6 +421,12 @@ cal_opened_cb (ECal *client, ECalendarStatus status, gpointer data) "%s", _("Permission denied to open the calendar")); break; + case E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED: + dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, + GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, + "%s", _("Authentication Required")); + break; + case E_CALENDAR_STATUS_AUTHENTICATION_FAILED : dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, diff --git a/calendar/gui/e-memos.c b/calendar/gui/e-memos.c index a8c5b41b2b..89c9c8ad1e 100644 --- a/calendar/gui/e-memos.c +++ b/calendar/gui/e-memos.c @@ -802,6 +802,9 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, EMemos *memos) source = e_cal_get_source (ecal); + if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED || status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED) + auth_cal_forget_password (ecal); + switch (status) { case E_CALENDAR_STATUS_OK : g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, client_cal_opened_cb, NULL); @@ -813,11 +816,14 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, EMemos *memos) set_timezone (memos); set_status_message (memos, NULL); break; + case E_CALENDAR_STATUS_AUTHENTICATION_FAILED: + /* try to reopen calendar - it'll ask for a password once again */ + e_cal_open_async (ecal, FALSE); + return; case E_CALENDAR_STATUS_BUSY : break; case E_CALENDAR_STATUS_REPOSITORY_OFFLINE: e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (memos))), "calendar:prompt-no-contents-offline-memos", NULL); - break; default : /* Make sure the source doesn't disappear on us */ g_object_ref (source); @@ -849,6 +855,9 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, EMemos *memos) source = e_cal_get_source (ecal); + if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED || status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED) + auth_cal_forget_password (ecal); + switch (status) { case E_CALENDAR_STATUS_OK : g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, default_client_cal_opened_cb, NULL); @@ -858,6 +867,10 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, EMemos *memos) e_cal_model_set_default_client (model, ecal); set_status_message (memos, NULL); break; + case E_CALENDAR_STATUS_AUTHENTICATION_FAILED: + /* try to reopen calendar - it'll ask for a password once again */ + e_cal_open_async (ecal, FALSE); + return; case E_CALENDAR_STATUS_BUSY: break; default : diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index b866439413..fad9d6d300 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -953,7 +953,7 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, ETasks *tasks) source = e_cal_get_source (ecal); - if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED) + if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED || status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED) auth_cal_forget_password (ecal); switch (status) { @@ -966,6 +966,10 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, ETasks *tasks) set_status_message (tasks, NULL); break; + case E_CALENDAR_STATUS_AUTHENTICATION_FAILED: + /* try to reopen calendar - it'll ask for a password once again */ + e_cal_open_async (ecal, FALSE); + return; case E_CALENDAR_STATUS_BUSY : break; case E_CALENDAR_STATUS_REPOSITORY_OFFLINE: @@ -1001,7 +1005,7 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, ETasks *tasks) source = e_cal_get_source (ecal); - if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED) + if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED || status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED) auth_cal_forget_password (ecal); switch (status) { @@ -1012,6 +1016,10 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, ETasks *tasks) e_cal_model_set_default_client (model, ecal); set_status_message (tasks, NULL); break; + case E_CALENDAR_STATUS_AUTHENTICATION_FAILED: + /* try to reopen calendar - it'll ask for a password once again */ + e_cal_open_async (ecal, FALSE); + return; case E_CALENDAR_STATUS_BUSY: break; default : diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index dcec360953..c2b1cb3d6c 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -2793,7 +2793,7 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) break; } - if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED && source_type == E_CAL_SOURCE_TYPE_EVENT) + if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED || status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED) auth_cal_forget_password (ecal); switch (status) { @@ -2819,17 +2819,10 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) status = E_CALENDAR_STATUS_OK; break; - case E_CALENDAR_STATUS_AUTHENTICATION_FAILED: - { - const gchar *auth_domain = e_source_get_property (source, "auth-domain"); - const gchar *component_name; - - component_name = auth_domain ? auth_domain : "Calendar"; - - /* Warn the user password is wrong */ - e_passwords_forget_password (component_name, e_cal_get_uri(ecal)); - return; - } + case E_CALENDAR_STATUS_AUTHENTICATION_FAILED: + /* try to reopen calendar - it'll ask for a password once again */ + e_cal_open_async (ecal, FALSE); + return; case E_CALENDAR_STATUS_REPOSITORY_OFFLINE: if (source_type == E_CAL_SOURCE_TYPE_EVENT) { @@ -2851,6 +2844,8 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) /* Make sure the source doesn't disappear on us */ g_object_ref (source); + g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gcal); + priv->clients_list[source_type] = g_list_remove (priv->clients_list[source_type], ecal); g_hash_table_remove (priv->clients[source_type], e_source_peek_uid (source)); @@ -2915,6 +2910,9 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar source = e_cal_get_source (ecal); state = e_cal_get_load_state (ecal); + if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED || status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED) + auth_cal_forget_password (ecal); + switch (source_type) { case E_CAL_SOURCE_TYPE_EVENT: e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL, -1); @@ -2936,13 +2934,18 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar if (state == E_CAL_LOAD_NOT_LOADED) e_cal_open_async (ecal, FALSE); return; - case E_CALENDAR_STATUS_INVALID_SERVER_VERSION : + case E_CALENDAR_STATUS_AUTHENTICATION_FAILED: + /* try to reopen calendar - it'll ask for a password once again */ + e_cal_open_async (ecal, FALSE); + return; + case E_CALENDAR_STATUS_INVALID_SERVER_VERSION: e_error_run (NULL, "calendar:server-version", NULL); - status = E_CALENDAR_STATUS_OK; default: /* Make sure the source doesn't disappear on us */ g_object_ref (source); + g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gcal); + /* FIXME should we do this to prevent multiple error dialogs? */ priv->clients_list[source_type] = g_list_remove (priv->clients_list[source_type], ecal); g_hash_table_remove (priv->clients[source_type], e_source_peek_uid (source)); @@ -2962,7 +2965,6 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, default_client_cal_opened_cb, NULL); - switch (source_type) { case E_CAL_SOURCE_TYPE_EVENT: e_cal_model_set_default_client ( |