From 53268d5516083c47607dbd3acbbd6bafd6d15747 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 2 Sep 2009 15:21:35 -0400 Subject: Introduce an EShellView::execute-search signal. This addresses bug #593896 but is also a cleaner design than before. It introduces an EShellView::execute-search signal and renames the "search-execute" action to "search-quick" to clarify that it's only meant for the "quick" search bar in the main window. Shell view subclasses should implement the execute_search() method to actually execute a search. e_shell_view_execute_search() emits the new signal. --- modules/addressbook/e-book-shell-view-actions.c | 30 ++----------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'modules/addressbook/e-book-shell-view-actions.c') diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index bbe613786f..1d875ba91a 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -581,34 +581,12 @@ action_gal_save_custom_view_cb (GtkAction *action, gal_view_instance_save_as (view_instance); } -static void -action_search_execute_cb (GtkAction *action, - EBookShellView *book_shell_view) -{ - EShellView *shell_view; - - /* All shell views respond to the activation of this action, - * which is defined by EShellWindow. But only the currently - * active shell view proceeds with executing the search. */ - shell_view = E_SHELL_VIEW (book_shell_view); - if (!e_shell_view_is_active (shell_view)) - return; - - e_book_shell_view_execute_search (book_shell_view); -} - static void action_search_filter_cb (GtkRadioAction *action, GtkRadioAction *current, - EBookShellView *book_shell_view) + EShellView *shell_view) { - EShellView *shell_view; - EShellWindow *shell_window; - - shell_view = E_SHELL_VIEW (book_shell_view); - shell_window = e_shell_view_get_shell_window (shell_view); - - gtk_action_activate (ACTION (SEARCH_EXECUTE)); + e_shell_view_execute_search (shell_view); } static GtkActionEntry contact_entries[] = { @@ -1004,10 +982,6 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) ACTION (GAL_SAVE_CUSTOM_VIEW), "activate", G_CALLBACK (action_gal_save_custom_view_cb), book_shell_view); - g_signal_connect ( - ACTION (SEARCH_EXECUTE), "activate", - G_CALLBACK (action_search_execute_cb), book_shell_view); - e_binding_new ( ACTION (CONTACT_PREVIEW), "active", ACTION (CONTACT_VIEW_CLASSIC), "sensitive"); -- cgit v1.2.3