diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-07-26 23:44:53 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-08-03 23:40:14 +0800 |
commit | 5a05dd7b319b2f2f3a236f7e492e317558e093d0 (patch) | |
tree | b2be7fb6746a93f7c7d82c0b96294c29b8b3292e /modules | |
parent | bb8597fa1b24fe4865cfa413a53ebee1cdcebcda (diff) | |
download | gsoc2013-evolution-5a05dd7b319b2f2f3a236f7e492e317558e093d0.tar.gz gsoc2013-evolution-5a05dd7b319b2f2f3a236f7e492e317558e093d0.tar.zst gsoc2013-evolution-5a05dd7b319b2f2f3a236f7e492e317558e093d0.zip |
e-memo-shell-view-actions.c: Support deleting remote resources.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/calendar/e-memo-shell-view-actions.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c index 689d65c796..4a433a6f88 100644 --- a/modules/calendar/e-memo-shell-view-actions.c +++ b/modules/calendar/e-memo-shell-view-actions.c @@ -150,8 +150,8 @@ action_memo_list_delete_cb (GtkAction *action, EMemoShellSidebar *memo_shell_sidebar; EShellWindow *shell_window; EShellView *shell_view; - ESourceSelector *selector; ESource *source; + ESourceSelector *selector; gint response; shell_view = E_SHELL_VIEW (memo_shell_view); @@ -159,27 +159,28 @@ action_memo_list_delete_cb (GtkAction *action, memo_shell_sidebar = memo_shell_view->priv->memo_shell_sidebar; selector = e_memo_shell_sidebar_get_selector (memo_shell_sidebar); + source = e_source_selector_ref_primary_selection (selector); g_return_if_fail (source != NULL); - /* Ask for confirmation. */ - response = e_alert_run_dialog_for_args ( - GTK_WINDOW (shell_window), - "calendar:prompt-delete-memo-list", - e_source_get_display_name (source), NULL); + if (e_source_get_remote_deletable (source)) { + response = e_alert_run_dialog_for_args ( + GTK_WINDOW (shell_window), + "calendar:prompt-delete-remote-memo-list", + e_source_get_display_name (source), NULL); - if (response != GTK_RESPONSE_YES) { - g_object_unref (source); - return; - } + if (response == GTK_RESPONSE_YES) + e_shell_view_remote_delete_source (shell_view, source); - if (e_source_selector_source_is_selected (selector, source)) { - e_memo_shell_sidebar_remove_source ( - memo_shell_sidebar, source); - e_source_selector_unselect_source (selector, source); - } + } else { + response = e_alert_run_dialog_for_args ( + GTK_WINDOW (shell_window), + "calendar:prompt-delete-memo-list", + e_source_get_display_name (source), NULL); - e_shell_view_remove_source (shell_view, source); + if (response != GTK_RESPONSE_YES) + e_shell_view_remove_source (shell_view, source); + } g_object_unref (source); } |