Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv31342/src/gui

Modified Files:
        wxMessageView.cpp wxMsgCmdProc.cpp 
Log Message:
use separate temp profile for standalone message views to avoid modifying main folder 
options while using them

Index: wxMessageView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMessageView.cpp,v
retrieving revision 1.296
retrieving revision 1.297
diff -b -u -2 -r1.296 -r1.297
--- wxMessageView.cpp   2 Oct 2003 11:58:57 -0000       1.296
+++ wxMessageView.cpp   7 Oct 2003 22:48:44 -0000       1.297
@@ -41,4 +41,5 @@
 
 #include "UIdArray.h"
+#include "ASMailFolder.h"
 
 #include "MessageTemplate.h"
@@ -185,7 +186,9 @@
 // ----------------------------------------------------------------------------
 
-wxMessageView::wxMessageView(wxWindow *parent, FolderView *folderView)
+wxMessageView::wxMessageView(wxWindow *parent,
+                             FolderView *folderView,
+                             Profile *profile)
 {
-   Init(parent);
+   Init(parent, profile);
 
    m_FolderView = folderView;
@@ -202,4 +205,11 @@
 }
 
+/* static */
+MessageView *
+MessageView::CreateStandalone(wxWindow *parent, Profile *profile)
+{
+   return new wxMessageView(parent, NULL, profile);
+}
+
 // ----------------------------------------------------------------------------
 // event handling
@@ -416,5 +426,6 @@
                   : wxMFrame(_("Mahogany: Message View"), parent)
 {
-   m_MessageView = MessageView::Create(this);
+   Profile_obj profile(Profile::CreateTemp(asmf->GetProfile()));
+   m_MessageView = MessageView::CreateStandalone(this, profile);
 
    m_msgCmdProc = MsgCmdProc::Create(m_MessageView);
@@ -529,4 +540,6 @@
                                          UIdType uid)
 {
+   CHECK( asmf, NULL, _T("NULL folder in ShowMessageViewFrame()?") );
+
    wxMessageViewFrame *frame = new wxMessageViewFrame(parent, asmf, uid);
 

Index: wxMsgCmdProc.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMsgCmdProc.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -b -u -2 -r1.50 -r1.51
--- wxMsgCmdProc.cpp    3 Oct 2003 11:05:15 -0000       1.50
+++ wxMsgCmdProc.cpp    7 Oct 2003 22:48:45 -0000       1.51
@@ -149,4 +149,7 @@
    //@}
 
+   /// do not call DecRef() on the returned pointer (which is never NULL)
+   Profile *GetProfile() const { return m_msgView->GetProfile(); }
+
    wxFrame *GetFrame() const { return m_frame; }
 
@@ -571,4 +574,6 @@
 MsgCmdProcImpl::MsgCmdProcImpl(MessageView *msgView, wxWindow *winForDnd)
 {
+   ASSERT_MSG( msgView, _T("NULL MessageView in MsgCmdProc -- will crash") );
+
    m_msgView = msgView;
    m_winForDnd = winForDnd;
@@ -734,5 +739,5 @@
       case WXMENU_MSG_FOLLOWUP_TO_NEWSGROUP:
          {
-            int quote = READ_CONFIG(m_asmf->GetProfile(), MP_REPLY_QUOTE_ORIG);
+            int quote = READ_CONFIG(GetProfile(), MP_REPLY_QUOTE_ORIG);
 
             if ( quote == M_ACTION_PROMPT )
@@ -1015,5 +1020,5 @@
       SendMessage_obj sendMsg(SendMessage::CreateResent
                               (
-                                  m_asmf->GetProfile(),
+                                  GetProfile(),
                                   msg,
                                   GetFrame()
@@ -1077,5 +1082,5 @@
       SendMessage_obj sendMsg(SendMessage::CreateResent
                               (
-                                  m_asmf->GetProfile(),
+                                  GetProfile(),
                                   msg.Get(),
                                   GetFrame()
@@ -1742,5 +1747,5 @@
                   ((ASMailFolder::ResultMessage *)result)->GetMessage();
 
-               Composer::EditMessage(m_asmf->GetProfile(), msg);
+               Composer::EditMessage(GetProfile(), msg);
             }
             else



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to