aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-task-shell-view-actions.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-11-30 15:01:31 +0800
committerChenthill Palanisamy <pchenthill@novell.com>2009-11-30 15:01:31 +0800
commit0b1658ed7a215dad8295b02a30d5220011e199f1 (patch)
treef4e0b3727b468763adc3f63e9d15dab0e59a064a /modules/calendar/e-task-shell-view-actions.c
parentb9f0119ef5fb0a575253f9e3f1d3a5107ebc47c7 (diff)
downloadgsoc2013-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-task-shell-view-actions.c')
-rw-r--r--modules/calendar/e-task-shell-view-actions.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c
index 06177784ce..872cd785fe 100644
--- a/modules/calendar/e-task-shell-view-actions.c
+++ b/modules/calendar/e-task-shell-view-actions.c
@@ -323,6 +323,35 @@ action_task_list_properties_cb (GtkAction *action,
}
static void
+action_task_list_refresh_cb (GtkAction *action,
+ ETaskShellView *task_shell_view)
+{
+ ECal *client;
+ ECalModel *model;
+ ESource *source;
+ gchar *uri;
+ GError *error = NULL;
+
+ model = e_task_shell_content_get_task_model (task_shell_view->priv->task_shell_content);
+ source = e_source_selector_peek_primary_selection (e_task_shell_sidebar_get_selector (task_shell_view->priv->task_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_task_list_rename_cb (GtkAction *action,
ETaskShellView *task_shell_view)
{
@@ -748,6 +777,13 @@ static GtkActionEntry task_entries[] = {
NULL, /* XXX Add a tooltip! */
G_CALLBACK (action_task_list_properties_cb) },
+ { "task-list-refresh",
+ GTK_STOCK_REFRESH,
+ N_("Re_fresh"),
+ NULL,
+ N_("Refresh the selected task list"),
+ G_CALLBACK (action_task_list_refresh_cb) },
+
{ "task-list-rename",
NULL,
N_("_Rename..."),
@@ -835,6 +871,10 @@ static EPopupActionEntry task_popup_entries[] = {
NULL,
"task-list-properties" },
+ { "task-list-popup-refresh",
+ NULL,
+ "task-list-refresh" },
+
{ "task-list-popup-rename",
NULL,
"task-list-rename" },