diff -r 1e3fcb26cf9e src/hugin1/hugin/MainFrame.cpp --- a/src/hugin1/hugin/MainFrame.cpp Mon Nov 29 20:26:19 2010 +0100 +++ b/src/hugin1/hugin/MainFrame.cpp Tue Nov 30 09:40:19 2010 +0100 @@ -209,10 +209,14 @@ m_progress = 0; svmModel=NULL; + wxTimer *timer; wxBitmap bitmap; wxSplashScreen* splash = 0; wxYield(); + timer = new wxTimer(this, 1); + fprintf (stderr, "blabla\n"); + if (bitmap.LoadFile(huginApp::Get()->GetXRCPath() + wxT("data/splash.png"), wxBITMAP_TYPE_PNG)) { // embed package version into string. @@ -424,6 +428,9 @@ #endif #endif #endif + Connect(wxEVT_TIMER, wxCommandEventHandler(MainFrame::OnTimer)); + timer->Start (10000); // start the autosave timer. + // generate list of most recently uses files and add it to menu wxConfigBase * config=wxConfigBase::Get(); m_mruFiles.Load(*config); @@ -1681,6 +1688,23 @@ } } +void MainFrame::OnTimer(wxCommandEvent &e) +{ + wxString m_currentPTOfn; + + fprintf (stderr, "autosaving..."); + m_currentPTOfn = wxString("hugin_autosave.pto", wxConvLocal); + + // copy is not enough, need to adjust image path names... + ofstream script(m_currentPTOfn.mb_str(HUGIN_CONV_FILENAME)); + PT::UIntSet all; + if (pano.getNrOfImages() > 0) { + fill_set(all, 0, pano.getNrOfImages()-1); + } + pano.printPanoramaScript(script, pano.getOptimizeVector(), pano.getOptions(), all, false, ""); + script.close(); + fprintf (stderr, "done\n"); +} void MainFrame::OnSize(wxSizeEvent &e) { diff -r 1e3fcb26cf9e src/hugin1/hugin/MainFrame.h --- a/src/hugin1/hugin/MainFrame.h Mon Nov 29 20:26:19 2010 +0100 +++ b/src/hugin1/hugin/MainFrame.h Tue Nov 30 09:40:19 2010 +0100 @@ -200,6 +200,7 @@ /** event handler for full screen */ void OnFullScreen(wxCommandEvent &e); void UpdatePanels(wxCommandEvent & e); + void OnTimer(wxCommandEvent &e); void OnSize(wxSizeEvent &e); void enableTools(bool option);