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

Modified Files:
        wxComposeView.cpp 
Log Message:
Minimalistic editor

Index: wxComposeView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxComposeView.cpp,v
retrieving revision 1.339
retrieving revision 1.340
diff -b -u -2 -r1.339 -r1.340
--- wxComposeView.cpp   22 Jul 2003 22:01:40 -0000      1.339
+++ wxComposeView.cpp   22 Aug 2003 13:03:50 -0000      1.340
@@ -1777,4 +1777,6 @@
    wxASSERT_MSG( m_editor == NULL, _T("creating the editor twice?") );
 
+   MessageEditor *editor = NULL;
+
    MModuleListing *listing =
       MModule::ListAvailableModules(MESSAGE_EDITOR_INTERFACE);
@@ -1788,5 +1790,6 @@
    {
       // TODO: make it configurable
-      String name = (*listing)[0].GetName();
+      //String name = (*listing)[0].GetName();
+      String name = "BareBonesEditor";
 
       MModule *editorFactory = MModule::LoadModule(name);
@@ -1817,5 +1820,5 @@
       if ( editorFactory )
       {
-         m_editor = ((MessageEditorFactory *)editorFactory)->Create();
+         editor = ((MessageEditorFactory *)editorFactory)->Create();
          editorFactory->DecRef();
       }
@@ -1826,5 +1829,8 @@
    // TODO: have a DummyEditor as we have a DummyViewer to avoid crashing
    //       if we failed to create any editor?
-   m_editor->Create(this, m_splitter);
+   editor->Create(this, m_splitter);
+
+   // Commit
+   m_editor = editor;
 }
 
@@ -2877,4 +2883,5 @@
 
       case WXMENU_COMPOSE_PREVIEW:
+         if(m_editor->FinishWork())
          {
             SendMessage *msg = BuildMessage();
@@ -2939,4 +2946,5 @@
 
       case WXMENU_COMPOSE_SAVETEXT:
+         if(m_editor->FinishWork())
          {
             String filename = wxPFileSelector
@@ -2970,4 +2978,5 @@
 
       case WXMENU_COMPOSE_EXTEDIT:
+         if(m_editor->FinishWork())
          StartExternalEditor();
          break;
@@ -3623,4 +3632,7 @@
    }
 
+   if(!m_editor->FinishWork())
+      return false;
+   
    // everything is ok
    return true;
@@ -4191,4 +4203,7 @@
 bool wxComposeView::SaveAsDraft() const
 {
+   if(!m_editor->FinishWork())
+      return false;
+   
    SendMessage_obj msg = BuildDraftMessage();
    if ( !msg )
@@ -4288,4 +4303,7 @@
 wxComposeView::AutoSave()
 {
+   if ( !m_editor )
+      return true;
+
    if ( !m_editor->IsModified() )
    {



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to