aboutsummaryrefslogtreecommitdiffstats
path: root/modules/addressbook/e-book-shell-view.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-06-15 23:28:46 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-06-15 23:32:27 +0800
commit1489dc4fd85172be1604b03666a5538ef8015bc7 (patch)
tree73aab65e641c1e264a5df9bd87a54bf223f41980 /modules/addressbook/e-book-shell-view.c
parenta3048b477f44f3d854c32cb12cbf3022c2ca7336 (diff)
downloadgsoc2013-evolution-1489dc4fd85172be1604b03666a5538ef8015bc7.tar
gsoc2013-evolution-1489dc4fd85172be1604b03666a5538ef8015bc7.tar.gz
gsoc2013-evolution-1489dc4fd85172be1604b03666a5538ef8015bc7.tar.bz2
gsoc2013-evolution-1489dc4fd85172be1604b03666a5538ef8015bc7.tar.lz
gsoc2013-evolution-1489dc4fd85172be1604b03666a5538ef8015bc7.tar.xz
gsoc2013-evolution-1489dc4fd85172be1604b03666a5538ef8015bc7.tar.zst
gsoc2013-evolution-1489dc4fd85172be1604b03666a5538ef8015bc7.zip
Disable 'Rename' if source is a collection member.
For consistency with the Preferences window. We assume the display names are server-assigned and not user-assigned, at least not assigned through Evolution.
Diffstat (limited to 'modules/addressbook/e-book-shell-view.c')
-rw-r--r--modules/addressbook/e-book-shell-view.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/addressbook/e-book-shell-view.c b/modules/addressbook/e-book-shell-view.c
index 53136c2e02..c8ef07441d 100644
--- a/modules/addressbook/e-book-shell-view.c
+++ b/modules/addressbook/e-book-shell-view.c
@@ -201,8 +201,9 @@ book_shell_view_update_actions (EShellView *shell_view)
gboolean any_contacts_selected;
gboolean has_primary_source;
gboolean multiple_contacts_selected;
- gboolean primary_source_is_removable;
gboolean primary_source_is_writable;
+ gboolean primary_source_is_removable;
+ gboolean primary_source_in_collection;
gboolean single_contact_selected;
gboolean selection_is_contact_list;
gboolean selection_has_email;
@@ -235,10 +236,12 @@ book_shell_view_update_actions (EShellView *shell_view)
has_primary_source =
(state & E_BOOK_SHELL_SIDEBAR_HAS_PRIMARY_SOURCE);
- primary_source_is_removable =
- (state & E_BOOK_SHELL_SIDEBAR_PRIMARY_SOURCE_IS_REMOVABLE);
primary_source_is_writable =
(state & E_BOOK_SHELL_SIDEBAR_PRIMARY_SOURCE_IS_WRITABLE);
+ primary_source_is_removable =
+ (state & E_BOOK_SHELL_SIDEBAR_PRIMARY_SOURCE_IS_REMOVABLE);
+ primary_source_in_collection =
+ (state & E_BOOK_SHELL_SIDEBAR_PRIMARY_SOURCE_IN_COLLECTION);
any_contacts_selected =
(single_contact_selected || multiple_contacts_selected);
@@ -264,7 +267,9 @@ book_shell_view_update_actions (EShellView *shell_view)
gtk_action_set_sensitive (action, sensitive);
action = ACTION (ADDRESS_BOOK_RENAME);
- sensitive = primary_source_is_writable;
+ sensitive =
+ primary_source_is_writable &&
+ !primary_source_in_collection;
gtk_action_set_sensitive (action, sensitive);
action = ACTION (ADDRESS_BOOK_STOP);