aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-view.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-view.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-view.c')
-rw-r--r--shell/e-shell-view.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 5808f9e027..9b740d49a1 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -69,6 +69,7 @@ enum {
enum {
TOGGLED,
+ EXECUTE_SEARCH,
UPDATE_ACTIONS,
LAST_SIGNAL
};
@@ -672,6 +673,23 @@ shell_view_class_init (EShellViewClass *class)
G_TYPE_NONE, 0);
/**
+ * EShellView::execute-search
+ * @shell_view: the #EShellView which emitted the signal
+ *
+ * #EShellView subclasses should override the
+ * <structfield>execute_search</structfield> method in
+ * #EShellViewClass to execute the current search conditions.
+ **/
+ signals[EXECUTE_SEARCH] = g_signal_new (
+ "execute-search",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (EShellViewClass, execute_search),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
* EShellView::update-actions
* @shell_view: the #EShellView which emitted the signal
*
@@ -1097,6 +1115,24 @@ e_shell_view_set_state_dirty (EShellView *shell_view)
}
/**
+ * e_shell_view_execute_search:
+ * @shell_view: an #EShellView
+ *
+ * Emits the #EShellView:;execute-search signal.
+ *
+ * #EShellView subclasses should implement the
+ * <structfield>execute_search</structfield> method in #EShellViewClass
+ * to execute a search based on the current search conditions.
+ **/
+void
+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);
+}
+
+/**
* e_shell_view_update_actions:
* @shell_view: an #EShellView
*