#include <modest-ui-actions.h>
#include <modest-platform.h>
#include <modest-text-utils.h>
-#include <hildon/hildon-button.h>
-#include <hildon/hildon-program.h>
-#include <hildon/hildon-banner.h>
-#include <hildon/hildon-find-toolbar.h>
+#include <hildon/hildon.h>
#include <modest-ui-dimming-rules.h>
#include <modest-tny-folder.h>
#include <modest-tny-account.h>
GdkPixbuf *new_message_pixbuf;
GtkWidget *alignment;
gchar *account_display_name = NULL;
+#ifdef MODEST_TOOLKIT_HILDON2
+ GtkWidget *live_search;
+#endif
self = MODEST_HEADER_WINDOW(g_object_new(MODEST_TYPE_HEADER_WINDOW, NULL));
priv = MODEST_HEADER_WINDOW_GET_PRIVATE(self);
self);
priv->header_view = create_header_view (MODEST_WINDOW (self), folder);
+#ifdef MODEST_TOOLKIT_HILDON2
+ live_search = modest_header_view_setup_live_search (MODEST_HEADER_VIEW (priv->header_view));
+ hildon_live_search_widget_hook (HILDON_LIVE_SEARCH (live_search), GTK_WIDGET (self), priv->header_view);
+#endif
priv->empty_view = create_empty_view (MODEST_WINDOW (self));
/* Transform the floating reference in a "hard" reference. We
priv->top_vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (alignment), priv->contents_view);
+#ifdef MODEST_TOOLKIT_HILDON2
+ gtk_box_pack_end (GTK_BOX (priv->top_vbox), live_search, FALSE, FALSE, 0);
+#endif
gtk_box_pack_end (GTK_BOX (priv->top_vbox), alignment, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (self), priv->top_vbox);
#include <modest-defs.h>
#include <modest-ui-actions.h>
#include <modest-window.h>
-#include <hildon/hildon-program.h>
-#include <hildon/hildon-banner.h>
-#include <hildon/hildon-button.h>
+#include <hildon/hildon.h>
#include <tny-account-store-view.h>
#include <modest-header-window.h>
#include <modest-ui-dimming-rules.h>
GdkModifierType accel_mods;
GtkAccelGroup *accel_group;
GtkWidget *top_alignment;
+#ifdef MODEST_TOOLKIT_HILDON2
+ GtkWidget *live_search;
+#endif
self = MODEST_MAILBOXES_WINDOW(g_object_new(MODEST_TYPE_MAILBOXES_WINDOW, NULL));
priv = MODEST_MAILBOXES_WINDOW_GET_PRIVATE(self);
self);
priv->folder_view = modest_platform_create_folder_view (NULL);
+#ifdef MODEST_TOOLKIT_HILDON2
+ live_search = modest_folder_view_setup_live_search (MODEST_FOLDER_VIEW (priv->folder_view));
+ hildon_live_search_widget_hook (HILDON_LIVE_SEARCH (live_search), GTK_WIDGET (self), priv->folder_view);
+#endif
modest_folder_view_set_cell_style (MODEST_FOLDER_VIEW (priv->folder_view),
MODEST_FOLDER_VIEW_CELL_STYLE_COMPACT);
modest_folder_view_set_filter (MODEST_FOLDER_VIEW (priv->folder_view),
gtk_container_add (GTK_CONTAINER (pannable), priv->folder_view);
gtk_box_pack_end (GTK_BOX (priv->top_vbox), pannable, TRUE, TRUE, 0);
+#ifdef MODEST_TOOLKIT_HILDON2
+ gtk_box_pack_end (GTK_BOX (priv->top_vbox), live_search, FALSE, FALSE, 0);
+#endif
gtk_container_add (GTK_CONTAINER (top_alignment), priv->top_vbox);
gtk_container_add (GTK_CONTAINER (self), top_alignment);
#include <modest-vbox-cell-renderer.h>
#include <modest-datetime-formatter.h>
#include <modest-ui-constants.h>
+#ifdef MODEST_TOOLKIT_HILDON2
+#include <hildon/hildon.h>
+#endif
static void modest_header_view_class_init (ModestHeaderViewClass *klass);
static void modest_header_view_init (ModestHeaderView *obj);
guint n_selected;
GtkTreeRowReference *autoselect_reference;
ModestHeaderViewFilter filter;
+#ifdef MODEST_TOOLKIT_HILDON2
+ GtkWidget *live_search;
+#endif
gint sort_colid[2][TNY_FOLDER_TYPE_NUM];
gint sort_type[2][TNY_FOLDER_TYPE_NUM];
priv->hidding_ids = NULL;
priv->n_selected = 0;
priv->filter = MODEST_HEADER_VIEW_FILTER_NONE;
+#ifdef MODEST_TOOLKIT_HILDON2
+ priv->live_search = NULL;
+#endif
priv->filter_string = NULL;
priv->filter_string_splitted = NULL;
priv->filter_date_range = FALSE;
}
modest_header_view_refilter (MODEST_HEADER_VIEW (self));
}
+
+#ifdef MODEST_TOOLKIT_HILDON2
+static gboolean
+on_live_search_refilter (HildonLiveSearch *livesearch,
+ ModestHeaderView *self)
+{
+ const gchar *needle;
+
+ needle = hildon_live_search_get_text (livesearch);
+ if (needle && needle[0] != '\0') {
+ modest_header_view_set_filter_string (MODEST_HEADER_VIEW (self), needle);
+ } else {
+ modest_header_view_set_filter_string (MODEST_HEADER_VIEW (self), NULL);
+ }
+
+ return TRUE;
+}
+
+GtkWidget *
+modest_header_view_setup_live_search (ModestHeaderView *self)
+{
+ ModestHeaderViewPrivate *priv;
+
+ g_return_val_if_fail (MODEST_IS_HEADER_VIEW (self), NULL);
+ priv = MODEST_HEADER_VIEW_GET_PRIVATE (self);
+ priv->live_search = hildon_live_search_new ();
+
+ g_signal_connect (G_OBJECT (priv->live_search), "refilter", G_CALLBACK (on_live_search_refilter), self);
+
+ return priv->live_search;
+}
+#endif
gint modest_header_view_get_show_latest (ModestHeaderView *header_view);
gint modest_header_view_get_not_latest (ModestHeaderView *header_view);
+#ifdef MODEST_TOOLKIT_HILDON2
+GtkWidget *modest_header_view_setup_live_search (ModestHeaderView *self);
+#endif
+
G_END_DECLS