diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-09-01 23:07:20 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-09-01 23:07:20 +0800 |
commit | f945e649d2337c0491ec8434ef83364dca30c1f8 (patch) | |
tree | 3b0a5ec49744afeff5dae548e53fe083303ec014 | |
parent | 2e998320e1aa7f68d995147e46b51a223afbe92e (diff) | |
download | gsoc2013-evolution-f945e649d2337c0491ec8434ef83364dca30c1f8.tar.gz gsoc2013-evolution-f945e649d2337c0491ec8434ef83364dca30c1f8.tar.zst gsoc2013-evolution-f945e649d2337c0491ec8434ef83364dca30c1f8.zip |
Bug 593778 - Clear search enabled when it shouldn't be
-rw-r--r-- | shell/e-shell-content.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 2fc9569bd2..4e32765e35 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -102,6 +102,7 @@ action_search_execute_cb (GtkAction *action, EShellWindow *shell_window; GtkWidget *widget; const gchar *search_text; + gboolean sensitive; /* EShellView subclasses are responsible for actually * executing the search. This is all cosmetic stuff. */ @@ -132,8 +133,18 @@ action_search_execute_cb (GtkAction *action, gtk_widget_modify_base (widget, GTK_STATE_NORMAL, NULL); } + /* XXX The intent here is to distinguish between custom searches + * and stock searches (from the "Show" combo) and only enable + * the "search-clear" action for custom searches. I'm not + * sure this logic is adequate though. It needs to account + * for quick searches, advanced searches and saved searches. + * We'll probably wind up having to explicitly say whether + * the search is custom, but this is good enough for now. */ + sensitive = + (search_text != NULL && *search_text != '\0') || + (e_shell_content_get_search_rule (shell_content) != NULL); action = E_SHELL_WINDOW_ACTION_SEARCH_CLEAR (shell_window); - gtk_action_set_sensitive (action, TRUE); + gtk_action_set_sensitive (action, sensitive); action = E_SHELL_WINDOW_ACTION_SEARCH_SAVE (shell_window); gtk_action_set_sensitive (action, TRUE); |