#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h>
-#include "modest-widget-factory.h"
-#include <modest-widget-memory.h>
-#include <modest-protocol-mgr.h>
#include <tny-gtk-account-list-model.h>
#include <tny-gtk-folder-store-tree-model.h>
#include <tny-account-store.h>
#include <tny-device.h>
#include <tny-folder-store-query.h>
-
+#include "modest-widget-factory.h"
+#include "modest-widget-memory.h"
+#include "modest-protocol-mgr.h"
#include "modest-tny-platform-factory.h"
#include "modest-account-mgr.h"
#include "modest-mail-operation.h"
-
+#include "widgets/modest-header-view-priv.h"
/* 'private'/'protected' functions */
static void modest_widget_factory_class_init (ModestWidgetFactoryClass *klass);
ModestWidgetFactory *self)
{
ModestWidgetFactoryPrivate *priv;
+
priv = MODEST_WIDGET_FACTORY_GET_PRIVATE(self);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(priv->online_toggle),
online ? _("Online") : _("Offline"));
statusbar_push (self, 0, online ? _("Modest went online") : _("Modest went offline"));
+
+ /* If Modest has became online and the header view has a
+ header selected then show it */
+ if (online) {
+ GtkTreeSelection *selected;
+
+ selected = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->header_view));
+ _modest_header_view_change_selection (selected, priv->header_view);
+ }
}
modest-folder-view.h \
modest-header-view.c \
modest-header-view.h \
+ modest-header-view-priv.h \
modest-msg-view.c \
modest-msg-view.h \
modest-toolbar.h \
--- /dev/null
+/* Copyright (c) 2006, Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Nokia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __MODEST_HEADER_VIEW_PRIV_H__
+#define __MODEST_HEADER_VIEW_PRIV_H__
+
+#include <gtk/gtktreeview.h>
+#include "modest-header-view.h"
+
+G_BEGIN_DECLS
+
+void _modest_header_view_change_selection (GtkTreeSelection *selection,
+ gpointer user_data);
+
+G_END_DECLS
+
+#endif /* __MODEST_HEADER_VIEW_PRIV_H__ */
/* Frees */
g_object_unref (G_OBJECT (folder));
}
+
+
+/* PROTECTED method. It's useful when we want to force a given
+ selection to reload a msg. For example if we have selected a header
+ in offline mode, when Modest become online, we want to reload the
+ message automatically without an user click over the header */
+void
+_modest_header_view_change_selection (GtkTreeSelection *selection,
+ gpointer user_data)
+{
+ g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
+ g_return_if_fail (MODEST_IS_HEADER_VIEW (user_data));
+
+ on_selection_changed (selection, user_data);
+}
*/
ModestHeaderViewStyle modest_header_view_get_style (ModestHeaderView *self);
+/**
+ * modest_header_view_get_selected_headers:
+ * @self: a ModestHeaderView instance
+ *
+ * get the list of the currently selected TnyHeader's
+ *
+ * Returns: the list with the currently selected headers
+ */
TnyList* modest_header_view_get_selected_headers (ModestHeaderView *self);
G_END_DECLS