From: <tm...@us...> - 2010-04-05 11:17:40
|
Revision: 5106 http://hugin.svn.sourceforge.net/hugin/?rev=5106&view=rev Author: tmodes Date: 2010-04-05 11:17:34 +0000 (Mon, 05 Apr 2010) Log Message: ----------- Improved warning if saving of project file failed (e.g. read-only file or folder) Modified Paths: -------------- hugin/trunk/src/hugin1/hugin/MainFrame.cpp Modified: hugin/trunk/src/hugin1/hugin/MainFrame.cpp =================================================================== --- hugin/trunk/src/hugin1/hugin/MainFrame.cpp 2010-04-04 10:24:11 UTC (rev 5105) +++ hugin/trunk/src/hugin1/hugin/MainFrame.cpp 2010-04-05 11:17:34 UTC (rev 5106) @@ -539,6 +539,7 @@ std::string path = getPathPrefix(std::string(scriptName.GetFullPath().mb_str(HUGIN_CONV_FILENAME))); DEBUG_DEBUG("stripping " << path << " from image filenames"); std::ofstream script(scriptName.GetFullPath().mb_str(HUGIN_CONV_FILENAME)); + script.exceptions ( std::ofstream::eofbit | std::ofstream::failbit | std::ofstream::badbit ); PT::OptimizeVector optvec = opt_panel->getOptimizeVector(); PT::UIntSet all; if (pano.getNrOfImages() > 0) { @@ -554,6 +555,7 @@ if (createMakefile && pano.getNrOfImages() > 0) { wxString makefn = scriptName.GetFullPath() + wxT(".mk"); std::ofstream makefile(makefn.mb_str(HUGIN_CONV_FILENAME)); + makefile.exceptions ( std::ofstream::eofbit | std::ofstream::failbit | std::ofstream::badbit ); wxString ptoFnWX = scriptName.GetFullPath(); std::string ptoFn(ptoFnWX.mb_str(HUGIN_CONV_FILENAME)); wxString bindir = huginApp::Get()->GetUtilsBinDir(); @@ -581,7 +583,7 @@ } } catch (std::exception & e) { wxString err(e.what(), wxConvLocal); - wxMessageBox(err, wxT("Exception during saving project file")); + wxMessageBox(wxString::Format(_("Could not save project file \"%s\".\nMaybe the file or the folder is read-only.\n\n(Error code: %s)"),m_filename.c_str(),err.c_str()),_("Error"),wxOK|wxICON_ERROR); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |