Hugin trunk 0.1
Loading...
Searching...
No Matches
BatchFrame.cpp
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
2
27#include "BatchFrame.h"
28#include <wx/stdpaths.h>
29#include "PTBatcherGUI.h"
30#include "FindPanoDialog.h"
34#ifdef __WXMSW__
35#include <powrprof.h>
36#ifdef _MSC_VER
37#pragma comment(lib, "PowrProf.lib")
38#endif
39#include <wx/taskbarbutton.h>
40#endif
41#include "base_wx/wxutils.h"
42
43/* file drag and drop handler method */
45{
46 BatchFrame* MyBatchFrame = wxGetApp().GetFrame();
47 if (!MyBatchFrame)
48 {
49 return false;
50 }
51 if(filenames.GetCount()==0)
52 {
53 return false;
54 }
55 for(unsigned int i=0; i< filenames.GetCount(); i++)
56 {
57 wxFileName file(filenames[i]);
58 if(file.HasExt())
59 {
60 if (file.GetExt().CmpNoCase("pto") == 0 ||
61 file.GetExt().CmpNoCase("ptp") == 0 ||
62 file.GetExt().CmpNoCase("pts") == 0 )
63 {
64 if(file.FileExists())
65 {
66 MyBatchFrame->AddToList(filenames[i]);
67 }
68 };
69 }
70 else
71 {
72 if(file.DirExists())
73 {
74 MyBatchFrame->AddDirToList(filenames[i]);
75 }
76 };
77 };
78 return true;
79};
80
81enum
82{
84};
85
87{
88 this->SetLocaleAndXRC(locale,xrc);
89 m_cancelled = false;
90
91 //load xrc resources
92 wxXmlResource::Get()->LoadFrame(this, (wxWindow* )NULL, "batch_frame");
93 // load our menu bar
94#ifdef __WXMAC__
95 wxApp::s_macExitMenuItemId = XRCID("menu_exit");
96 wxApp::s_macHelpMenuTitleName = _("&Help");
97#endif
98 SetMenuBar(wxXmlResource::Get()->LoadMenuBar(this, "batch_menu"));
99
100 // create tool bar
101 SetToolBar(wxXmlResource::Get()->LoadToolBar(this, "batch_toolbar"));
102
103 int widths[2] = { -1, 150 };
106 SetStatusText(_("Not doing much..."));
107
108 // set the minimize icon
109#ifdef __WXMSW__
110 m_iconNormal = wxIcon(m_xrcPrefix + "data/ptbatcher.ico", wxBITMAP_TYPE_ICO);
111 m_iconRunning = wxIcon(m_xrcPrefix + "data/ptbatcher_running.ico", wxBITMAP_TYPE_ICO);
112 m_iconPaused = wxIcon(m_xrcPrefix + "data/ptbatcher_pause.ico", wxBITMAP_TYPE_ICO);
113 wxIconBundle myIcons(m_xrcPrefix + "data/ptbatcher.ico", wxBITMAP_TYPE_ICO);
115#else
116 m_iconNormal = wxIcon(m_xrcPrefix + "data/ptbatcher.png", wxBITMAP_TYPE_PNG);
117 m_iconRunning = wxIcon(m_xrcPrefix + "data/ptbatcher_running.png", wxBITMAP_TYPE_PNG);
118 m_iconPaused = wxIcon(m_xrcPrefix + "data/ptbatcher_pause.png", wxBITMAP_TYPE_PNG);
120#endif
121
122 m_batch = new Batch(this);
124 {
125#ifdef __WXMAC__
126 wxString text(_("You have pressed the Command key."));
127#else
128 wxString text(_("You have pressed the Control key."));
129#endif
130 text.Append("\n");
131 text.Append(_("Should the loading of the batch queue be skipped?"));
132 if (hugin_utils::HuginMessageBox(text, _("PTBatcherGUI"), wxYES_NO | wxICON_EXCLAMATION, this) == wxNO)
133 {
134 m_batch->LoadTemp();
135 }
136 else
137 {
138 // save empty batch queue
139 m_batch->SaveTemp();
140 };
141 }
142 else
143 {
144 m_batch->LoadTemp();
145 };
146 projListBox = XRCCTRL(*this,"project_listbox",ProjectListBox);
148 // fill at end list box, check which options are available
149 m_endChoice = XRCCTRL(*this, "choice_end", wxChoice);
150 m_endChoice->Clear();
151 m_endChoice->Append(_("Do nothing"), (void*)Batch::DO_NOTHING);
152 m_endChoice->Append(_("Close PTBatcherGUI"), (void*)Batch::CLOSE_PTBATCHERGUI);
153#if !defined __WXMAC__ && !defined __WXOSX_COCOA__
154 // there is no wxShutdown for wxMac
155 m_endChoice->Append(_("Shutdown computer"), (void*)Batch::SHUTDOWN);
156#endif
158#ifdef __WXMSW__
161 {
162 if (pwrCap.SystemS3)
163 {
164 m_endChoice->Append(_("Suspend computer"), (void*)Batch::SUSPEND);
165 };
166 if (pwrCap.SystemS4 && pwrCap.HiberFilePresent)
167 {
168 m_endChoice->Append(_("Hibernate computer"), (void*)Batch::HIBERNATE);
169 };
170 };
171#endif
172
173 //TO-DO: include a batch or project progress gauge?
176
177 m_tray = NULL;
178 if (wxTaskBarIcon::IsAvailable())
179 {
180 // minimize to tray is by default disabled
181 // activate only if task bar icon is available
182 GetMenuBar()->Enable(XRCID("menu_tray"), true);
183 bool minTray;
184 // tray icon is disabled by default
185 wxConfigBase::Get()->Read("/BatchFrame/minimizeTray", &minTray, false);
186 GetMenuBar()->Check(XRCID("menu_tray"), minTray);
188 }
189
191
192#ifndef __WXMSW__
193 // check settings of help window and fix when needed
195#endif
197 // start timer for check for updates in project files
198 m_updateProjectsTimer->StartOnce(5000);
199 // connect all events
200 // tool buttons
201 Bind(wxEVT_TOOL, &BatchFrame::OnButtonClear, this, XRCID("tool_clear"));
202 Bind(wxEVT_TOOL, &BatchFrame::OnButtonOpenBatch, this, XRCID("tool_open"));
203 Bind(wxEVT_TOOL, &BatchFrame::OnButtonSaveBatch, this, XRCID("tool_save"));
204 Bind(wxEVT_TOOL, &BatchFrame::OnButtonRunBatch, this, XRCID("tool_start"));
205 Bind(wxEVT_TOOL, &BatchFrame::OnButtonSkip, this, XRCID("tool_skip"));
206 Bind(wxEVT_TOOL, &BatchFrame::OnButtonPause, this, XRCID("tool_pause"));
207 Bind(wxEVT_TOOL, &BatchFrame::OnButtonCancel, this, XRCID("tool_cancel"));
209 Bind(wxEVT_TOOL, &BatchFrame::OnButtonRemoveFromList, this, XRCID("tool_remove"));
210 Bind(wxEVT_TOOL, &BatchFrame::OnButtonAddDir, this, XRCID("tool_adddir"));
211 // menu items
213 Bind(wxEVT_MENU, &BatchFrame::OnButtonAddToAssistantQueue, this, XRCID("menu_add_assistant"));
214 Bind(wxEVT_MENU, &BatchFrame::OnButtonRemoveFromList, this, XRCID("menu_remove"));
215 Bind(wxEVT_MENU, &BatchFrame::OnButtonAddDir, this, XRCID("menu_adddir"));
216 Bind(wxEVT_MENU, &BatchFrame::OnButtonSearchPano, this, XRCID("menu_searchpano"));
217 Bind(wxEVT_MENU, &BatchFrame::OnButtonGenerateSequence, this, XRCID("menu_generate_sequence"));
218 Bind(wxEVT_MENU, &BatchFrame::OnButtonOpenBatch, this, XRCID("menu_open"));
219 Bind(wxEVT_MENU, &BatchFrame::OnButtonSaveBatch, this, XRCID("menu_save"));
220 Bind(wxEVT_MENU, &BatchFrame::OnButtonClear, this, XRCID("menu_clear"));
221 Bind(wxEVT_MENU, &BatchFrame::OnMinimizeTrayMenu, this, XRCID("menu_tray"));
222 Bind(wxEVT_MENU, &BatchFrame::OnUserExit, this, XRCID("menu_exit"));
223 Bind(wxEVT_MENU, &BatchFrame::OnButtonHelp, this, XRCID("menu_help"));
224 // buttons
225 Bind(wxEVT_BUTTON, &BatchFrame::OnButtonAddCommand, this, XRCID("button_addcommand"));
226 Bind(wxEVT_BUTTON, &BatchFrame::OnButtonRemoveComplete, this, XRCID("button_remove"));
227 Bind(wxEVT_BUTTON, &BatchFrame::OnButtonChangePrefix, this, XRCID("button_prefix"));
228 Bind(wxEVT_BUTTON, &BatchFrame::OnButtonChangeUserDefinedSequence, this, XRCID("button_user_defined"));
229 Bind(wxEVT_BUTTON, &BatchFrame::OnButtonReset, this, XRCID("button_reset"));
230 Bind(wxEVT_BUTTON, &BatchFrame::OnButtonResetAll, this, XRCID("button_resetall"));
231 Bind(wxEVT_BUTTON, &BatchFrame::OnButtonOpenWithHugin, this, XRCID("button_edit"));
232 Bind(wxEVT_BUTTON, &BatchFrame::OnButtonMoveUp, this, XRCID("button_move_up"));
233 Bind(wxEVT_BUTTON, &BatchFrame::OnButtonMoveDown, this, XRCID("button_move_down"));
234 // checkboxes
235 Bind(wxEVT_CHECKBOX, &BatchFrame::OnCheckOverwrite, this, XRCID("cb_overwrite"));
236 Bind(wxEVT_CHECKBOX, &BatchFrame::OnCheckVerbose, this, XRCID("cb_verbose"));
237 Bind(wxEVT_CHECKBOX, &BatchFrame::OnCheckAutoRemove, this, XRCID("cb_autoremove"));
238 Bind(wxEVT_CHECKBOX, &BatchFrame::OnCheckAutoStitch, this, XRCID("cb_autostitch"));
239 Bind(wxEVT_CHECKBOX, &BatchFrame::OnCheckSaveLog, this, XRCID("cb_savelog"));
240 // some general flow events
249}
250
251wxStatusBar* BatchFrame::OnCreateStatusBar(int number, long style, wxWindowID id, const wxString& name)
252{
253 m_progStatusBar = new ProgressStatusBar(this, id, style, name);
254 m_progStatusBar->SetFieldsCount(number);
255 return m_progStatusBar;
256}
257
259{
260 return m_batch->IsRunning();
261};
262
264{
265 return m_batch->IsPaused();
266};
267
269{
271 bool change = false;
272 for(int i = 0; i< m_batch->GetProjectCount(); i++)
273 {
275 {
276 tempFile.Assign(m_batch->GetProject(i)->path);
277 if(tempFile.FileExists())
278 {
280 modify=tempFile.GetModificationTime();
281 if(m_batch->GetProject(i)->skip)
282 {
283 change = true;
284 m_batch->GetProject(i)->skip = false;
287 }
288 else if(!modify.IsEqualTo(m_batch->GetProject(i)->modDate))
289 {
290 change = true;
294 {
296 };
298 }
299 if (!m_batch->GetProject(i)->userDefindSequence.empty())
300 {
301 // check for existence of user defined sequence
302 if (!wxFileName::FileExists(m_batch->GetProject(i)->userDefindSequence))
303 {
304 change = true;
305 m_batch->GetProject(i)->skip = true;
308 };
309 };
310 }
311 else
312 {
314 {
315 change = true;
316 m_batch->GetProject(i)->skip = true;
319 }
320 }
321 }
323 {
324 change = true;
325 }
326 }
327 if(change)
328 {
329 m_batch->SaveTemp();
330 };
331 // start timer again
332 m_updateProjectsTimer->StartOnce(2000);
333};
334
335void BatchFrame::OnUserExit(wxCommandEvent& event)
336{
337 Close(true);
338};
339
341{
342 wxTextEntryDialog dlg(this,_("Please enter the command-line application to execute:"),_("Enter application"));
343 wxTheApp->SetEvtHandlerEnabled(false);
344 if(dlg.ShowModal() == wxID_OK)
345 {
346 wxString line = dlg.GetValue();
347 m_batch->AddAppToBatch(line);
348 //SetStatusText(_T("Added application"));
350 m_batch->SaveTemp();
351 }
352 wxTheApp->SetEvtHandlerEnabled(true);
353}
354
356{
357 wxString defaultdir = wxConfigBase::Get()->Read("/BatchFrame/actualPath",wxEmptyString);
358 wxDirDialog dlg(this,
359 _("Specify a directory to search for projects in"),
361 dlg.SetPath(wxConfigBase::Get()->Read("/BatchFrame/actualPath",wxEmptyString));
362 if (dlg.ShowModal() == wxID_OK)
363 {
364 wxConfig::Get()->Write("/BatchFrame/actualPath", dlg.GetPath()); // remember for later
365 AddDirToList(dlg.GetPath());
366 };
367}
368
369void BatchFrame::OnButtonSearchPano(wxCommandEvent& e)
370{
372 findpano_dlg.ShowModal();
373};
374
376{
377 wxString defaultdir = wxConfigBase::Get()->Read("/BatchFrame/actualPath", wxEmptyString);
379 _("Specify project source file(s)"),
381 _("Project files (*.pto)|*.pto|All files (*)|*"),
383 dlg.SetDirectory(defaultdir);
384
385 if (dlg.ShowModal() == wxID_OK)
386 {
387 wxConfig::Get()->Write("/BatchFrame/actualPath", wxPathOnly(dlg.GetPath()));
389 if (sequenceDialog.IsValidPanorama())
390 {
391 if (sequenceDialog.ShowModal())
392 {
393 };
394 }
395 else
396 {
397 hugin_utils::HuginMessageBox(wxString::Format(_("Could not read file %s as valid Hugin pto file."), dlg.GetPath()), _("PTBatcherGUI"),
398 wxOK | wxICON_EXCLAMATION, this);
399 };
400 };
401};
402
404{
405 wxString defaultdir = wxConfigBase::Get()->Read("/BatchFrame/actualPath",wxEmptyString);
407 _("Specify project source file(s)"),
409 _("Project files (*.pto)|*.pto|All files (*)|*"),
411 dlg.SetDirectory(defaultdir);
412
413 if (dlg.ShowModal() == wxID_OK)
414 {
416 dlg.GetPaths(paths);
417#ifdef __WXGTK__
418 //workaround a bug in GTK, see https://bugzilla.redhat.com/show_bug.cgi?id=849692 and http://trac.wxwidgets.org/ticket/14525
419 wxConfig::Get()->Write("/BatchFrame/actualPath", wxPathOnly(paths[0])); // remember for later
420#else
421 wxConfig::Get()->Write("/BatchFrame/actualPath", dlg.GetDirectory()); // remember for later
422#endif
423 for(unsigned int i=0; i<paths.GetCount(); i++)
424 {
425 AddToList(paths.Item(i));
426 }
427 m_batch->SaveTemp();
428 };
429}
430
432{
433 wxString defaultdir = wxConfigBase::Get()->Read("/BatchFrame/actualPath",wxEmptyString);
435 _("Specify project source file(s)"),
437 _("Project files (*.pto)|*.pto|All files (*)|*"),
439 dlg.SetDirectory(defaultdir);
440
441 if (dlg.ShowModal() == wxID_OK)
442 {
444 dlg.GetPaths(paths);
445#ifdef __WXGTK__
446 //workaround a bug in GTK, see https://bugzilla.redhat.com/show_bug.cgi?id=849692 and http://trac.wxwidgets.org/ticket/14525
447 wxConfig::Get()->Write("/BatchFrame/actualPath", wxPathOnly(paths[0])); // remember for later
448#else
449 wxConfig::Get()->Write("/BatchFrame/actualPath", dlg.GetDirectory()); // remember for later
450#endif
451
452 for(unsigned int i=0; i<paths.GetCount(); i++)
453 {
455 }
456 m_batch->SaveTemp();
457 };
458}
459
461{
462 //we traverse all subdirectories of chosen path
464 wxDir dir(aDir);
465 dir.Traverse(traverser);
466 wxArrayString projects = traverser.GetProjectFiles();
467 for(unsigned int i=0; i<projects.GetCount(); i++)
468 {
471 if(!proj->isAligned)
472 {
474 };
476 };
477 m_batch->SaveTemp();
478 SetStatusText(wxString::Format(_("Added projects from dir %s"), aDir.c_str()));
479};
480
482{
484 wxString s;
485 switch(target)
486 {
488 s=wxString::Format(_("Add project %s to stitching queue."),aFile.c_str());
489 break;
491 s=wxString::Format(_("Add project %s to assistant queue."),aFile.c_str());
492 break;
493 };
496 m_batch->SaveTemp();
497}
498
500{
501 for (size_t i = 0; i < fileList.GetCount(); ++i)
502 {
505 };
506 m_batch->SaveTemp();
507}
508
510{
511 GetToolBar()->ToggleTool(XRCID("tool_pause"),false);
512 m_cancelled = true;
514 SetStatusText(_("Batch stopped"));
515 if (m_tray)
516 {
517 m_tray->SetIcon(m_iconNormal, _("Hugin's Batch processor"));
518 };
519}
520
522{
524 if(selected.size()== 1)
525 {
526 Project* project = m_batch->GetProject(*selected.begin());
527 if (project->id < 0)
528 {
529 SetStatusText(_("The prefix of command cannot be changed."));
530 wxBell();
531 return;
532 }
533 if (project->target == Project::STITCHING)
534 {
535 wxFileName prefix(project->prefix);
536 wxFileDialog dlg(0, wxString::Format(_("Specify output prefix for project %s"), project->path),
537 prefix.GetPath(),
538 prefix.GetFullName(), wxEmptyString,
540 if (dlg.ShowModal() == wxID_OK)
541 {
542 while(containsInvalidCharacters(dlg.GetPath()))
543 {
544 wxArrayString list;
545 list.Add(dlg.GetPath());
546 ShowFilenameWarning(this, list);
547 if(dlg.ShowModal()!=wxID_OK)
548 {
549 return;
550 }
551 };
552 wxFileName prefix(dlg.GetPath());
553 while (!prefix.IsDirWritable())
554 {
555 hugin_utils::HuginMessageBox(wxString::Format(_("You have no permissions to write in folder \"%s\".\nPlease select another folder for the final output."), prefix.GetPath()),
556 _("PTBatcherGUI"), wxOK | wxICON_INFORMATION, this);
557 if (dlg.ShowModal() != wxID_OK)
558 {
559 return;
560 };
561 prefix = dlg.GetPath();
562 };
563
564 wxString outname(dlg.GetPath());
565 ChangePrefix(*selected.begin(), outname);
566 //SetStatusText(_T("Changed prefix for "+projListBox->GetSelectedProject()));
567 m_batch->SaveTemp();
568 }
569 }
570 else
571 {
572 SetStatusText(_("The prefix of an assistant target cannot be changed."));
573 wxBell();
574 };
575 }
576 else
577 {
578 if (selected.empty())
579 {
580 SetStatusText(_("Please select a project"));
581 }
582 else
583 {
584 wxBell();
585 SetStatusText(_("Please select only one project"));
586 };
587 };
588}
589
591{
592 int i;
593 if(index!=-1)
594 {
595 i=index;
596 }
597 else
598 {
600 }
603}
604
606{
607 int i;
608 if (index != -1)
609 {
610 i = index;
611 }
612 else
613 {
614 i = m_batch->GetProjectCount() - 1;
615 }
618}
619
621{
623 if (selectedProjects.empty())
624 {
625 SetStatusText(_("Please select a project"));
626 }
627 else
628 {
629 Project* project = m_batch->GetProject(*selectedProjects.begin());
630 const Project::Target target = project->target;
631 for (auto& i : selectedProjects)
632 {
634 if (projectI->id < 0)
635 {
636 wxBell();
637 SetStatusText(_("Changing user defined sequence is not possible for application entries."));
638 return;
639 };
640 if (target != projectI->target)
641 {
642 wxBell();
643 SetStatusText(_("You can change the user defined sequence only for the same type of operation (either stitching or assistant)."));
644 return;
645 }
646 };
648 if (dialog.ShowModal() == wxID_OK)
649 {
650 const wxString newUserDefined = dialog.GetNewSequence();
651 for (auto& i : selectedProjects)
652 {
655 };
656 };
657 };
658}
659
660void BatchFrame::OnButtonClear(wxCommandEvent& event)
661{
663 if(returnCode == 0)
664 {
665 projListBox->DeleteAllItems();
666 }
667 else if(returnCode == 2)
668 {
669 m_cancelled = true;
670 projListBox->DeleteAllItems();
671 if(GetToolBar()->GetToolState(XRCID("tool_pause")))
672 {
673 GetToolBar()->ToggleTool(XRCID("tool_pause"),false);
674 }
675 }
676 m_batch->SaveTemp();
677}
678
679void BatchFrame::OnButtonHelp(wxCommandEvent& event)
680{
681 DEBUG_TRACE("");
682 GetHelpController().DisplaySection("Hugin_Batch_Processor.html");
683}
684
686{
688 if (selected.size() == 1)
689 {
690 SwapProject(*selected.begin(), true);
691 m_batch->SaveTemp();
692 }
693 else
694 {
695 wxBell();
696 };
697}
698
700{
702 if (selected.size() == 1)
703 {
704 SwapProject(*selected.begin() - 1, false);
705 m_batch->SaveTemp();
706 }
707 else
708 {
709 wxBell();
710 };
711}
712
714{
715 wxString defaultdir = wxConfigBase::Get()->Read("/BatchFrame/batchPath",wxEmptyString);
717 _("Specify batch file to open"),
719 _("Batch file (*.ptq)|*.ptq;|All files (*)|*"),
721 if (dlg.ShowModal() == wxID_OK)
722 {
723 wxConfig::Get()->Write("/BatchFrame/batchPath", dlg.GetDirectory()); // remember for later
724 int clearCode = m_batch->LoadBatchFile(dlg.GetPath());
725 //1 is error code for not clearing batch
726 if(clearCode!=1)
727 {
728 /*if(clearCode==2) //we just cancelled the batch, so we need to try loading again
729 m_batch->LoadBatchFile(dlg.GetPath());*/
730 projListBox->DeleteAllItems();
732 m_batch->SaveTemp();
733 }
734 }
735}
736
738{
739 const wxFileName exePath(wxStandardPaths::Get().GetExecutablePath());
741 if (selected.size() == 1)
742 {
743 if (projListBox->GetText(*selected.begin(), 0).Cmp(_T("")) != 0)
744#ifdef __WXMAC__
745 wxExecute(_T("open -b net.sourceforge.Hugin \"" + m_batch->GetProject(*selected.begin())->path + _T("\"")));
746#else
747 wxExecute(exePath.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR) + _T("hugin \"" + m_batch->GetProject(*selected.begin())->path + _T("\" -notips")));
748#endif
749 else
750 {
751 SetStatusText(_("Cannot open app in Hugin."));
752 };
753 }
754 else
755 {
756 if (selected.empty())
757 {
758 //ask user if he/she wants to load an empty project
759 if (hugin_utils::HuginMessageBox(_("No project selected. Open Hugin without project?"), _("PTBatcherGUI"), wxYES_NO|wxICON_INFORMATION, this) == wxYES)
760 {
761#ifdef __WXMAC__
762 wxExecute(_T("open -b net.sourceforge.Hugin"));
763#else
765#endif
766 }
767 }
768 else
769 {
770 wxBell();
771 SetStatusText(_("Please select only one project"));
772 };
773 };
774}
775
776void BatchFrame::OnButtonPause(wxCommandEvent& event)
777{
778 if(m_batch->GetRunningCount()>0)
779 {
780 if(!m_batch->IsPaused())
781 {
783 GetToolBar()->ToggleTool(XRCID("tool_pause"),true);
784 SetStatusText(_("Batch paused"));
785 if (m_tray)
786 {
787 m_tray->SetIcon(m_iconPaused, _("Pausing processing Hugin's batch queue"));
788 };
789 }
790 else
791 {
793 GetToolBar()->ToggleTool(XRCID("tool_pause"),false);
794 SetStatusText(_("Continuing batch..."));
795 if (m_tray)
796 {
797 m_tray->SetIcon(m_iconRunning, _("Processing Hugin's batch queue"));
798 };
799 }
800 }
801 else //if no projects are running, we deactivate the button
802 {
803 GetToolBar()->ToggleTool(XRCID("tool_pause"),false);
804 }
806}
807
809{
810 bool removeErrors=false;
811 if(!m_batch->NoErrors())
812 {
813 if (hugin_utils::HuginMessageBox(_("There are failed projects in the list.\nRemove them too?"), _("PTBatcherGUI"), wxYES_NO | wxICON_INFORMATION, this) == wxYES)
814 {
815 removeErrors=true;
816 }
817 }
818 for(int i=projListBox->GetItemCount()-1; i>=0; i--)
819 {
822 {
824 projListBox->DeleteItem(i);
826 }
827 }
828 m_batch->SaveTemp();
829}
830
832{
833
835 if(!selected.empty())
836 {
837 for (auto i = selected.rbegin(); i != selected.rend(); ++i)
838 {
839 const int selIndex = *i;
841 {
842 if (hugin_utils::HuginMessageBox(_("Cannot remove project in progress.\nDo you want to cancel it?"), _("PTBatcherGUI"), wxYES_NO | wxICON_INFORMATION, this) == wxYES)
843 {
845 };
846 }
847 else
848 {
849 SetStatusText(wxString::Format(_("Removed project %s"), m_batch->GetProject(selIndex)->path.c_str()));
851 projListBox->DeleteItem(selIndex);
853 m_batch->SaveTemp();
854 };
855 };
856 }
857 else
858 {
859 SetStatusText(_("Please select a project to remove"));
860 }
861}
862
863
864void BatchFrame::OnButtonReset(wxCommandEvent& event)
865{
867 if(!selected.empty())
868 {
869 for (auto selIndex : selected)
870 {
872 {
873 if (hugin_utils::HuginMessageBox(_("Cannot reset project in progress.\nDo you want to cancel it?"), _("PTBatcherGUI"), wxYES_NO | wxICON_INFORMATION, this) == wxYES)
874 {
876 }
877 }
878 else
879 {
881 SetStatusText(wxString::Format(_("Reset project %s"), m_batch->GetProject(selIndex)->path.c_str()));
882 };
883 };
884 }
885 else
886 {
887 SetStatusText(_("Please select a project to reset"));
888 }
889 m_batch->SaveTemp();
890}
891
893{
894 if(m_batch->GetRunningCount()!=0)
895 {
896 if (hugin_utils::HuginMessageBox(_("Cannot reset projects in progress.\nDo you want to cancel the batch?"), _("PTBatcherGUI"), wxYES_NO | wxICON_INFORMATION, this) == wxYES)
897 {
899 }
900 }
901 else
902 {
903 for(int i=projListBox->GetItemCount()-1; i>=0; i--)
904 {
906 }
907 }
908 m_batch->SaveTemp();
909}
910
912{
913 if(m_batch->IsPaused())
914 {
915 //m_batch->paused = false;
917 }
918 else
919 {
920 RunBatch();
921 }
922}
923
925{
926 wxString defaultdir = wxConfigBase::Get()->Read("/BatchFrame/batchPath",wxEmptyString);
928 _("Specify batch file to save"),
930 _("Batch file (*.ptq)|*.ptq;|All files (*)|*"),
932 if (dlg.ShowModal() == wxID_OK)
933 {
934 wxConfig::Get()->Write("/BatchFrame/batchPath", dlg.GetDirectory()); // remember for later
935 m_batch->SaveBatchFile(dlg.GetPath());
936 }
937}
938
939void BatchFrame::OnButtonSkip(wxCommandEvent& event)
940{
942 if(!selected.empty())
943 {
944 for (auto selIndex : selected)
945 {
948 {
950 {
951 if (m_batch->GetRunningCount() == 1)
952 {
953 GetToolBar()->ToggleTool(XRCID("tool_pause"), false);
954 }
955 for (int i = 0; i < m_batch->GetRunningCount(); i++)
956 {
959 {
961 }
962 }
963 }
964 else
965 {
966 //we go through all running projects to find the one with the same id as chosen one
967 for (int i = 0; i < m_batch->GetRunningCount(); i++)
968 {
971 {
973 }
974 }
975 }
976 }
977 else
978 {
980 };
981 };
982 }
983}
984
986{
987 for (unsigned int i = 0; i<list->GetCount(); i++)
988 {
989 if (static_cast<Batch::EndTask>((size_t)list->GetClientData(i)) == endTask)
990 {
991 list->SetSelection(i);
992 return;
993 };
994 };
995 list->SetSelection(0);
996};
997
999{
1000 wxConfigBase* config=wxConfigBase::Get();
1001 int i;
1002 // read older version
1003#if defined __WXMAC__ || defined __WXOSX_COCOA__
1004 i = 0;
1005#else
1006 i=config->Read("/BatchFrame/ShutdownCheck", 0l);
1007#endif
1008 if (i != 0)
1009 {
1012 };
1013 config->DeleteEntry("/BatchFrame/ShutdownCheck");
1014 // now read current version
1015 i = config->Read("/BatchFrame/AtEnd", 0l);
1016#if defined __WXMAC__ || defined __WXOSX_COCOA__
1017 // wxWidgets for MacOS does not support wxShutdown
1018 if (i == Batch::SHUTDOWN)
1019 {
1020 i = 0;
1021 };
1022#endif
1023 m_batch->atEnd = static_cast<Batch::EndTask>(i);
1025 i=config->Read("/BatchFrame/OverwriteCheck", 0l);
1026 XRCCTRL(*this,"cb_overwrite",wxCheckBox)->SetValue(i!=0);
1027 m_batch->overwrite=(i!=0);
1028 i=config->Read("/BatchFrame/VerboseCheck", 0l);
1029 XRCCTRL(*this,"cb_verbose",wxCheckBox)->SetValue(i!=0);
1030 m_batch->verbose=(i!=0);
1031 i=config->Read("/BatchFrame/AutoRemoveCheck", 1l);
1032 XRCCTRL(*this,"cb_autoremove",wxCheckBox)->SetValue(i!=0);
1033 m_batch->autoremove=(i!=0);
1034 i=config->Read("/BatchFrame/AutoStitchCheck", 0l);
1035 XRCCTRL(*this,"cb_autostitch",wxCheckBox)->SetValue(i!=0);
1036 m_batch->autostitch=(i!=0);
1037 i=config->Read("/BatchFrame/SaveLog", 0l);
1038 XRCCTRL(*this, "cb_savelog",wxCheckBox)->SetValue(i!=0);
1039 m_batch->saveLog=(i!=0);
1040};
1041
1043{
1044 return static_cast<Batch::EndTask>((size_t)m_endChoice->GetClientData(m_endChoice->GetSelection()));
1045};
1046
1048{
1049 return XRCCTRL(*this,"cb_overwrite",wxCheckBox)->IsChecked();
1050};
1051
1053{
1054 return XRCCTRL(*this,"cb_verbose",wxCheckBox)->IsChecked();
1055};
1056
1058{
1059 return XRCCTRL(*this,"cb_autoremove",wxCheckBox)->IsChecked();
1060};
1061
1063{
1064 return XRCCTRL(*this,"cb_autostitch",wxCheckBox)->IsChecked();
1065};
1066
1068{
1069 return XRCCTRL(*this,"cb_savelog",wxCheckBox)->IsChecked();
1070};
1071
1073{
1074 wxConfigBase* config=wxConfigBase::Get();
1075 if(event.IsChecked())
1076 {
1077 m_batch->overwrite = true;
1078 config->Write("/BatchFrame/OverwriteCheck", 1l);
1079 }
1080 else
1081 {
1082 m_batch->overwrite = false;
1083 config->Write("/BatchFrame/OverwriteCheck", 0l);
1084 }
1085 config->Flush();
1086}
1087
1088void BatchFrame::OnChoiceEnd(wxCommandEvent& event)
1089{
1090 m_batch->atEnd = static_cast<Batch::EndTask>((size_t)m_endChoice->GetClientData(event.GetSelection()));
1091 wxConfigBase* config=wxConfigBase::Get();
1092 config->Write("/BatchFrame/AtEnd", static_cast<long>(m_batch->atEnd));
1093 config->Flush();
1094}
1095
1097{
1098 wxConfigBase* config=wxConfigBase::Get();
1099 if(event.IsChecked())
1100 {
1101 m_batch->verbose = true;
1102 config->Write("/BatchFrame/VerboseCheck", 1l);
1103 }
1104 else
1105 {
1106 m_batch->verbose = false;
1107 config->Write("/BatchFrame/VerboseCheck", 0l);
1108 };
1109 config->Flush();
1111}
1112
1117
1119{
1120 m_batch->autoremove=event.IsChecked();
1121 wxConfigBase* config=wxConfigBase::Get();
1122 if(m_batch->autoremove)
1123 {
1124 config->Write("/BatchFrame/AutoRemoveCheck", 1l);
1125 }
1126 else
1127 {
1128 config->Write("/BatchFrame/AutoRemoveCheck", 0l);
1129 }
1130 config->Flush();
1131};
1132
1134{
1135 m_batch->autostitch=event.IsChecked();
1136 wxConfigBase* config=wxConfigBase::Get();
1137 if(m_batch->autostitch)
1138 {
1139 config->Write("/BatchFrame/AutoStitchCheck", 1l);
1140 }
1141 else
1142 {
1143 config->Write("/BatchFrame/AutoStitchCheck", 0l);
1144 }
1145 config->Flush();
1146};
1147
1149{
1150 m_batch->saveLog=event.IsChecked();
1151 wxConfigBase* config=wxConfigBase::Get();
1152 if(m_batch->saveLog)
1153 {
1154 config->Write("/BatchFrame/SaveLog", 1l);
1155 }
1156 else
1157 {
1158 config->Write("/BatchFrame/SaveLog", 0l);
1159 }
1160 config->Flush();
1161};
1162
1164{
1165 // check size of batch queue
1166 if (m_batch->GetProjectCount() > 500)
1167 {
1168 hugin_utils::MessageDialog message = hugin_utils::GetMessageDialog(_("The batch queue contains many items.\nThis can have negative effects on performance.\nShould the batch queue be cleared now?"),
1169 _("PTBatcherGUI"), wxYES_NO | wxICON_INFORMATION, this);
1170 message->SetYesNoLabels(_("Clear batch queue now"), _("Keep batch queue"));
1171 if (message->ShowModal() == wxID_YES)
1172 {
1174 m_batch->SaveTemp();
1175 };
1176 };
1177 //save windows position
1178 wxConfigBase* config=wxConfigBase::Get();
1179 if(IsMaximized())
1180 {
1181 config->Write("/BatchFrame/Max", 1l);
1182 config->Write("/BatchFrame/Minimized", 0l);
1183 }
1184 else
1185 {
1186 config->Write("/BatchFrame/Max", 0l);
1187 if(m_tray!=NULL && !IsShown())
1188 {
1189 config->Write("/BatchFrame/Minimized", 1l);
1190 }
1191 else
1192 {
1193 config->Write("/BatchFrame/Minimized", 0l);
1194 config->Write("/BatchFrame/Width", GetSize().GetWidth());
1195 config->Write("/BatchFrame/Height", GetSize().GetHeight());
1196 };
1197 }
1198 config->Flush();
1199 if(m_tray!=NULL)
1200 {
1201 delete m_tray;
1202 m_tray = NULL;
1203 }
1204 delete m_updateProjectsTimer;
1205 this->Destroy();
1206}
1207
1216
1218{
1219 if(!IsRunning())
1220 {
1221 SetStatusText(_("Starting batch"));
1222 if (m_tray)
1223 {
1224 m_tray->SetIcon(m_iconRunning, _("Processing Hugin's batch queue"));
1225 };
1226 }
1227 m_batch->RunBatch();
1228}
1229
1231{
1232 m_locale = locale;
1233 m_xrcPrefix = xrc;
1234}
1235
1236void BatchFrame::SwapProject(int index, bool down)
1237{
1238 if(index>=0 && index<(projListBox->GetItemCount()-1))
1239 {
1240 projListBox->SwapProject(index);
1241 m_batch->SwapProject(index);
1242 if(down)
1243 {
1244 projListBox->Deselect(index);
1245 projListBox->Select(index + 1);
1246 }
1247 else
1248 {
1249 projListBox->Select(index);
1250 projListBox->Deselect(index + 1);
1251 };
1252 }
1253}
1254
1255
1257{
1258 if(m_batch->GetRunningCount()==1)
1259 {
1260 GetToolBar()->ToggleTool(XRCID("tool_pause"),false);
1261 if (m_tray)
1262 {
1263 m_tray->SetIcon(m_iconNormal, _("Hugin's Batch processor"));
1264 };
1265 }
1266 event.Skip();
1267}
1268
1270{
1271 //get saved size
1272 wxConfigBase* config=wxConfigBase::Get();
1273 int width = config->Read("/BatchFrame/Width", -1l);
1274 int height = config->Read("/BatchFrame/Height", -1l);
1275 int max = config->Read("/BatchFrame/Max", -1l);
1276 int min = config->Read("/BatchFrame/Minimized", -1l);
1277 if((width != -1) && (height != -1))
1278 {
1279 SetSize(width,height);
1280 }
1281 else
1282 {
1283 SetSize(this->FromDIP(wxSize(600,400)));
1284 }
1285
1286 if(max==1)
1287 {
1288 Maximize();
1289 };
1290 m_startedMinimized=(m_tray!=NULL) && (min==1);
1291}
1292
1294{
1296 {
1297 if (m_tray)
1298 {
1299 m_tray->SetIcon(m_iconNormal, _("Hugin's Batch processor"));
1300 };
1302 failedProjects_dlg.ShowModal();
1303 };
1304};
1305
1306void BatchFrame::OnBatchInformation(wxCommandEvent& e)
1307{
1308 SetStatusText(e.GetString());
1309 if (m_tray && e.GetInt() == 1)
1310 {
1311 // batch finished, reset icon in task bar
1312 m_tray->SetIcon(m_iconNormal, _("Hugin's Batch processor"));
1313 };
1314};
1315
1316void BatchFrame::OnProgress(wxCommandEvent& e)
1317{
1318 m_progStatusBar->SetProgress(e.GetInt());
1320};
1321
1323{
1324#if defined __WXMSW__ && wxUSE_TASKBARBUTTON
1325 // provide also a feedback in task bar if available
1326 if (IsShown())
1327 {
1329 if (taskBarButton != NULL)
1330 {
1331 if (m_progStatusBar->GetProgress() < 0)
1332 {
1334 }
1335 else
1336 {
1337 taskBarButton->SetProgressRange(100);
1339 taskBarButton->SetProgressValue(m_progStatusBar->GetProgress());
1340 };
1341 };
1342 };
1343#endif
1344};
1345
1347{
1348 //hide/show window in taskbar when minimizing
1349 if(m_tray!=NULL)
1350 {
1351 Show(!e.IsIconized());
1352 //switch off verbose output if PTBatcherGUI is in tray/taskbar
1353 if(e.IsIconized())
1354 {
1355 m_batch->verbose=false;
1356 }
1357 else
1358 {
1359 m_batch->verbose=XRCCTRL(*this,"cb_verbose",wxCheckBox)->IsChecked();
1361 };
1363 }
1364 else //don't hide window if no tray icon
1365 {
1366 if (!e.IsIconized())
1367 {
1368 // window is restored, update progress indicators
1370 };
1371 e.Skip();
1372 };
1373};
1374
1376{
1377 m_batch->verbose=XRCCTRL(*this,"cb_verbose",wxCheckBox)->IsChecked();
1379};
1380
1382{
1384 std::set<long> selectedID;
1385 for (auto index : selected)
1386 {
1387 selectedID.insert(m_batch->GetProject(index)->id);
1388 };
1389 projListBox->DeleteAllItems();
1391 for(auto id:selectedID)
1392 {
1393 int index=projListBox->GetIndex(id);
1394 if(index!=-1)
1395 {
1396 projListBox->Select(index);
1397 };
1398 };
1399};
1400
1402{
1403 UpdateTrayIcon(event.IsChecked());
1404 wxConfigBase* config=wxConfigBase::Get();
1405 config->Write("/BatchFrame/minimizeTray", event.IsChecked());
1406 config->Flush();
1407}
1408
1410{
1411 if (createTrayIcon)
1412 {
1413 // create tray icon only if it not exists
1414 if (m_tray)
1415 {
1416 delete m_tray;
1417 m_tray = NULL;
1418 }
1419 m_tray = new BatchTaskBarIcon();
1420 if (m_batch->IsRunning())
1421 {
1422 m_tray->SetIcon(m_iconRunning, _("Processing Hugin's batch queue"));
1423 }
1424 else
1425 {
1426 if (m_batch->IsPaused())
1427 {
1428 m_tray->SetIcon(m_iconPaused, _("Pausing processing Hugin's batch queue"));
1429 }
1430 else
1431 {
1432 m_tray->SetIcon(m_iconNormal, _("Hugin's Batch processor"));
1433 }
1434 }
1435 }
1436 else
1437 {
1438 // destroy tray icon
1439 if (m_tray)
1440 {
1441 delete m_tray;
1442 m_tray = NULL;
1443 }
1444 }
1445}
@ EVT_TIMER_UPDATE_LISTBOX
void SelectEndTask(wxControlWithItems *list, const Batch::EndTask endTask)
Batch processor for Hugin with GUI.
Definition of failed projects dialog.
Definition of dialog to change user defined sequence.
Definition of GenerateSequenceDialog class.
Batch processor for Hugin with GUI.
Simple class that forward the drop to the mainframe.
Definition BatchFrame.h:45
bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &filenames)
File/directory drag and drop handler method.
ProgressStatusBar * m_progStatusBar
Definition BatchFrame.h:170
void ChangeUserDefined(int index, wxString newUserDefined)
void OnButtonResetAll(wxCommandEvent &event)
void OnMinimizeTrayMenu(wxCommandEvent &e)
void UpdateTrayIcon(const bool createTrayIcon)
create or destroy the tray icon
wxIcon m_iconRunning
Definition BatchFrame.h:172
void OnButtonRunBatch(wxCommandEvent &event)
bool m_startedMinimized
Definition BatchFrame.h:176
wxString m_xrcPrefix
Definition BatchFrame.h:162
void OnButtonPause(wxCommandEvent &event)
void PropagateDefaults()
void OnCheckVerbose(wxCommandEvent &event)
void OnCheckOverwrite(wxCommandEvent &event)
ProjectListBox * projListBox
Definition BatchFrame.h:158
void OnRefillListBox(wxCommandEvent &e)
called if the project box needs to be updated, because projects were added or deleted
bool IsPaused()
returns true, if batch is paused
void SetInternalVerbose(bool newVerbose)
sets the current verbose status, does not update the checkbox
void AddArrayToList(const wxArrayString &fileList, Project::Target target)
void OnButtonAddToAssistantQueue(wxCommandEvent &event)
let the user select a project file which should be added to the stitching queue
void OnButtonMoveUp(wxCommandEvent &event)
void SwapProject(int index, bool down)
wxHelpController & GetHelpController()
return help controller for open help
Definition BatchFrame.h:155
void UpdateBatchVerboseStatus()
update visibility of verbose output window depending on status of verbose checkbox
void OnProgress(wxCommandEvent &event)
event handler for update progress controls
void OnButtonRemoveFromList(wxCommandEvent &event)
wxTimer * m_updateProjectsTimer
Definition BatchFrame.h:175
void RunBatch()
void OnCheckAutoStitch(wxCommandEvent &event)
event handler called when auto stitch checkbox was changed
wxChoice * m_endChoice
Definition BatchFrame.h:166
void OnButtonSkip(wxCommandEvent &event)
void OnButtonAddDir(wxCommandEvent &event)
void OnUpdateListBox(wxTimerEvent &event)
called by thread to update listbox
bool GetCheckAutoRemove()
return if auto remove checkbox is checked
wxIcon m_iconPaused
Definition BatchFrame.h:173
Batch::EndTask GetEndTask()
return which task should be executed at end
void OnButtonChangePrefix(wxCommandEvent &event)
void OnButtonAddToStitchingQueue(wxCommandEvent &event)
let the user select a project file which should be added to the stitching queue
void OnProcessTerminate(wxProcessEvent &event)
Batch * m_batch
Definition BatchFrame.h:163
BatchTaskBarIcon * m_tray
Definition BatchFrame.h:169
void OnButtonOpenBatch(wxCommandEvent &event)
void OnButtonChangeUserDefinedSequence(wxCommandEvent &event)
void OnButtonGenerateSequence(wxCommandEvent &e)
generate a sequence of panoramas
void OnButtonMoveDown(wxCommandEvent &event)
void OnButtonReset(wxCommandEvent &event)
bool GetCheckSaveLog()
return if always save log is checked
void OnButtonHelp(wxCommandEvent &event)
void SetCheckboxes()
void OnClose(wxCloseEvent &event)
void OnButtonSearchPano(wxCommandEvent &e)
void OnButtonCancel(wxCommandEvent &event)
wxStatusBar * OnCreateStatusBar(int number, long style, wxWindowID id, const wxString &name)
bool GetCheckVerbose()
return if verbose checkbox is checked
void OnCheckSaveLog(wxCommandEvent &event)
event handler called when always save log checkbox was changed
bool GetCheckAutoStitch()
return if auto stitch checkbox is checked
void SetLocaleAndXRC(wxLocale *locale, wxString xrc)
void OnBatchInformation(wxCommandEvent &e)
called when batch wants to show some progress message
void OnCheckAutoRemove(wxCommandEvent &event)
event handler called when auto remove checkbox was changed
void OnBatchFailed(wxCommandEvent &event)
called when batch was finished and there are failed projects
wxIcon m_iconNormal
Definition BatchFrame.h:171
wxLocale * m_locale
Definition BatchFrame.h:161
bool GetCheckOverwrite()
return if overwrite checkbox is checked
void OnButtonOpenWithHugin(wxCommandEvent &event)
void OnButtonSaveBatch(wxCommandEvent &event)
void OnMinimize(wxIconizeEvent &e)
handle when minimize or restore image
void OnButtonAddCommand(wxCommandEvent &event)
bool IsRunning()
returns true, if batch is running
bool m_cancelled
Definition BatchFrame.h:164
void OnChoiceEnd(wxCommandEvent &event)
void AddDirToList(wxString aDir)
BatchFrame(wxLocale *locale, wxString xrc)
void OnUserExit(wxCommandEvent &event)
void RestoreSize()
void OnButtonClear(wxCommandEvent &event)
void OnButtonRemoveComplete(wxCommandEvent &event)
void ChangePrefix(int index, wxString newPrefix)
void UpdateTaskBarProgressBar()
update the progress bar in the task bar
void AddToList(wxString aFile, Project::Target target=Project::STITCHING, wxString userDefined=wxEmptyString)
class for showing a taskbar/tray icon
Definition Batch.h:47
int ClearBatch()
Clears batch list and returns 0 if succesful.
Definition Batch.cpp:221
void RunBatch()
Starts batch execution.
Definition Batch.cpp:764
EndTask
Definition Batch.h:50
@ SUSPEND
Definition Batch.h:54
@ CLOSE_PTBATCHERGUI
Definition Batch.h:52
@ HIBERNATE
Definition Batch.h:55
@ SHUTDOWN
Definition Batch.h:53
@ DO_NOTHING
Definition Batch.h:51
void ChangeUserDefined(int index, wxString newUserDefined)
Changes user defined sequence for project at index.
Definition Batch.cpp:216
int GetRunningCount()
Returns number of projects currently in progress.
Definition Batch.cpp:313
void SaveBatchFile(wxString file)
Saves batch list to file.
Definition Batch.cpp:851
void RemoveProjectAtIndex(int selIndex)
Removes project at index from batch list.
Definition Batch.cpp:741
bool CompareProjectsInLists(int stitchListIndex, int batchListIndex)
Compares two project at indexes in both lists and returns true if they have identical project ids.
Definition Batch.cpp:248
void AddProjectToBatch(wxString projectFile, wxString outputFile=wxEmptyString, wxString userDefinedSequence=wxEmptyString, Project::Target target=Project::STITCHING)
Adds a project entry in the batch list.
Definition Batch.cpp:80
bool IsPaused()
Returns true if batch execution is currently paused.
Definition Batch.cpp:336
void PauseBatch()
Pauses and continues batch execution.
Definition Batch.cpp:695
void AddAppToBatch(wxString app)
Adds an application entry in the batch list.
Definition Batch.cpp:74
Project * GetProject(int index)
Returns project at index.
Definition Batch.cpp:290
bool IsRunning()
return true, if batch is running
Definition Batch.cpp:331
Project::Status GetStatus(int index)
Returns current status of project at index.
Definition Batch.cpp:318
void ChangePrefix(int index, wxString newPrefix)
Changes output prefix for project at index.
Definition Batch.cpp:211
bool verbose
Definition Batch.h:60
bool overwrite
Definition Batch.h:59
bool autoremove
Definition Batch.h:62
EndTask atEnd
Definition Batch.h:58
void CancelProject(int index)
Cancels project at index in batch, failing it.
Definition Batch.cpp:198
void SwapProject(int index)
Swaps position in batch of project at index with project at index+1.
Definition Batch.cpp:917
void SetStatus(int index, Project::Status status)
Used internally to set status of selected project.
Definition Batch.cpp:905
bool NoErrors()
Returns true if there are no failed projects in batch.
Definition Batch.cpp:372
int LoadBatchFile(wxString file)
Clears current batch list and loads projects from batch file.
Definition Batch.cpp:341
void SaveTemp()
Saves batch list to temporary file.
Definition Batch.cpp:900
int LoadTemp()
Loads temporary batch file.
Definition Batch.cpp:361
int GetProjectCount()
Returns number of projects in batch list.
Definition Batch.cpp:295
bool saveLog
Definition Batch.h:63
bool autostitch
Definition Batch.h:61
void ShowOutput(bool isVisible=true)
Set visibility of all running projects.
Definition Batch.cpp:923
void CancelBatch()
Stops batch run, failing projects in progress.
Definition Batch.cpp:184
size_t GetFailedProjectsCount()
returns number of failed projects
Definition Batch.h:145
Dialog for changing the user defined sequence.
Dialog for finding panorama in given directory.
Dialog for finding panorama in given directory.
Dialog for generate panoramas from a sequence of images.
class for showing a status bar with progress, the progress bar is always in the last field of the sta...
int GetProgress()
return current progress value, should be in range 0 - 100, or -1 if the progress gauge is hidden
void SetProgress(int progress)
update progress bar
void SwapProject(int index)
void AppendProject(Project *project)
wxString GetText(int row, int column)
void ChangePrefix(int index, wxString newPrefix)
int GetIndex(int id)
HuginBase::UIntSet GetSelectedProjects()
bool UpdateStatus(int index, Project *project)
void ReloadProject(int index, Project *project)
void Deselect(int index)
void Fill(Batch *batch)
void ChangeUserDefined(int index, wxString newUserDefined)
void Select(int index)
void SetMissing(int index)
Target target
wxString userDefindSequence
wxDateTime modDate
wxString path
bool skip
bool isAligned
wxString prefix
void ResetOptions()
#define DEBUG_TRACE(msg)
Definition utils.h:67
std::set< unsigned int > UIntSet
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
Definition wxutils.cpp:176
std::unique_ptr< wxMessageDialogBase > MessageDialog
Definition wxutils.h:90
MessageDialog GetMessageDialog(const wxString &message, const wxString &caption, int style, wxWindow *parent)
Definition wxutils.cpp:212
bool containsInvalidCharacters(const wxString stringToTest)
returns true, if the given strings contains invalid characters
Definition platform.cpp:511
void ShowFilenameWarning(wxWindow *parent, const wxArrayString filelist)
shows a dialog about filename with invalid characters, all names in filelist will be show in list
Definition platform.cpp:524
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41
WXIMPEX void FixHelpSettings()
helper function to check window position settings of help window