aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-window-actions.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-09-03 03:21:35 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-09-03 03:26:49 +0800
commit53268d5516083c47607dbd3acbbd6bafd6d15747 (patch)
treec2a35758d36f00a2ce51633674c811eb1c5070ba /shell/e-shell-window-actions.c
parent5cbcdddfe769c0df81122b8d4944507f4739a618 (diff)
downloadgsoc2013-evolution-53268d5516083c47607dbd3acbbd6bafd6d15747.tar.gz
gsoc2013-evolution-53268d5516083c47607dbd3acbbd6bafd6d15747.tar.zst
gsoc2013-evolution-53268d5516083c47607dbd3acbbd6bafd6d15747.zip
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.
Diffstat (limited to 'shell/e-shell-window-actions.c')
-rw-r--r--shell/e-shell-window-actions.c51
1 files changed, 33 insertions, 18 deletions
diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c
index 54cd47ffa2..2fe4a17e0a 100644
--- a/shell/e-shell-window-actions.c
+++ b/shell/e-shell-window-actions.c
@@ -719,7 +719,8 @@ action_custom_rule_cb (GtkAction *action,
g_return_if_fail (IS_FILTER_RULE (rule));
e_shell_content_set_search_rule (shell_content, rule);
- gtk_action_activate (ACTION (SEARCH_EXECUTE));
+
+ e_shell_view_execute_search (shell_view);
}
/**
@@ -1024,7 +1025,7 @@ action_search_clear_cb (GtkAction *action,
e_shell_content_set_search_rule (shell_content, NULL);
e_shell_content_set_search_text (shell_content, NULL);
- gtk_action_activate (ACTION (SEARCH_EXECUTE));
+ e_shell_view_execute_search (shell_view);
e_shell_window_update_search_menu (shell_window);
}
@@ -1054,15 +1055,6 @@ action_search_edit_cb (GtkAction *action,
}
/**
- * E_SHELL_WINDOW_ACTION_SEARCH_EXECUTE:
- * @window: an #EShellWindow
- *
- * Activation of this action executes the current search conditions.
- *
- * Main menu item: Search -> Find Now
- **/
-
-/**
* E_SHELL_WINDOW_ACTION_SEARCH_OPTIONS:
* @window: an #EShellWindow
*
@@ -1087,6 +1079,27 @@ action_search_options_cb (GtkAction *action,
}
/**
+ * E_SHELL_WINDOW_ACTION_SEARCH_QUICK:
+ * @window: an #EShellWindow
+ *
+ * Activation of this action executes the current search conditions.
+ *
+ * Main menu item: Search -> Find Now
+ **/
+static void
+action_search_quick_cb (GtkAction *action,
+ EShellWindow *shell_window)
+{
+ EShellView *shell_view;
+ const gchar *view_name;
+
+ view_name = e_shell_window_get_active_view (shell_window);
+ shell_view = e_shell_window_get_shell_view (shell_window, view_name);
+
+ e_shell_view_execute_search (shell_view);
+}
+
+/**
* E_SHELL_WINDOW_ACTION_SEARCH_SAVE:
* @window: an #EShellWindow
*
@@ -1523,13 +1536,6 @@ static GtkActionEntry shell_entries[] = {
N_("Manage your saved searches"),
G_CALLBACK (action_search_edit_cb) },
- { "search-execute",
- GTK_STOCK_FIND,
- N_("_Find Now"),
- "", /* Block the default Ctrl+F. */
- N_("Execute the current search parameters"),
- NULL }, /* Handled by EShellContent and subclasses. */
-
{ "search-options",
GTK_STOCK_FIND,
NULL,
@@ -1537,6 +1543,13 @@ static GtkActionEntry shell_entries[] = {
N_("Click here to change the search type"),
G_CALLBACK (action_search_options_cb) },
+ { "search-quick",
+ GTK_STOCK_FIND,
+ N_("_Find Now"),
+ "", /* Block the default Ctrl+F. */
+ N_("Execute the current search parameters"),
+ G_CALLBACK (action_search_quick_cb) },
+
{ "search-save",
NULL,
N_("_Save Search..."),
@@ -1872,6 +1885,8 @@ e_shell_window_actions_init (EShellWindow *shell_window)
/* Fine tuning. */
+ gtk_action_set_sensitive (ACTION (SEARCH_QUICK), FALSE);
+
g_object_set (ACTION (SEND_RECEIVE), "is-important", TRUE, NULL);
e_binding_new (