Added msg view window reload feature. Now we can force a message reload
[modest] / src / maemo / modest-msg-view-window.c
index facfbc4..165dc80 100644 (file)
@@ -934,6 +934,7 @@ modest_msg_view_window_construct (ModestMsgViewWindow *self,
 ModestWindow *
 modest_msg_view_window_new_with_header_model (TnyMsg *msg, 
                                              const gchar *modest_account_name,
+                                             const gchar *mailbox, /*ignored */
                                              const gchar *msg_uid,
                                              GtkTreeModel *model, 
                                              GtkTreeRowReference *row_reference)
@@ -1032,6 +1033,7 @@ modest_msg_view_window_new_with_header_model (TnyMsg *msg,
 ModestWindow *
 modest_msg_view_window_new_for_search_result (TnyMsg *msg, 
                                              const gchar *modest_account_name,
+                                             const gchar *mailbox, /*ignored*/
                                              const gchar *msg_uid)
 {
        ModestMsgViewWindow *window = NULL;
@@ -1065,8 +1067,9 @@ modest_msg_view_window_new_for_search_result (TnyMsg *msg,
 
 ModestWindow *
 modest_msg_view_window_new_for_attachment (TnyMsg *msg, 
-                           const gchar *modest_account_name,
-                           const gchar *msg_uid)
+                                          const gchar *modest_account_name,
+                                          const gchar *mailbox, /* ignored */
+                                          const gchar *msg_uid)
 {
        GObject *obj = NULL;
        ModestMsgViewWindowPrivate *priv;       
@@ -2657,7 +2660,8 @@ modest_msg_view_window_view_attachment (ModestMsgViewWindow *window,
                        gchar *account = g_strdup (modest_window_get_active_account (MODEST_WINDOW (window)));
                        if (!account)
                                account = modest_account_mgr_get_default_account (modest_runtime_get_account_mgr ());
-                       msg_win = modest_msg_view_window_new_for_attachment (TNY_MSG (mime_part), account, attachment_uid);
+                       msg_win = modest_msg_view_window_new_for_attachment (TNY_MSG (mime_part), account, 
+                                                                            NULL, attachment_uid);
                        modest_window_set_zoom (MODEST_WINDOW (msg_win), 
                                                modest_window_get_zoom (MODEST_WINDOW (window)));
                        modest_window_mgr_register_window (mgr, msg_win, MODEST_WINDOW (window));
@@ -3218,3 +3222,40 @@ modest_msg_view_window_add_to_contacts (ModestMsgViewWindow *self)
 }
 
 
+void
+modest_msg_view_window_fetch_images (ModestMsgViewWindow *self)
+{
+       ModestMsgViewWindowPrivate *priv;
+       priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (self);
+
+       modest_msg_view_request_fetch_images (MODEST_MSG_VIEW (priv->msg_view));
+}
+
+gboolean 
+modest_msg_view_window_has_blocked_external_images (ModestMsgViewWindow *self)
+{
+       ModestMsgViewWindowPrivate *priv;
+       priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (self);
+
+       g_return_val_if_fail (MODEST_IS_MSG_VIEW_WINDOW (self), FALSE);
+
+       return modest_msg_view_has_blocked_external_images (MODEST_MSG_VIEW (priv->msg_view));
+}
+
+void 
+modest_msg_view_window_reload (ModestMsgViewWindow *self)
+{
+       ModestMsgViewWindowPrivate *priv;
+       TnyHeader *header;
+
+       g_return_if_fail (MODEST_IS_MSG_VIEW_WINDOW (self));
+
+       priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (self);
+       header = modest_msg_view_window_get_header (MODEST_MSG_VIEW_WINDOW (self));     
+
+       if (!message_reader (self, priv, header, priv->row_reference)) {
+               g_warning ("Shouldn't happen, trying to reload a message failed");
+       }
+
+       g_object_unref (header);
+}