r601: no message
[ctsim.git] / src / threadproj.cpp
index 64216562ab82c04d1c5ec401ee30471db3067313..a5105aa910409315b453174825dd31f7c17586d4 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2001 Kevin Rosenberg
 **
-**  $Id: threadproj.cpp,v 1.7 2001/03/02 21:11:50 kevin Exp $
+**  $Id: threadproj.cpp,v 1.10 2001/03/04 04:16:20 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -154,28 +154,19 @@ ProjectorSupervisor::onDone()
   wxCriticalSectionLocker critsect (doneSection);
 
   Projections* pProjections = getProjections();
-
-  wxMutexGuiEnter();
-  ProjectionFileDocument* pProjDoc = theApp->newProjectionDoc();
-  if (! pProjDoc) {
-    sys_error (ERR_SEVERE, "Unable to create projection file");
-    return;
-  }  
-  pProjDoc->setProjections (pProjections);
-  pProjDoc->UpdateAllViews (NULL);
-  if (ProjectionFileView* projView = pProjDoc->getView()) {
-    projView->OnUpdate (projView, NULL);
-    projView->getFrame()->SetFocus();
-    projView->getFrame()->Show(true);
-  }
-  *theApp->getLog() << m_pszLabel << "\n";
-  wxMutexGuiLeave();
-
-  if (theApp->getAskDeleteNewDocs())
-    pProjDoc->Modify (true);
   pProjections->setRemark (m_pszLabel);
   pProjections->setCalcTime (getTimerEnd());
 
+  wxCommandEvent eventLog (wxEVT_COMMAND_MENU_SELECTED, MAINMENU_LOG_EVENT );
+  wxString msg (m_pszLabel);
+  msg += "\n";
+  eventLog.SetString( msg );
+  wxPostEvent( theApp->getMainFrame(), eventLog ); // send log event
+
+  wxCommandEvent newProjEvent (wxEVT_COMMAND_MENU_SELECTED, NEW_PROJECTIONFILE_EVENT);
+  newProjEvent.SetClientData (pProjections);
+  wxPostEvent (theApp->getMainFrame(), newProjEvent);
+  
   setDone();
 }