28 #include <wx/stdpaths.h>
37 #pragma comment(lib, "PowrProf.lib")
39 #if wxCHECK_VERSION(3,1,0)
40 #include <wx/taskbarbutton.h>
47 BatchFrame* MyBatchFrame = wxGetApp().GetFrame();
52 if(filenames.GetCount()==0)
56 for(
unsigned int i=0; i< filenames.GetCount(); i++)
58 wxFileName file(filenames[i]);
61 if (file.GetExt().CmpNoCase(wxT(
"pto")) == 0 ||
62 file.GetExt().CmpNoCase(wxT(
"ptp")) == 0 ||
63 file.GetExt().CmpNoCase(wxT(
"pts")) == 0 )
88 EVT_TOOL(XRCID("tool_clear"),
BatchFrame::OnButtonClear)
89 EVT_TOOL(XRCID("tool_open"),
BatchFrame::OnButtonOpenBatch)
90 EVT_TOOL(XRCID("tool_save"),
BatchFrame::OnButtonSaveBatch)
91 EVT_TOOL(XRCID("tool_start"),
BatchFrame::OnButtonRunBatch)
92 EVT_TOOL(XRCID("tool_skip"),
BatchFrame::OnButtonSkip)
93 EVT_TOOL(XRCID("tool_pause"),
BatchFrame::OnButtonPause)
94 EVT_TOOL(XRCID("tool_cancel"),
BatchFrame::OnButtonCancel)
95 EVT_TOOL(XRCID("tool_add"),
BatchFrame::OnButtonAddToStitchingQueue)
96 EVT_TOOL(XRCID("tool_remove"),
BatchFrame::OnButtonRemoveFromList)
97 EVT_TOOL(XRCID("tool_adddir"),
BatchFrame::OnButtonAddDir)
98 EVT_MENU(XRCID("menu_add"),
BatchFrame::OnButtonAddToStitchingQueue)
99 EVT_MENU(XRCID("menu_add_assistant"),
BatchFrame::OnButtonAddToAssistantQueue)
100 EVT_MENU(XRCID("menu_remove"),
BatchFrame::OnButtonRemoveFromList)
101 EVT_MENU(XRCID("menu_adddir"),
BatchFrame::OnButtonAddDir)
102 EVT_MENU(XRCID("menu_searchpano"),
BatchFrame::OnButtonSearchPano)
103 EVT_MENU(XRCID("menu_generate_sequence"),
BatchFrame::OnButtonGenerateSequence)
104 EVT_MENU(XRCID("menu_open"),
BatchFrame::OnButtonOpenBatch)
105 EVT_MENU(XRCID("menu_save"),
BatchFrame::OnButtonSaveBatch)
106 EVT_MENU(XRCID("menu_clear"),
BatchFrame::OnButtonClear)
107 EVT_MENU(XRCID("menu_tray"),
BatchFrame::OnMinimizeTrayMenu)
108 EVT_MENU(XRCID("menu_exit"),
BatchFrame::OnUserExit)
109 EVT_MENU(XRCID("menu_help"),
BatchFrame::OnButtonHelp)
110 EVT_BUTTON(XRCID("button_addcommand"),
BatchFrame::OnButtonAddCommand)
111 EVT_BUTTON(XRCID("button_remove"),
BatchFrame::OnButtonRemoveComplete)
112 EVT_BUTTON(XRCID("button_prefix"),
BatchFrame::OnButtonChangePrefix)
113 EVT_BUTTON(XRCID("button_user_defined"),
BatchFrame::OnButtonChangeUserDefinedSequence)
114 EVT_BUTTON(XRCID("button_reset"),
BatchFrame::OnButtonReset)
115 EVT_BUTTON(XRCID("button_resetall"),
BatchFrame::OnButtonResetAll)
116 EVT_BUTTON(XRCID("button_edit"),
BatchFrame::OnButtonOpenWithHugin)
117 EVT_BUTTON(XRCID("button_move_up"),
BatchFrame::OnButtonMoveUp)
118 EVT_BUTTON(XRCID("button_move_down"),
BatchFrame::OnButtonMoveDown)
119 EVT_CHECKBOX(XRCID("cb_overwrite"),
BatchFrame::OnCheckOverwrite)
120 EVT_CHOICE(XRCID("choice_end"),
BatchFrame::OnChoiceEnd)
121 EVT_CHECKBOX(XRCID("cb_verbose"),
BatchFrame::OnCheckVerbose)
122 EVT_CHECKBOX(XRCID("cb_autoremove"),
BatchFrame::OnCheckAutoRemove)
123 EVT_CHECKBOX(XRCID("cb_autostitch"),
BatchFrame::OnCheckAutoStitch)
124 EVT_CHECKBOX(XRCID("cb_savelog"),
BatchFrame::OnCheckSaveLog)
125 EVT_END_PROCESS(-1,
BatchFrame::OnProcessTerminate)
128 EVT_COMMAND(wxID_ANY, EVT_BATCH_FAILED,
BatchFrame::OnBatchFailed)
129 EVT_COMMAND(wxID_ANY, EVT_INFORMATION,
BatchFrame::OnBatchInformation)
130 EVT_COMMAND(wxID_ANY, EVT_UPDATE_PARENT,
BatchFrame::OnRefillListBox)
131 EVT_COMMAND(wxID_ANY, EVT_QUEUE_PROGRESS,
BatchFrame::OnProgress)
137 this->SetLocaleAndXRC(locale,xrc);
141 wxXmlResource::Get()->LoadFrame(
this, (wxWindow* )NULL, wxT(
"batch_frame"));
144 wxApp::s_macExitMenuItemId = XRCID(
"menu_exit");
145 wxApp::s_macHelpMenuTitleName = _(
"&Help");
147 SetMenuBar(wxXmlResource::Get()->LoadMenuBar(
this, wxT(
"batch_menu")));
150 SetToolBar(wxXmlResource::Get()->LoadToolBar(
this, wxT(
"batch_toolbar")));
152 int widths[2] = { -1, 150 };
154 SetStatusWidths(2, widths);
155 SetStatusText(_(
"Not doing much..."));
159 m_iconNormal = wxIcon(m_xrcPrefix + wxT(
"data/ptbatcher.ico"), wxBITMAP_TYPE_ICO);
160 m_iconRunning = wxIcon(m_xrcPrefix + wxT(
"data/ptbatcher_running.ico"), wxBITMAP_TYPE_ICO);
161 m_iconPaused = wxIcon(m_xrcPrefix + wxT(
"data/ptbatcher_pause.ico"), wxBITMAP_TYPE_ICO);
162 wxIconBundle myIcons(m_xrcPrefix + wxT(
"data/ptbatcher.ico"), wxBITMAP_TYPE_ICO);
165 m_iconNormal = wxIcon(m_xrcPrefix + wxT(
"data/ptbatcher.png"), wxBITMAP_TYPE_PNG);
166 m_iconRunning = wxIcon(m_xrcPrefix + wxT(
"data/ptbatcher_running.png"), wxBITMAP_TYPE_PNG);
167 m_iconPaused = wxIcon(m_xrcPrefix + wxT(
"data/ptbatcher_pause.png"), wxBITMAP_TYPE_PNG);
168 SetIcon(m_iconNormal);
171 m_batch =
new Batch(
this);
172 if(wxGetKeyState(WXK_COMMAND))
175 wxString text(_(
"You have pressed the Command key."));
177 wxString text(_(
"You have pressed the Control key."));
179 text.Append(wxT(
"\n"));
180 text.Append(_(
"Should the loading of the batch queue be skipped?"));
181 if(wxMessageBox(text,
187 wxYES_NO | wxICON_EXCLAMATION, NULL)==wxNO)
203 m_endChoice = XRCCTRL(*
this,
"choice_end", wxChoice);
204 m_endChoice->Clear();
207 #if !defined __WXMAC__ && !defined __WXOSX_COCOA__
212 SYSTEM_POWER_CAPABILITIES pwrCap;
213 if (GetPwrCapabilities(&pwrCap))
217 m_endChoice->Append(_(
"Suspend computer"), (
void*)
Batch::SUSPEND);
219 if (pwrCap.SystemS4 && pwrCap.HiberFilePresent)
227 projListBox->Fill(m_batch);
231 if (wxTaskBarIcon::IsAvailable())
235 GetMenuBar()->Enable(XRCID(
"menu_tray"),
true);
238 wxConfigBase::Get()->Read(wxT(
"/BatchFrame/minimizeTray"), &minTray,
false);
239 GetMenuBar()->Check(XRCID(
"menu_tray"), minTray);
240 UpdateTrayIcon(minTray);
243 UpdateTaskBarProgressBar();
249 m_updateProjectsTimer =
new wxTimer(
this, EVT_TIMER_UPDATE_LISTBOX);
251 m_updateProjectsTimer->StartOnce(5000);
280 if(tempFile.FileExists())
283 modify=tempFile.GetModificationTime();
345 wxTextEntryDialog dlg(
this,_(
"Please enter the command-line application to execute:"),_(
"Enter application"));
346 wxTheApp->SetEvtHandlerEnabled(
false);
347 if(dlg.ShowModal() == wxID_OK)
349 wxString
line = dlg.GetValue();
355 wxTheApp->SetEvtHandlerEnabled(
true);
360 wxString defaultdir = wxConfigBase::Get()->Read(wxT(
"/BatchFrame/actualPath"),wxT(
""));
361 wxDirDialog dlg(
this,
362 _(
"Specify a directory to search for projects in"),
363 defaultdir, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST);
364 dlg.SetPath(wxConfigBase::Get()->Read(wxT(
"/BatchFrame/actualPath"),wxT(
"")));
365 if (dlg.ShowModal() == wxID_OK)
367 wxConfig::Get()->Write(wxT(
"/BatchFrame/actualPath"), dlg.GetPath());
375 findpano_dlg.ShowModal();
380 wxString defaultdir = wxConfigBase::Get()->Read(wxT(
"/BatchFrame/actualPath"), wxT(
""));
382 _(
"Specify project source file(s)"),
384 _(
"Project files (*.pto)|*.pto|All files (*)|*"),
385 wxFD_OPEN , wxDefaultPosition);
386 dlg.SetDirectory(defaultdir);
388 if (dlg.ShowModal() == wxID_OK)
390 wxConfig::Get()->Write(wxT(
"/BatchFrame/actualPath"), wxPathOnly(dlg.GetPath()));
392 if (sequenceDialog.IsValidPanorama())
394 if (sequenceDialog.ShowModal())
400 wxMessageBox(wxString::Format(_(
"Could not read file %s as valid Hugin pto file."), dlg.GetPath()),
406 wxOK | wxICON_EXCLAMATION, NULL);
413 wxString defaultdir = wxConfigBase::Get()->Read(wxT(
"/BatchFrame/actualPath"),wxT(
""));
415 _(
"Specify project source file(s)"),
417 _(
"Project files (*.pto)|*.pto|All files (*)|*"),
418 wxFD_OPEN | wxFD_MULTIPLE, wxDefaultPosition);
419 dlg.SetDirectory(defaultdir);
421 if (dlg.ShowModal() == wxID_OK)
427 wxConfig::Get()->Write(wxT(
"/BatchFrame/actualPath"), wxPathOnly(paths[0]));
429 wxConfig::Get()->Write(wxT(
"/BatchFrame/actualPath"), dlg.GetDirectory());
431 for(
unsigned int i=0; i<paths.GetCount(); i++)
441 wxString defaultdir = wxConfigBase::Get()->Read(wxT(
"/BatchFrame/actualPath"),wxT(
""));
443 _(
"Specify project source file(s)"),
445 _(
"Project files (*.pto)|*.pto|All files (*)|*"),
446 wxFD_OPEN | wxFD_MULTIPLE, wxDefaultPosition);
447 dlg.SetDirectory(defaultdir);
449 if (dlg.ShowModal() == wxID_OK)
455 wxConfig::Get()->Write(wxT(
"/BatchFrame/actualPath"), wxPathOnly(paths[0]));
457 wxConfig::Get()->Write(wxT(
"/BatchFrame/actualPath"), dlg.GetDirectory());
460 for(
unsigned int i=0; i<paths.GetCount(); i++)
473 dir.Traverse(traverser);
475 for(
unsigned int i=0; i<projects.GetCount(); i++)
486 SetStatusText(wxString::Format(_(
"Added projects from dir %s"), aDir.c_str()));
496 s=wxString::Format(_(
"Add project %s to stitching queue."),aFile.c_str());
499 s=wxString::Format(_(
"Add project %s to assistant queue."),aFile.c_str());
509 for (
size_t i = 0; i < fileList.GetCount(); ++i)
519 GetToolBar()->ToggleTool(XRCID(
"tool_pause"),
false);
532 if(selected.size()== 1)
537 wxFileName prefix(project->
prefix);
538 wxFileDialog dlg(0, wxString::Format(_(
"Specify output prefix for project %s"), project->
path),
540 prefix.GetFullName(), wxT(
""),
541 wxFD_SAVE, wxDefaultPosition);
542 if (dlg.ShowModal() == wxID_OK)
547 list.Add(dlg.GetPath());
549 if(dlg.ShowModal()!=wxID_OK)
554 wxFileName prefix(dlg.GetPath());
555 while (!prefix.IsDirWritable())
557 wxMessageBox(wxString::Format(_(
"You have no permissions to write in folder \"%s\".\nPlease select another folder for the final output."), prefix.GetPath().c_str()),
563 wxOK | wxICON_INFORMATION);
564 if (dlg.ShowModal() != wxID_OK)
568 prefix = dlg.GetPath();
571 wxString outname(dlg.GetPath());
579 SetStatusText(_(
"The prefix of an assistant target cannot be changed."));
585 if (selected.empty())
587 SetStatusText(_(
"Please select a project"));
592 SetStatusText(_(
"Please select only one project"));
630 if (selectedProjects.empty())
632 SetStatusText(_(
"Please select a project"));
638 for (
auto& i : selectedProjects)
641 if (projectI->
id < 0)
644 SetStatusText(_(
"Changing user defined sequence is not possible for application entries."));
647 if (target != projectI->
target)
650 SetStatusText(_(
"You can change the user defined sequence only for the same type of operation (either stitching or assistant)."));
655 if (dialog.ShowModal() == wxID_OK)
658 for (
auto& i : selectedProjects)
674 else if(returnCode == 2)
678 if(GetToolBar()->GetToolState(XRCID(
"tool_pause")))
680 GetToolBar()->ToggleTool(XRCID(
"tool_pause"),
false);
689 #if defined __wxMSW__ && !(wxCHECK_VERSION(3,1,1))
702 if (selected.size() == 1)
716 if (selected.size() == 1)
729 wxString defaultdir = wxConfigBase::Get()->Read(wxT(
"/BatchFrame/batchPath"),wxT(
""));
731 _(
"Specify batch file to open"),
733 _(
"Batch file (*.ptq)|*.ptq;|All files (*)|*"),
734 wxFD_OPEN, wxDefaultPosition);
735 if (dlg.ShowModal() == wxID_OK)
737 wxConfig::Get()->Write(wxT(
"/BatchFrame/batchPath"), dlg.GetDirectory());
753 const wxFileName exePath(wxStandardPaths::Get().GetExecutablePath());
755 if (selected.size() == 1)
759 wxExecute(_T(
"open -b net.sourceforge.Hugin \"" +
m_batch->
GetProject(*selected.begin())->path + _T(
"\"")));
761 wxExecute(exePath.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR) + _T(
"hugin \"" +
m_batch->
GetProject(*selected.begin())->path + _T(
"\" -notips")));
765 SetStatusText(_(
"Cannot open app in Hugin."));
770 if (selected.empty())
773 wxMessageDialog message(
this, _(
"No project selected. Open Hugin without project?"),
779 wxYES_NO | wxICON_INFORMATION);
780 if (message.ShowModal() == wxID_YES)
783 wxExecute(_T(
"open -b net.sourceforge.Hugin"));
785 wxExecute(exePath.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR) + _T(
"hugin"));
792 SetStatusText(_(
"Please select only one project"));
804 GetToolBar()->ToggleTool(XRCID(
"tool_pause"),
true);
814 GetToolBar()->ToggleTool(XRCID(
"tool_pause"),
false);
824 GetToolBar()->ToggleTool(XRCID(
"tool_pause"),
false);
831 bool removeErrors=
false;
834 wxMessageDialog message(
this,_(
"There are failed projects in the list.\nRemove them too?"),
840 wxYES_NO | wxICON_INFORMATION );
841 if(message.ShowModal()==wxID_YES)
846 for(
int i=
projListBox->GetItemCount()-1; i>=0; i--)
863 if(!selected.empty())
865 for (
auto i = selected.rbegin(); i != selected.rend(); ++i)
867 const int selIndex = *i;
870 wxMessageDialog message(
this, _(
"Cannot remove project in progress.\nDo you want to cancel it?"),
876 wxYES_NO | wxICON_INFORMATION);
877 if (message.ShowModal() == wxID_YES)
884 SetStatusText(wxString::Format(_(
"Removed project %s"),
m_batch->
GetProject(selIndex)->
path.c_str()));
894 SetStatusText(_(
"Please select a project to remove"));
902 if(!selected.empty())
904 for (
auto selIndex : selected)
908 wxMessageDialog message(
this, _(
"Cannot reset project in progress.\nDo you want to cancel it?"),
914 wxYES_NO | wxICON_INFORMATION);
915 if (message.ShowModal() == wxID_YES)
929 SetStatusText(_(
"Please select a project to reset"));
938 wxMessageDialog message(
this, _(
"Cannot reset projects in progress.\nDo you want to cancel the batch?"),
944 wxYES_NO | wxICON_INFORMATION);
945 if(message.ShowModal()==wxID_YES)
952 for(
int i=
projListBox->GetItemCount()-1; i>=0; i--)
975 wxString defaultdir = wxConfigBase::Get()->Read(wxT(
"/BatchFrame/batchPath"),wxT(
""));
977 _(
"Specify batch file to save"),
979 _(
"Batch file (*.ptq)|*.ptq;|All files (*)|*"),
980 wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition);
981 if (dlg.ShowModal() == wxID_OK)
983 wxConfig::Get()->Write(wxT(
"/BatchFrame/batchPath"), dlg.GetDirectory());
991 if(!selected.empty())
993 for (
auto selIndex : selected)
1002 GetToolBar()->ToggleTool(XRCID(
"tool_pause"),
false);
1036 for (
unsigned int i = 0; i<list->GetCount(); i++)
1038 if (static_cast<Batch::EndTask>((
size_t)list->GetClientData(i)) == endTask)
1040 list->SetSelection(i);
1044 list->SetSelection(0);
1049 wxConfigBase* config=wxConfigBase::Get();
1052 #if defined __WXMAC__ || defined __WXOSX_COCOA__
1055 i=config->Read(wxT(
"/BatchFrame/ShutdownCheck"), 0l);
1062 config->DeleteEntry(wxT(
"/BatchFrame/ShutdownCheck"));
1064 i = config->Read(wxT(
"/BatchFrame/AtEnd"), 0l);
1065 #if defined __WXMAC__ || defined __WXOSX_COCOA__
1074 i=config->Read(wxT(
"/BatchFrame/OverwriteCheck"), 0l);
1075 XRCCTRL(*
this,
"cb_overwrite",wxCheckBox)->SetValue(i!=0);
1077 i=config->Read(wxT(
"/BatchFrame/VerboseCheck"), 0l);
1078 XRCCTRL(*
this,
"cb_verbose",wxCheckBox)->SetValue(i!=0);
1080 i=config->Read(wxT(
"/BatchFrame/AutoRemoveCheck"), 1l);
1081 XRCCTRL(*
this,
"cb_autoremove",wxCheckBox)->SetValue(i!=0);
1083 i=config->Read(wxT(
"/BatchFrame/AutoStitchCheck"), 0l);
1084 XRCCTRL(*
this,
"cb_autostitch",wxCheckBox)->SetValue(i!=0);
1086 i=config->Read(wxT(
"/BatchFrame/SaveLog"), 0l);
1087 XRCCTRL(*
this,
"cb_savelog",wxCheckBox)->SetValue(i!=0);
1098 return XRCCTRL(*
this,
"cb_overwrite",wxCheckBox)->IsChecked();
1103 return XRCCTRL(*
this,
"cb_verbose",wxCheckBox)->IsChecked();
1108 return XRCCTRL(*
this,
"cb_autoremove",wxCheckBox)->IsChecked();
1113 return XRCCTRL(*
this,
"cb_autostitch",wxCheckBox)->IsChecked();
1118 return XRCCTRL(*
this,
"cb_savelog",wxCheckBox)->IsChecked();
1123 wxConfigBase* config=wxConfigBase::Get();
1124 if(event.IsChecked())
1127 config->Write(wxT(
"/BatchFrame/OverwriteCheck"), 1l);
1132 config->Write(wxT(
"/BatchFrame/OverwriteCheck"), 0l);
1140 wxConfigBase* config=wxConfigBase::Get();
1141 config->Write(wxT(
"/BatchFrame/AtEnd"), static_cast<long>(
m_batch->
atEnd));
1147 wxConfigBase* config=wxConfigBase::Get();
1148 if(event.IsChecked())
1151 config->Write(wxT(
"/BatchFrame/VerboseCheck"), 1l);
1156 config->Write(wxT(
"/BatchFrame/VerboseCheck"), 0l);
1170 wxConfigBase* config=wxConfigBase::Get();
1173 config->Write(wxT(
"/BatchFrame/AutoRemoveCheck"), 1l);
1177 config->Write(wxT(
"/BatchFrame/AutoRemoveCheck"), 0l);
1185 wxConfigBase* config=wxConfigBase::Get();
1188 config->Write(wxT(
"/BatchFrame/AutoStitchCheck"), 1l);
1192 config->Write(wxT(
"/BatchFrame/AutoStitchCheck"), 0l);
1200 wxConfigBase* config=wxConfigBase::Get();
1203 config->Write(wxT(
"/BatchFrame/SaveLog"), 1l);
1207 config->Write(wxT(
"/BatchFrame/SaveLog"), 0l);
1217 wxMessageDialog message(
this, _(
"The batch queue contains many items.\nThis can have negative effects on performance.\nShould the batch queue be cleared now?"),
1223 wxYES_NO | wxICON_INFORMATION);
1224 message.SetYesNoLabels(_(
"Clear batch queue now"), _(
"Keep batch queue"));
1225 if (message.ShowModal() == wxID_YES)
1232 wxConfigBase* config=wxConfigBase::Get();
1235 config->Write(wxT(
"/BatchFrame/Max"), 1l);
1236 config->Write(wxT(
"/BatchFrame/Minimized"), 0l);
1240 config->Write(wxT(
"/BatchFrame/Max"), 0l);
1241 if(
m_tray!=NULL && !IsShown())
1243 config->Write(wxT(
"/BatchFrame/Minimized"), 1l);
1247 config->Write(wxT(
"/BatchFrame/Minimized"), 0l);
1248 config->Write(wxT(
"/BatchFrame/Width"), GetSize().GetWidth());
1249 config->Write(wxT(
"/BatchFrame/Height"), GetSize().GetHeight());
1292 if(index>=0 && index<(
projListBox->GetItemCount()-1))
1314 GetToolBar()->ToggleTool(XRCID(
"tool_pause"),
false);
1326 wxConfigBase* config=wxConfigBase::Get();
1327 int width = config->Read(wxT(
"/BatchFrame/Width"), -1l);
1328 int height = config->Read(wxT(
"/BatchFrame/Height"), -1l);
1329 int max = config->Read(wxT(
"/BatchFrame/Max"), -1l);
1330 int min = config->Read(wxT(
"/BatchFrame/Minimized"), -1l);
1331 if((width != -1) && (height != -1))
1333 SetSize(width,height);
1337 #if wxCHECK_VERSION(3,1,0)
1338 SetSize(this->FromDIP(wxSize(600,400)));
1360 failedProjects_dlg.ShowModal();
1367 if (
m_tray && e.GetInt() == 1)
1376 SetStatusText(status);
1379 #if defined __WXMSW__ && wxUSE_TASKBARICON_BALLOONS
1380 m_tray->ShowBalloon(_(
"PTBatcherGUI"),status,5000,wxICON_INFORMATION);
1403 #if defined __WXMSW__ && wxCHECK_VERSION(3,1,0) && wxUSE_TASKBARBUTTON
1407 wxTaskBarButton* taskBarButton = MSWGetTaskBarButton();
1408 if (taskBarButton != NULL)
1412 taskBarButton->SetProgressValue(wxTASKBAR_BUTTON_NO_PROGRESS);
1416 taskBarButton->SetProgressRange(100);
1417 taskBarButton->SetProgressState(
m_batch->
IsPaused() ? wxTASKBAR_BUTTON_PAUSED : wxTASKBAR_BUTTON_NORMAL);
1430 Show(!e.IsIconized());
1438 m_batch->
verbose=XRCCTRL(*
this,
"cb_verbose",wxCheckBox)->IsChecked();
1445 if (!e.IsIconized())
1456 m_batch->
verbose=XRCCTRL(*
this,
"cb_verbose",wxCheckBox)->IsChecked();
1463 std::set<long> selectedID;
1464 for (
auto index : selected)
1470 for(
auto id:selectedID)
1483 wxConfigBase* config=wxConfigBase::Get();
1484 config->Write(wxT(
"/BatchFrame/minimizeTray"), event.IsChecked());
bool NoErrors()
Returns true if there are no failed projects in batch.
int GetRunningCount()
Returns number of projects currently in progress.
int ClearBatch()
Clears batch list and returns 0 if succesful.
void SetLocaleAndXRC(wxLocale *locale, wxString xrc)
void OnButtonChangePrefix(wxCommandEvent &event)
bool FileExists(const std::string &filename)
checks if file exists
void ChangePrefix(int index, wxString newPrefix)
bool GetCheckAutoRemove()
return if auto remove checkbox is checked
Definition of GenerateSequenceDialog class.
void SwapProject(int index)
Swaps position in batch of project at index with project at index+1.
void RemoveProjectAtIndex(int selIndex)
Removes project at index from batch list.
int GetProjectCount()
Returns number of projects in batch list.
wxString userDefindSequence
bool GetCheckSaveLog()
return if always save log is checked
void AddDirToList(wxString aDir)
class for showing a status bar with progress, the progress bar is always in the last field of the sta...
void SetMissing(int index)
Definition of failed projects dialog.
void OnButtonReset(wxCommandEvent &event)
ProgressStatusBar * m_progStatusBar
void SetStatus(int index, Project::Status status)
Used internally to set status of selected project.
size_t GetFailedProjectsCount()
returns number of failed projects
Batch::EndTask GetEndTask()
return which task should be executed at end
void OnButtonOpenBatch(wxCommandEvent &event)
void AddToList(wxString aFile, Project::Target target=Project::STITCHING, wxString userDefined=wxEmptyString)
void CancelBatch()
Stops batch run, failing projects in progress.
void OnButtonGenerateSequence(wxCommandEvent &e)
generate a sequence of panoramas
void OnButtonPause(wxCommandEvent &event)
void OnProcessTerminate(wxProcessEvent &event)
Dialog for generate panoramas from a sequence of images.
void AppendProject(Project *project)
class to show a taskbar balloon
void OnButtonHelp(wxCommandEvent &event)
void OnButtonChangeUserDefinedSequence(wxCommandEvent &event)
void OnClose(wxCloseEvent &event)
bool GetCheckOverwrite()
return if overwrite checkbox is checked
void AddProjectToBatch(wxString projectFile, wxString outputFile=wxEmptyString, wxString userDefinedSequence=wxEmptyString, Project::Target target=Project::STITCHING)
Adds a project entry in the batch list.
void OnButtonSaveBatch(wxCommandEvent &event)
wxString GetText(int row, int column)
wxString GetNewSequence()
returns the newly selected sequence
void AddAppToBatch(wxString app)
Adds an application entry in the batch list.
int LoadBatchFile(wxString file)
Clears current batch list and loads projects from batch file.
bool IsPaused()
Returns true if batch execution is currently paused.
void UpdateBatchVerboseStatus()
update visibility of verbose output window depending on status of verbose checkbox ...
void ChangePrefix(int index, wxString newPrefix)
Changes output prefix for project at index.
Batch processor for Hugin with GUI.
void OnUpdateListBox(wxTimerEvent &event)
called by thread to update listbox
void ChangePrefix(int index, wxString newPrefix)
void ChangeUserDefined(int index, wxString newUserDefined)
std::set< unsigned int > UIntSet
void OnButtonSkip(wxCommandEvent &event)
Project::Status GetStatus(int index)
Returns current status of project at index.
bool IsRunning()
return true, if batch is running
void OnRefillListBox(wxCommandEvent &e)
called if the project box needs to be updated, because projects were added or deleted ...
void UpdateTaskBarProgressBar()
update the progress bar in the task bar
void PauseBatch()
Pauses and continues batch execution.
void OnButtonAddCommand(wxCommandEvent &event)
void OnButtonMoveUp(wxCommandEvent &event)
Dialog for finding panorama in given directory.
class for showing a taskbar/tray icon
Definition of dialog to change user defined sequence.
void ChangeUserDefined(int index, wxString newUserDefined)
int GetProgress()
return current progress value, should be in range 0 - 100, or -1 if the progress gauge is hidden ...
bool UpdateStatus(int index, Project *project)
void UpdateTrayIcon(const bool createTrayIcon)
create or destroy the tray icon
void OnMinimizeTrayMenu(wxCommandEvent &e)
void SaveTemp()
Saves batch list to temporary file.
void OnButtonClear(wxCommandEvent &event)
Project * GetProject(int index)
Returns project at index.
void OnCheckVerbose(wxCommandEvent &event)
wxStatusBar * OnCreateStatusBar(int number, long style, wxWindowID id, const wxString &name)
Dialog for changing the user defined sequence.
void SetStatusInformation(wxString status)
sets status message, also updates tooltip of taskbar icon
void ShowOutput(bool isVisible=true)
Set visibility of all running projects.
void OnButtonSearchPano(wxCommandEvent &e)
void OnButtonAddToStitchingQueue(wxCommandEvent &event)
let the user select a project file which should be added to the stitching queue
wxArrayString GetProjectFiles()
BatchTaskBarIcon * m_tray
void OnCheckOverwrite(wxCommandEvent &event)
void OnButtonOpenWithHugin(wxCommandEvent &event)
void OnMinimize(wxIconizeEvent &e)
handle when minimize or restore image
void OnButtonResetAll(wxCommandEvent &event)
Batch processor for Hugin with GUI.
void OnButtonMoveDown(wxCommandEvent &event)
wxHelpController & GetHelpController()
return help controller for open help
bool IsRunning()
returns true, if batch is running
void RunBatch()
Starts batch execution.
void SwapProject(int index, bool down)
bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &filenames)
File/directory drag and drop handler method.
void SetProgress(int progress)
update progress bar
void showBalloon(unsigned int iTimeout)
display the baloon and run the timer
void OnButtonCancel(wxCommandEvent &event)
HuginBase::UIntSet GetSelectedProjects()
void OnChoiceEnd(wxCommandEvent &event)
void OnButtonRemoveComplete(wxCommandEvent &event)
wxTimer * m_updateProjectsTimer
void CancelProject(int index)
Cancels project at index in batch, failing it.
void OnBatchInformation(wxCommandEvent &e)
called when batch wants to show some progress message
void SaveBatchFile(wxString file)
Saves batch list to file.
bool CompareProjectsInLists(int stitchListIndex, int batchListIndex)
Compares two project at indexes in both lists and returns true if they have identical project ids...
void OnUserExit(wxCommandEvent &event)
bool GetCheckAutoStitch()
return if auto stitch checkbox is checked
void OnCheckAutoRemove(wxCommandEvent &event)
event handler called when auto remove checkbox was changed
Simple class that forward the drop to the mainframe.
void SelectEndTask(wxControlWithItems *list, const Batch::EndTask endTask)
void OnBatchFailed(wxCommandEvent &event)
called when batch was finished and there are failed projects
bool IsPaused()
returns true, if batch is paused
void OnCheckAutoStitch(wxCommandEvent &event)
event handler called when auto stitch checkbox was changed
void ReloadProject(int index, Project *project)
Dialog for finding panorama in given directory.
void OnCheckSaveLog(wxCommandEvent &event)
event handler called when always save log checkbox was changed
void OnButtonRemoveFromList(wxCommandEvent &event)
ProjectListBox * projListBox
void OnProgress(wxCommandEvent &event)
event handler for update progress controls
void OnButtonAddDir(wxCommandEvent &event)
bool GetCheckVerbose()
return if verbose checkbox is checked
void OnButtonRunBatch(wxCommandEvent &event)
void SetInternalVerbose(bool newVerbose)
sets the current verbose status, does not update the checkbox
void ChangeUserDefined(int index, wxString newUserDefined)
Changes user defined sequence for project at index.
void SwapProject(int index)
void OnButtonAddToAssistantQueue(wxCommandEvent &event)
let the user select a project file which should be added to the stitching queue
void AddArrayToList(const wxArrayString &fileList, Project::Target target)