X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-mailboxes-window.c;h=79d36d22457cafdfa34cb1145818a2cb426732ad;hp=a0424e451926abd8111766d23fbab2fc343e5f4e;hb=4ac82888b5c52ca3c6ccc6d44675f171fc6abeac;hpb=eb3a68c74a62ff31e74cadf566613ba419cec98d diff --git a/src/widgets/modest-mailboxes-window.c b/src/widgets/modest-mailboxes-window.c index a0424e4..79d36d2 100644 --- a/src/widgets/modest-mailboxes-window.c +++ b/src/widgets/modest-mailboxes-window.c @@ -80,9 +80,11 @@ static void on_queue_changed (ModestMailOperationQueue *queue, static void on_activity_changed (ModestFolderView *view, gboolean activity, ModestMailboxesWindow *folder_window); +#ifdef MODEST_TOOLKIT_HILDON2 static gboolean on_key_press(GtkWidget *widget, - GdkEventKey *event, - gpointer user_data); + GdkEventKey *event, + gpointer user_data); +#endif typedef struct _ModestMailboxesWindowPrivate ModestMailboxesWindowPrivate; struct _ModestMailboxesWindowPrivate { @@ -128,7 +130,7 @@ modest_mailboxes_window_get_type (void) #ifdef MODEST_TOOLKIT_HILDON2 MODEST_TYPE_HILDON2_WINDOW, #else - MODEST_TYPE_WINDOW, + MODEST_TYPE_SHELL_WINDOW, #endif "ModestMailboxesWindow", &my_info, 0); @@ -266,9 +268,11 @@ connect_signals (ModestMailboxesWindow *self) "clicked", G_CALLBACK (modest_ui_actions_on_new_msg), self); +#ifdef MODEST_TOOLKIT_HILDON2 /* connect window keys -> priv->folder_view scroll here? */ g_signal_connect(G_OBJECT(self), "key-press-event", G_CALLBACK(on_key_press), self); +#endif } ModestWindow * @@ -279,6 +283,9 @@ modest_mailboxes_window_new (const gchar *account) GdkPixbuf *window_icon; GtkWidget *scrollable; 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); @@ -291,6 +298,10 @@ modest_mailboxes_window_new (const gchar *account) 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), @@ -324,6 +335,9 @@ modest_mailboxes_window_new (const gchar *account) gtk_container_add (GTK_CONTAINER (scrollable), priv->folder_view); gtk_box_pack_end (GTK_BOX (priv->top_vbox), scrollable, 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); @@ -461,6 +475,8 @@ on_mailbox_activated (ModestFolderView *mailboxes_view, return; new_window = GTK_WIDGET (modest_folder_window_new (NULL)); + active_account = modest_window_get_active_account (MODEST_WINDOW (self)); + modest_window_set_active_account (MODEST_WINDOW (new_window), active_account); registered = modest_window_mgr_register_window (modest_runtime_get_window_mgr (), MODEST_WINDOW (new_window), MODEST_WINDOW (self)); @@ -632,7 +648,7 @@ on_activity_changed (ModestFolderView *view, update_progress_hint (self); } - +#ifdef MODEST_TOOLKIT_HILDON2 static gboolean on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer user_data) { @@ -659,3 +675,4 @@ on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer user_data) return FALSE; } +#endif