2006-09-04 [colin] 2.4.0cvs143
[claws.git] / src / messageview.c
index 189163c9b5f0c3eb79c373e19ecc70cab10b08cf..b1d065b05c37b201be883c2949c38d7fc4b3fd24 100644 (file)
@@ -830,6 +830,8 @@ gint messageview_show(MessageView *messageview, MsgInfo *msginfo,
        }
        headerview_show(messageview->headerview, messageview->msginfo);
 
        }
        headerview_show(messageview->headerview, messageview->msginfo);
 
+       messageview_set_position(messageview, 0);
+
        textview_set_all_headers(messageview->mimeview->textview, 
                        messageview->all_headers);
 
        textview_set_all_headers(messageview->mimeview->textview, 
                        messageview->all_headers);
 
@@ -852,8 +854,6 @@ gint messageview_show(MessageView *messageview, MsgInfo *msginfo,
                g_free(subject);
        }
 
                g_free(subject);
        }
 
-       messageview_set_position(messageview, 0);
-
        main_create_mailing_list_menu(messageview->mainwin, messageview->msginfo);
 
        if (messageview->msginfo->extradata
        main_create_mailing_list_menu(messageview->mainwin, messageview->msginfo);
 
        if (messageview->msginfo->extradata
@@ -917,8 +917,17 @@ void messageview_destroy(MessageView *messageview)
        }
 
        if (messageview->updating) {
        }
 
        if (messageview->updating) {
-               debug_print("uh oh, better not touch that now\n");
+               debug_print("uh oh, better not touch that now (fetching)\n");
+               messageview->deferred_destroy = TRUE;
+               gtk_widget_hide(messageview->window);
+               return;
+       }
+       
+       if (messageview->mimeview->textview
+       &&  messageview->mimeview->textview->loading) {
+               debug_print("uh oh, better not touch that now (loading text)\n");
                messageview->deferred_destroy = TRUE;
                messageview->deferred_destroy = TRUE;
+               messageview->mimeview->textview->stop_loading = TRUE;
                gtk_widget_hide(messageview->window);
                return;
        }
                gtk_widget_hide(messageview->window);
                return;
        }