aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/addressbook/e-book-shell-view-actions.c24
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);
}