66
64
RunStitchFrame(wxWindow * parent, const wxString& title, const wxPoint& pos, const wxSize& size);
68
66
bool StitchProject(wxString scriptFile, wxString outname,
69
HuginBase::PanoramaMakefileExport::PTPrograms progs);
67
HuginBase::PanoramaMakefilelibExport::PTPrograms progs);
71
69
void OnQuit(wxCommandEvent& event);
72
70
void OnAbout(wxCommandEvent& event);
169
167
m_isStitching = false;
170
if (event.GetExitCode() != 0) {
171
wxMessageBox(_("Error during stitching\nPlease report the complete text to the bug tracker on http://sf.net/projects/hugin."),
172
_("Error during stitching"), wxICON_ERROR | wxOK );
168
if (event.GetExitCode() != 0)
170
if(wxMessageBox(_("Error during stitching\nPlease report the complete text to the bug tracker on https://bugs.launchpad.net/hugin.\n\nDo you want to save the log file?"),
171
_("Error during stitching"), wxICON_ERROR | wxYES_NO )==wxYES)
173
wxString defaultdir = wxConfigBase::Get()->Read(wxT("/actualPath"),wxT(""));
174
wxFileDialog dlg(this,
175
_("Specify log file"),
177
_("Log files (*.log)|*.log|All files (*)|*"),
178
wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition);
179
dlg.SetDirectory(wxConfigBase::Get()->Read(wxT("/actualPath"),wxT("")));
180
if (dlg.ShowModal() == wxID_OK)
182
wxConfig::Get()->Write(wxT("/actualPath"), dlg.GetDirectory()); // remember for later
183
m_stitchPanel->SaveLog(dlg.GetPath());
179
192
bool RunStitchFrame::StitchProject(wxString scriptFile, wxString outname,
180
HuginBase::PanoramaMakefileExport::PTPrograms progs)
193
HuginBase::PanoramaMakefilelibExport::PTPrograms progs)
182
195
if (! m_stitchPanel->StitchProject(scriptFile, outname, progs)) {
286
299
// parse arguments
287
300
static const wxCmdLineEntryDesc cmdLineDesc[] =
302
//On wxWidgets 2.9, wide characters don't work here.
303
//On previous versions, the wxT macro is required for unicode builds.
304
#if wxCHECK_VERSION(2,9,0)
305
{ wxCMD_LINE_SWITCH, "h", "help", "show this help message",
306
wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
307
{ wxCMD_LINE_OPTION, "o", "output", "output prefix" },
308
{ wxCMD_LINE_SWITCH, "d", "delete", "delete pto file after stitching" },
309
{ wxCMD_LINE_PARAM, NULL, NULL, "<project>",
310
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
289
313
{ wxCMD_LINE_SWITCH, wxT("h"), wxT("help"), wxT("show this help message"),
290
314
wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
291
315
{ wxCMD_LINE_OPTION, wxT("o"), wxT("output"), wxT("output prefix") },
292
{ wxCMD_LINE_OPTION, wxT("t"), wxT("threads"), wxT("number of threads"),
293
wxCMD_LINE_VAL_NUMBER, wxCMD_LINE_PARAM_OPTIONAL },
294
316
{ wxCMD_LINE_SWITCH, wxT("d"), wxT("delete"), wxT("delete pto file after stitching") },
295
{ wxCMD_LINE_PARAM, NULL, NULL, _T("<project> <images>"),
296
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL + wxCMD_LINE_PARAM_MULTIPLE },
317
{ wxCMD_LINE_PARAM, NULL, NULL, wxT("<project>"),
318
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
297
319
{ wxCMD_LINE_NONE }
300
323
wxCmdLineParser parser(cmdLineDesc, argc, argv);
338
358
_("Specify project source project file"),
339
359
defaultdir, wxT(""),
340
360
_("Project files (*.pto,*.ptp,*.pts,*.oto)|*.pto;*.ptp;*.pts;*.oto;|All files (*)|*"),
341
wxOPEN, wxDefaultPosition);
361
wxFD_OPEN, wxDefaultPosition);
343
363
dlg.SetDirectory(wxConfigBase::Get()->Read(wxT("/actualPath"),wxT("")));
344
364
if (dlg.ShowModal() == wxID_OK) {
368
384
wxFileDialog dlg(0,_("Specify output prefix"),
369
385
wxConfigBase::Get()->Read(wxT("/actualPath"),wxT("")),
370
386
wxT(""), wxT(""),
371
wxSAVE, wxDefaultPosition);
387
wxFD_SAVE, wxDefaultPosition);
372
388
dlg.SetDirectory(wxConfigBase::Get()->Read(wxT("/actualPath"),wxT("")));
373
389
if (dlg.ShowModal() == wxID_OK) {
374
390
while(containsInvalidCharacters(dlg.GetPath()))