diff options
author | Harish Krishnaswamy <kharish@src.gnome.org> | 2005-02-05 19:55:03 +0800 |
---|---|---|
committer | Harish Krishnaswamy <kharish@src.gnome.org> | 2005-02-05 19:55:03 +0800 |
commit | b6306f760aa0b747835ed19ecb1a4baed10248f4 (patch) | |
tree | ce569283358db5c2027e7a98f515729f41e9decb | |
parent | 2bc223da691dd5dd9cd09063053fca8b5ec7d201 (diff) | |
download | gsoc2013-evolution-b6306f760aa0b747835ed19ecb1a4baed10248f4.tar.gz gsoc2013-evolution-b6306f760aa0b747835ed19ecb1a4baed10248f4.tar.zst gsoc2013-evolution-b6306f760aa0b747835ed19ecb1a4baed10248f4.zip |
add messages for calendar/tasks not marked for offline usage.
* calendar-errors.xml:
* calendar-errors.xml.h:
* gui/e-tasks.c: (client_cal_opened_cb):
* gui/gnome-cal.c: (client_cal_opened_cb),
(default_client_cal_opened_cb): add messages for
calendar/tasks not marked for offline usage.
svn path=/trunk/; revision=28718
-rw-r--r-- | calendar/ChangeLog | 10 | ||||
-rw-r--r-- | calendar/calendar-errors.xml | 12 | ||||
-rw-r--r-- | calendar/calendar-errors.xml.h | 8 | ||||
-rw-r--r-- | calendar/gui/e-tasks.c | 2 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 52 |
5 files changed, 63 insertions, 21 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 4b4a7d1ef3..cce99c31a0 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,15 @@ 2005-02-05 Harish Krishnaswamy <kharish@novell.com> + * calendar-errors.xml: + * calendar-errors.xml.h: + * gui/e-tasks.c: (client_cal_opened_cb): + * gui/gnome-cal.c: (client_cal_opened_cb), + (default_client_cal_opened_cb): add messages for + calendar/tasks not marked for offline usage. + + +2005-02-05 Harish Krishnaswamy <kharish@novell.com> + * gui/dialogs/comp-editor.c (attach_message), (drop_action), (drop_popup_copy), (drop_popup_move), (drop_popup_cancel), (drop_popup_free), (drag_data_received), (drag_motion), diff --git a/calendar/calendar-errors.xml b/calendar/calendar-errors.xml index 71e2f74618..f129da7e51 100644 --- a/calendar/calendar-errors.xml +++ b/calendar/calendar-errors.xml @@ -191,6 +191,18 @@ <button label="_Send" response="GTK_RESPONSE_YES"/> </error> + <error id="prompt-no-contents-offline-calendar" type="error" default="GTK_RESPONSE_YES"> + <primary>Error loading calendar</primary> + <secondary>The calendar is not marked for offline usage</secondary> + <button stock ="gtk-ok" response="GTK_RESPONSE_YES"/> + </error> + + <error id="prompt-no-contents-offline-tasks" type="error" default="GTK_RESPONSE_YES"> + <primary>Error loading task list</primary> + <secondary>The task list is not marked for offline usage</secondary> + <button stock ="gtk-ok" response="GTK_RESPONSE_YES"/> + </error> + <error id="server-version" type="warning"> <title>Server Version</title> <primary>Your server needs to be updated</primary> diff --git a/calendar/calendar-errors.xml.h b/calendar/calendar-errors.xml.h index e33134b27a..963f7d251d 100644 --- a/calendar/calendar-errors.xml.h +++ b/calendar/calendar-errors.xml.h @@ -130,6 +130,14 @@ char *s = N_("Are you sure you want to send the task without a summary?"); /* calendar:prompt-send-no-subject-task secondary */ char *s = N_("Adding a meaningful Summary to your task will give your recipients an idea of what your task is about."); char *s = N_("_Send"); +/* calendar:prompt-no-contents-offline-calendar primary */ +char *s = N_("Error loading calendar"); +/* calendar:prompt-no-contents-offline-calendar secondary */ +char *s = N_("The calendar is not marked for offline usage"); +/* calendar:prompt-no-contents-offline-tasks primary */ +char *s = N_("Error loading task list"); +/* calendar:prompt-no-contents-offline-tasks secondary */ +char *s = N_("The task list is not marked for offline usage"); /* calendar:server-version title */ char *s = N_("Server Version"); /* calendar:server-version primary */ diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index 9aaa939268..78ce565da1 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -817,6 +817,8 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, ETasks *tasks) break; case E_CALENDAR_STATUS_BUSY : break; + case E_CALENDAR_STATUS_REPOSITORY_OFFLINE: + e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks))), "calendar:prompt-no-contents-offline-tasks", NULL); default : /* Make sure the source doesn't disappear on us */ g_object_ref (source); diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index a01e26b6a2..7372c2c5c5 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -2170,6 +2170,7 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) ECalSourceType source_type; ESource *source; char *msg; + const char *id; int i; priv = gcal->priv; @@ -2177,29 +2178,39 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) source_type = e_cal_get_source_type (ecal); source = e_cal_get_source (ecal); - if (source_type == E_CAL_SOURCE_TYPE_EVENT) + switch (source_type) { + case E_CAL_SOURCE_TYPE_EVENT: + id = "calendar:prompt-no-contents-offline-calendar"; e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL); - else + break; + case E_CAL_SOURCE_TYPE_TODO: + id = "calendar:prompt-no-contents-offline-tasks"; e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), NULL); - - if (status == E_CALENDAR_STATUS_BUSY) + break; + default: + break; + } + switch (status) { + case E_CALENDAR_STATUS_OK: + break; + case E_CALENDAR_STATUS_BUSY: return; - - if (status == E_CALENDAR_STATUS_INVALID_SERVER_VERSION) { + case E_CALENDAR_STATUS_INVALID_SERVER_VERSION e_error_run (NULL, "calendar:server-version", NULL); status = E_CALENDAR_STATUS_OK; - } - if (status != E_CALENDAR_STATUS_OK) { + break; + case E_CALENDAR_STATUS_REPOSITORY_OFFLINE: + e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), id, NULL); + default: /* Make sure the source doesn't disappear on us */ g_object_ref (source); - + 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)); gtk_signal_emit (GTK_OBJECT (gcal), gnome_calendar_signals[SOURCE_REMOVED], source_type, source); - g_object_unref (source); - + return; } @@ -2267,18 +2278,18 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar break; } - if (status == E_CALENDAR_STATUS_BUSY) + switch (status) { + case E_CALENDAR_STATUS_OK: + break; + case E_CALENDAR_STATUS_BUSY: return; - - if (status == E_CALENDAR_STATUS_INVALID_SERVER_VERSION) { + case E_CALENDAR_STATUS_INVALID_SERVER_VERSION : e_error_run (NULL, "calendar:server-version", NULL); status = E_CALENDAR_STATUS_OK; - } - - if (status != E_CALENDAR_STATUS_OK) { + default: /* Make sure the source doesn't disappear on us */ g_object_ref (source); - + /* 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)); @@ -2286,11 +2297,10 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar /* FIXME Is there a better way to handle this? */ g_object_unref (priv->default_client[source_type]); priv->default_client[source_type] = NULL; - + gtk_signal_emit (GTK_OBJECT (gcal), gnome_calendar_signals[SOURCE_REMOVED], source_type, source); - g_object_unref (source); - + return; } |