#include <tny-account-store.h>
#include <tny-simple-list.h>
#include <modest-tny-msg.h>
-#include <modest-msg-view-window.h>
-#include <modest-main-window-ui.h>
+
+#include <widgets/modest-msg-view-window.h>
+#include "modest-main-window-ui.h"
+#include <widgets/modest-window-priv.h>
+
#include <modest-widget-memory.h>
#include <modest-runtime.h>
-#include <modest-window-priv.h>
static void modest_msg_view_window_class_init (ModestMsgViewWindowClass *klass);
static void modest_msg_view_window_init (ModestMsgViewWindow *obj);
typedef struct _ModestMsgViewWindowPrivate ModestMsgViewWindowPrivate;
struct _ModestMsgViewWindowPrivate {
-
GtkWidget *toolbar;
GtkWidget *menubar;
GtkWidget *msg_view;
static void
modest_msg_view_window_finalize (GObject *obj)
-{
+{
G_OBJECT_CLASS(parent_class)->finalize (obj);
}
ModestWindow *
-modest_msg_view_window_new (TnyMsg *msg)
+modest_msg_view_window_new (TnyMsg *msg, const gchar *account)
{
GObject *obj;
ModestMsgViewWindowPrivate *priv;
GError *error = NULL;
g_return_val_if_fail (msg, NULL);
-
+
obj = g_object_new(MODEST_TYPE_MSG_VIEW_WINDOW, NULL);
priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE(obj);
parent_priv = MODEST_WINDOW_GET_PRIVATE(obj);
+
+ modest_window_set_active_account (MODEST_WINDOW(obj), account);
parent_priv->ui_manager = gtk_ui_manager_new();
action_group = gtk_action_group_new ("ModestMsgViewWindowActions");
gtk_ui_manager_insert_action_group (parent_priv->ui_manager, action_group, 0);
g_object_unref (action_group);
+
/* Load the UI definition */
- gtk_ui_manager_add_ui_from_file (parent_priv->ui_manager, MODEST_UIDIR "modest-msg-view-window-ui.xml",
+ gtk_ui_manager_add_ui_from_file (parent_priv->ui_manager,
+ MODEST_UIDIR "modest-msg-view-window-ui.xml",
&error);
if (error) {
g_printerr ("modest: could not merge modest-msg-view-window-ui.xml: %s\n", error->message);
g_signal_connect (G_OBJECT(obj), "delete-event", G_CALLBACK(on_delete_event), obj);
- return (ModestWindow *) (obj);
+ return MODEST_WINDOW(obj);
+}
+
+
+TnyMsg*
+modest_msg_view_window_get_message (ModestMsgViewWindow *self)
+{
+ GtkWidget *msg_view;
+ g_return_val_if_fail (self, NULL);
+
+ msg_view = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE(self)->msg_view;
+
+ return modest_msg_view_get_message (MODEST_MSG_VIEW(msg_view));
}