From 78fd379aa7c17c60c4b5fc07e5243b32ec4a2639 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 31 Oct 2008 12:54:01 +0000 Subject: Support inline renaming of sources in the source selector, with help from evolution-data-server (see bug #558322). Kill another frivolous plugin: select-one-source svn path=/branches/kill-bonobo/; revision=36705 --- .../gui/component/e-book-shell-view-actions.c | 20 ++++++++++++++++++++ addressbook/gui/component/e-book-shell-view.c | 4 ++++ 2 files changed, 24 insertions(+) (limited to 'addressbook/gui') diff --git a/addressbook/gui/component/e-book-shell-view-actions.c b/addressbook/gui/component/e-book-shell-view-actions.c index 6085bc5d82..15838f96bc 100644 --- a/addressbook/gui/component/e-book-shell-view-actions.c +++ b/addressbook/gui/component/e-book-shell-view-actions.c @@ -172,6 +172,19 @@ action_address_book_properties_cb (GtkAction *action, gtk_window_present (GTK_WINDOW (closure->editor)); } +static void +action_address_book_rename_cb (GtkAction *action, + EBookShellView *book_shell_view) +{ + EBookShellSidebar *book_shell_sidebar; + ESourceSelector *selector; + + book_shell_sidebar = book_shell_view->priv->book_shell_sidebar; + selector = e_book_shell_sidebar_get_selector (book_shell_sidebar); + + e_source_selector_edit_primary_selection (selector); +} + static void action_address_book_save_as_cb (GtkAction *action, EBookShellView *book_shell_view) @@ -523,6 +536,13 @@ static GtkActionEntry contact_entries[] = { N_("Show properties of the selected address book"), G_CALLBACK (action_address_book_properties_cb) }, + { "address-book-rename", + NULL, + N_("_Rename..."), + "F2", + N_("Rename the selected address book"), + G_CALLBACK (action_address_book_rename_cb) }, + { "address-book-save-as", GTK_STOCK_SAVE_AS, N_("S_ave Address Book as vCard"), diff --git a/addressbook/gui/component/e-book-shell-view.c b/addressbook/gui/component/e-book-shell-view.c index fc5c6d7a7f..601ce3b596 100644 --- a/addressbook/gui/component/e-book-shell-view.c +++ b/addressbook/gui/component/e-book-shell-view.c @@ -197,6 +197,10 @@ book_shell_view_update_actions (EShellView *shell_view) sensitive = has_primary_source && !primary_source_is_system; gtk_action_set_sensitive (action, sensitive); + action = ACTION (ADDRESS_BOOK_RENAME); + sensitive = has_primary_source; + gtk_action_set_sensitive (action, sensitive); + action = ACTION (ADDRESS_BOOK_STOP); sensitive = source_is_busy; gtk_action_set_sensitive (action, sensitive); -- cgit v1.2.3