diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-07-26 22:42:41 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-08-03 23:40:13 +0800 |
commit | 53aa02a92369bd04eae2b1cf1e31dfc8f32044a8 (patch) | |
tree | a5cc445ccc469d60c6c7f2c71f55ca0f68e677eb /modules/addressbook | |
parent | 6055337bbac4e516c2c5b41b965fbffce6cf69c6 (diff) | |
download | gsoc2013-evolution-53aa02a92369bd04eae2b1cf1e31dfc8f32044a8.tar.gz gsoc2013-evolution-53aa02a92369bd04eae2b1cf1e31dfc8f32044a8.tar.zst gsoc2013-evolution-53aa02a92369bd04eae2b1cf1e31dfc8f32044a8.zip |
e-book-shell-view-actions.c: Support deleting remote resources.
Diffstat (limited to 'modules/addressbook')
-rw-r--r-- | modules/addressbook/e-book-shell-view-actions.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index 8a319d51ff..54865b7e39 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -63,16 +63,28 @@ action_address_book_delete_cb (GtkAction *action, book_shell_sidebar = book_shell_view->priv->book_shell_sidebar; selector = e_book_shell_sidebar_get_selector (book_shell_sidebar); + source = e_source_selector_ref_primary_selection (selector); g_return_if_fail (source != NULL); - response = e_alert_run_dialog_for_args ( - GTK_WINDOW (shell_window), - "addressbook:ask-delete-addressbook", - 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), + "addressbook:ask-delete-remote-addressbook", + e_source_get_display_name (source), NULL); + + if (response == GTK_RESPONSE_YES) + e_shell_view_remote_delete_source (shell_view, source); - if (response == GTK_RESPONSE_YES) - e_shell_view_remove_source (shell_view, source); + } else { + response = e_alert_run_dialog_for_args ( + GTK_WINDOW (shell_window), + "addressbook:ask-delete-addressbook", + e_source_get_display_name (source), NULL); + + if (response == GTK_RESPONSE_YES) + e_shell_view_remove_source (shell_view, source); + } g_object_unref (source); } |