From: Pablo d'A. <da...@us...> - 2007-01-24 19:17:05
|
Update of /cvsroot/hugin/hugin/src/hugin In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv18214/hugin Modified Files: NonaStitcherPanel.cpp PTStitcherPanel.cpp PanoPanel.cpp Log Message: external command exection has changed slightly Index: NonaStitcherPanel.cpp =================================================================== RCS file: /cvsroot/hugin/hugin/src/hugin/NonaStitcherPanel.cpp,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- NonaStitcherPanel.cpp 1 Jan 2007 17:24:45 -0000 1.69 +++ NonaStitcherPanel.cpp 24 Jan 2007 19:16:59 -0000 1.70 @@ -432,7 +432,7 @@ { // use MyExternalCmdExecDialog - ret = MyExecuteCommandOnDialog(enblendExe, cmdline, this); + ret = MyExecuteCommandOnDialog(enblendExe, args, this); } DEBUG_NOTICE("enblend returned with: " << ret); Index: PTStitcherPanel.cpp =================================================================== RCS file: /cvsroot/hugin/hugin/src/hugin/PTStitcherPanel.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- PTStitcherPanel.cpp 1 Jan 2007 13:01:40 -0000 1.20 +++ PTStitcherPanel.cpp 24 Jan 2007 19:16:59 -0000 1.21 @@ -522,7 +522,6 @@ } } -#if 1 wxString PTScriptFile = config->Read(wxT("/PanoTools/ScriptFile"),wxT(HUGIN_PT_SCRIPTFILE)); stringstream script_stream; pano.printStitcherScript(script_stream, opts, imgs); @@ -554,15 +553,12 @@ scriptfile.close(); wxString outputFN = wxQuoteFilename(wxString(opts.outfile.c_str(), *wxConvCurrent)); - wxString cmd = stitcherExe + wxString(wxT(" -o ")); - cmd = cmd + outputFN; - cmd = cmd + wxString(wxT(" ")) + wxQuoteFilename(PTScriptFile); + wxString args = wxString(wxT(" -o ")); + args = args + outputFN; + args = args + wxString(wxT(" ")) + wxQuoteFilename(PTScriptFile); - DEBUG_INFO("Executing cmd: " << cmd.mb_str()); - MyExecuteCommandOnDialog(stitcherExe, cmd, this); -#else - new RunStitcherFrame(this, &pano, opts, imgs, m_editScriptCB->IsChecked()); -#endif + DEBUG_INFO("Executing cmd: " << stitcherExe.mb_str() << " " << args.mb_str()); + MyExecuteCommandOnDialog(stitcherExe, args, this); return true; } Index: PanoPanel.cpp =================================================================== RCS file: /cvsroot/hugin/hugin/src/hugin/PanoPanel.cpp,v retrieving revision 1.113 retrieving revision 1.114 diff -u -d -r1.113 -r1.114 --- PanoPanel.cpp 23 Jan 2007 22:24:21 -0000 1.113 +++ PanoPanel.cpp 24 Jan 2007 19:16:59 -0000 1.114 @@ -271,11 +271,11 @@ { if (updatesDisabled) return; PanoramaOptions opt = pano.getOptions(); - PanoramaOptions::ProjectionFormat oldP = opt.getProjection(); +// PanoramaOptions::ProjectionFormat oldP = opt.getProjection(); PanoramaOptions::ProjectionFormat newP = (PanoramaOptions::ProjectionFormat) m_ProjectionChoice->GetSelection(); - int w = opt.getWidth(); - int h = opt.getHeight(); +// int w = opt.getWidth(); +// int h = opt.getHeight(); opt.setProjection(newP); GlobalCmdHist::getInstance().addCommand( @@ -647,6 +647,7 @@ DEBUG_INFO ( "new optimal width: " << opt.getWidth() ); } + void PanoPanel::DoStitch() { if (pano.getNrOfImages() == 0) { @@ -691,9 +692,9 @@ if (m_Stitcher->Stitch(pano, opt)) { int runViewer = wxConfig::Get()->Read(wxT("/Stitcher/RunEditor"), HUGIN_STITCHER_RUN_EDITOR); if (runViewer) { - // TODO: show image after it has been created - wxString editor = wxConfig::Get()->Read(wxT("/Stitcher/Editor"), wxT(HUGIN_STITCHER_EDITOR)); - wxString args = wxConfig::Get()->Read(wxT("/Stitcher/EditorArgs"), wxT(HUGIN_STITCHER_EDITOR_ARGS)); + // TODO: show image after it has been created + wxString editor = wxConfig::Get()->Read(wxT("/Stitcher/Editor"), wxT(HUGIN_STITCHER_EDITOR)); + wxString args = wxConfig::Get()->Read(wxT("/Stitcher/EditorArgs"), wxT(HUGIN_STITCHER_EDITOR_ARGS)); if (opt.outputFormat == PanoramaOptions::TIFF_m || opt.outputFormat == PanoramaOptions::TIFF_mask) { @@ -701,13 +702,27 @@ } else { wxString quoted = utils::wxQuoteFilename(wxfn); args.Replace(wxT("%f"), quoted); + quoted = utils::wxQuoteFilename(wxString(pano.getImage(0).getFilename().c_str(), *wxConvCurrent)); + args.Replace(wxT("%i"), quoted); wxString cmdline = utils::wxQuoteFilename(editor) + wxT(" ") + args; DEBUG_DEBUG("editor command: " << cmdline.c_str()); - if (editor != wxT("")) { - // opens the default viewer application - wxExecute(cmdline, wxEXEC_ASYNC); + if (editor != wxT("")) { + wxExecute(cmdline, wxEXEC_ASYNC); + } else { +#ifdef __WXMSW__ + // use default viewer on windows + SHELLEXECUTEINFO seinfo; + memset(&seinfo, 0, sizeof(SHELLEXECUTEINFO)); + seinfo.cbSize = sizeof(SHELLEXECUTEINFO); + seinfo.fMask = SEE_MASK_NOCLOSEPROCESS; + seinfo.lpFile = args.c_str(); + seinfo.lpParameters = args.c_str(); + if (!ShellExecuteEx(&seinfo)) { + wxMessageBox(_("Could not execute command: ") + args, _("ShellExecuteEx failed"), wxCANCEL | wxICON_ERROR); + } +#endif } } } |