diff options
author | Milan Crha <mcrha@redhat.com> | 2009-12-18 01:17:21 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2009-12-18 01:17:21 +0800 |
commit | fe15c797a036820ac4b5e8cf232ad0a559fcd06b (patch) | |
tree | 52b9861302be476ee9671212233ea562d93634e3 /shell/e-shell-view.c | |
parent | 858c42577c240a3ae83feaa6f5bb7c696da8df43 (diff) | |
download | gsoc2013-evolution-fe15c797a036820ac4b5e8cf232ad0a559fcd06b.tar.gz gsoc2013-evolution-fe15c797a036820ac4b5e8cf232ad0a559fcd06b.tar.zst gsoc2013-evolution-fe15c797a036820ac4b5e8cf232ad0a559fcd06b.zip |
Bug #603184 - Various problems with search box in folders
Diffstat (limited to 'shell/e-shell-view.c')
-rw-r--r-- | shell/e-shell-view.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 8ee65e0e4f..2439706224 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -52,6 +52,8 @@ struct _EShellViewPrivate { GtkWidget *shell_content; GtkWidget *shell_sidebar; GtkWidget *shell_taskbar; + + guint execute_search_blocked; }; enum { @@ -1121,7 +1123,40 @@ e_shell_view_execute_search (EShellView *shell_view) { g_return_if_fail (E_IS_SHELL_VIEW (shell_view)); - g_signal_emit (shell_view, signals[EXECUTE_SEARCH], 0); + if (!shell_view->priv->execute_search_blocked) + g_signal_emit (shell_view, signals[EXECUTE_SEARCH], 0); +} + +/** + * e_shell_view_block_execute_search: + * @shell_view: an #EShellView + * + * Blocks e_shell_view_execute_search in a way it does nothing. + * Pair function for this is e_shell_view_unblock_execute_search. + **/ +void +e_shell_view_block_execute_search (EShellView *shell_view) +{ + g_return_if_fail (E_IS_SHELL_VIEW (shell_view)); + g_return_if_fail (shell_view->priv->execute_search_blocked + 1 != 0); + + shell_view->priv->execute_search_blocked++; +} + +/** + * e_shell_view_unblock_execute_search: + * @shell_view: an #EShellView + * + * Unblocks previously blocked e_shell_view_execute_search with + * function e_shell_view_block_execute_search. + **/ +void +e_shell_view_unblock_execute_search (EShellView *shell_view) +{ + g_return_if_fail (E_IS_SHELL_VIEW (shell_view)); + g_return_if_fail (shell_view->priv->execute_search_blocked > 0); + + shell_view->priv->execute_search_blocked--; } /** |