diff options
author | Milan Crha <mcrha@redhat.com> | 2009-11-30 15:01:31 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchenthill@novell.com> | 2009-11-30 15:01:31 +0800 |
commit | 0b1658ed7a215dad8295b02a30d5220011e199f1 (patch) | |
tree | f4e0b3727b468763adc3f63e9d15dab0e59a064a /modules/calendar/e-cal-shell-view-actions.c | |
parent | b9f0119ef5fb0a575253f9e3f1d3a5107ebc47c7 (diff) | |
download | gsoc2013-evolution-0b1658ed7a215dad8295b02a30d5220011e199f1.tar gsoc2013-evolution-0b1658ed7a215dad8295b02a30d5220011e199f1.tar.gz gsoc2013-evolution-0b1658ed7a215dad8295b02a30d5220011e199f1.tar.bz2 gsoc2013-evolution-0b1658ed7a215dad8295b02a30d5220011e199f1.tar.lz gsoc2013-evolution-0b1658ed7a215dad8295b02a30d5220011e199f1.tar.xz gsoc2013-evolution-0b1658ed7a215dad8295b02a30d5220011e199f1.tar.zst gsoc2013-evolution-0b1658ed7a215dad8295b02a30d5220011e199f1.zip |
Bug 494394 - No way for the user to refresh a calendar
Diffstat (limited to 'modules/calendar/e-cal-shell-view-actions.c')
-rw-r--r-- | modules/calendar/e-cal-shell-view-actions.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c index 68da6b2643..a8c8fc1ea4 100644 --- a/modules/calendar/e-cal-shell-view-actions.c +++ b/modules/calendar/e-cal-shell-view-actions.c @@ -350,6 +350,35 @@ exit: } static void +action_calendar_refresh_cb (GtkAction *action, + ECalShellView *cal_shell_view) +{ + ECal *client; + ECalModel *model; + ESource *source; + gchar *uri; + GError *error = NULL; + + model = e_cal_shell_content_get_model (cal_shell_view->priv->cal_shell_content); + source = e_source_selector_peek_primary_selection (e_cal_shell_sidebar_get_selector (cal_shell_view->priv->cal_shell_sidebar)); + g_return_if_fail (E_IS_SOURCE (source)); + + uri = e_source_get_uri (source); + client = e_cal_model_get_client_for_uri (model, uri); + g_free (uri); + + if (client == NULL) + return; + + g_return_if_fail (e_cal_get_refresh_supported (client)); + + if (!e_cal_refresh (client, &error) && error) { + g_warning ("%s: Failed to refresh '%s', %s\n", G_STRFUNC, e_source_peek_name (source), error->message); + g_error_free (error); + } +} + +static void action_calendar_rename_cb (GtkAction *action, ECalShellView *cal_shell_view) { @@ -1264,6 +1293,13 @@ static GtkActionEntry calendar_entries[] = { N_("Purge old appointments and meetings"), G_CALLBACK (action_calendar_purge_cb) }, + { "calendar-refresh", + GTK_STOCK_REFRESH, + N_("Re_fresh"), + NULL, + N_("Refresh the selected calendar"), + G_CALLBACK (action_calendar_refresh_cb) }, + { "calendar-rename", NULL, N_("_Rename..."), @@ -1454,6 +1490,10 @@ static EPopupActionEntry calendar_popup_entries[] = { NULL, "calendar-properties" }, + { "calendar-popup-refresh", + NULL, + "calendar-refresh" }, + { "calendar-popup-rename", NULL, "calendar-rename" }, |