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-memo-shell-view-actions.c | |
parent | b9f0119ef5fb0a575253f9e3f1d3a5107ebc47c7 (diff) | |
download | gsoc2013-evolution-0b1658ed7a215dad8295b02a30d5220011e199f1.tar.gz 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-memo-shell-view-actions.c')
-rw-r--r-- | modules/calendar/e-memo-shell-view-actions.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c index 734a7c522d..c36b4569c4 100644 --- a/modules/calendar/e-memo-shell-view-actions.c +++ b/modules/calendar/e-memo-shell-view-actions.c @@ -292,6 +292,35 @@ action_memo_list_properties_cb (GtkAction *action, } static void +action_memo_list_refresh_cb (GtkAction *action, + EMemoShellView *memo_shell_view) +{ + ECal *client; + ECalModel *model; + ESource *source; + gchar *uri; + GError *error = NULL; + + model = e_memo_shell_content_get_memo_model (memo_shell_view->priv->memo_shell_content); + source = e_source_selector_peek_primary_selection (e_memo_shell_sidebar_get_selector (memo_shell_view->priv->memo_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_memo_list_rename_cb (GtkAction *action, EMemoShellView *memo_shell_view) { @@ -624,6 +653,13 @@ static GtkActionEntry memo_entries[] = { NULL, /* XXX Add a tooltip! */ G_CALLBACK (action_memo_list_properties_cb) }, + { "memo-list-refresh", + GTK_STOCK_REFRESH, + N_("Re_fresh"), + NULL, + N_("Refresh the selected memo list"), + G_CALLBACK (action_memo_list_refresh_cb) }, + { "memo-list-rename", NULL, N_("_Rename..."), @@ -683,6 +719,10 @@ static EPopupActionEntry memo_popup_entries[] = { NULL, "memo-list-properties" }, + { "memo-list-popup-refresh", + NULL, + "memo-list-refresh" }, + { "memo-list-popup-rename", NULL, "memo-list-rename" }, |