aboutsummaryrefslogtreecommitdiffstats
path: root/modules/addressbook
diff options
context:
space:
mode:
Diffstat (limited to 'modules/addressbook')
-rw-r--r--modules/addressbook/e-book-shell-content.c6
-rw-r--r--modules/addressbook/e-book-shell-content.h3
-rw-r--r--modules/addressbook/e-book-shell-view.c5
3 files changed, 12 insertions, 2 deletions
diff --git a/modules/addressbook/e-book-shell-content.c b/modules/addressbook/e-book-shell-content.c
index 898bd2df39..4eccc971df 100644
--- a/modules/addressbook/e-book-shell-content.c
+++ b/modules/addressbook/e-book-shell-content.c
@@ -24,6 +24,7 @@
#include <glib/gi18n.h>
#include "e-util/e-binding.h"
+#include "e-util/e-selection.h"
#include "e-util/gconf-bridge.h"
#include "widgets/misc/e-paned.h"
@@ -258,6 +259,7 @@ book_shell_content_check_state (EShellContent *shell_content)
ESelectionModel *selection_model;
EAddressbookModel *model;
EAddressbookView *view;
+ GtkClipboard *clipboard;
guint32 state = 0;
gint n_contacts;
gint n_selected;
@@ -272,6 +274,8 @@ book_shell_content_check_state (EShellContent *shell_content)
n_selected = (selection_model != NULL) ?
e_selection_model_selected_count (selection_model) : 0;
+ clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
+
/* FIXME Finish the rest of the flags. */
if (n_selected == 1)
state |= E_BOOK_SHELL_CONTENT_SELECTION_SINGLE;
@@ -283,6 +287,8 @@ book_shell_content_check_state (EShellContent *shell_content)
state |= E_BOOK_SHELL_CONTENT_SOURCE_IS_EDITABLE;
if (n_contacts == 0)
state |= E_BOOK_SHELL_CONTENT_SOURCE_IS_EMPTY;
+ if (e_clipboard_wait_is_directory_available (clipboard))
+ state |= E_BOOK_SHELL_CONTENT_CLIPBOARD_HAS_DIRECTORY;
return state;
}
diff --git a/modules/addressbook/e-book-shell-content.h b/modules/addressbook/e-book-shell-content.h
index da78c01274..31f8c35838 100644
--- a/modules/addressbook/e-book-shell-content.h
+++ b/modules/addressbook/e-book-shell-content.h
@@ -64,7 +64,8 @@ enum {
E_BOOK_SHELL_CONTENT_SELECTION_HAS_MAILTO_URI = 1 << 5,
E_BOOK_SHELL_CONTENT_SOURCE_IS_BUSY = 1 << 6,
E_BOOK_SHELL_CONTENT_SOURCE_IS_EDITABLE = 1 << 7,
- E_BOOK_SHELL_CONTENT_SOURCE_IS_EMPTY = 1 << 8
+ E_BOOK_SHELL_CONTENT_SOURCE_IS_EMPTY = 1 << 8,
+ E_BOOK_SHELL_CONTENT_CLIPBOARD_HAS_DIRECTORY = 1 << 9
};
struct _EBookShellContent {
diff --git a/modules/addressbook/e-book-shell-view.c b/modules/addressbook/e-book-shell-view.c
index 8ea97caddc..88a503b024 100644
--- a/modules/addressbook/e-book-shell-view.c
+++ b/modules/addressbook/e-book-shell-view.c
@@ -246,6 +246,7 @@ book_shell_view_update_actions (EShellView *shell_view)
gboolean source_is_busy;
gboolean source_is_editable;
gboolean source_is_empty;
+ gboolean clipboard_has_directory;
priv = E_BOOK_SHELL_VIEW_GET_PRIVATE (shell_view);
@@ -268,6 +269,8 @@ book_shell_view_update_actions (EShellView *shell_view)
(state & E_BOOK_SHELL_CONTENT_SOURCE_IS_EDITABLE);
source_is_empty =
(state & E_BOOK_SHELL_CONTENT_SOURCE_IS_EMPTY);
+ clipboard_has_directory =
+ (state & E_BOOK_SHELL_CONTENT_CLIPBOARD_HAS_DIRECTORY);
shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
state = e_shell_sidebar_check_state (shell_sidebar);
@@ -301,7 +304,7 @@ book_shell_view_update_actions (EShellView *shell_view)
gtk_action_set_sensitive (action, sensitive);
action = ACTION (CONTACT_CLIPBOARD_PASTE);
- sensitive = source_is_editable;
+ sensitive = source_is_editable && clipboard_has_directory;
gtk_action_set_sensitive (action, sensitive);
action = ACTION (CONTACT_COPY);