[419cd4]: src / hugin1 / ptbatcher / BatchFrame.h Maximize Restore History

Download this file

BatchFrame.h    143 lines (128 with data), 5.3 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// -*- c-basic-offset: 4 -*-
/** @file BatchFrame.h
*
* @brief Batch processor for Hugin with GUI
*
* @author Marko Kuder <marko.kuder@gmail.com>
*
* $Id: BatchFrame.h 3322 2008-08-16 5:00:07Z mkuder $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef BATCHFRAME_H
#define BATCHFRAME_H
#include "RunStitchFrame.h"
#include "Batch.h"
#include "ProjectListBox.h"
#include "DirTraverser.h"
//#include <wx/app.h>
/** Simple class that forward the drop to the mainframe */
class BatchDropTarget : public wxFileDropTarget
{
public:
/** File/directory drag and drop handler method
*
* When a project file is droped, it is added with default prefix.
* When a directory is dropped, the directory and all sub-directory are scanned and
* all found project files are added to the queue.
*/
bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames);
};
class BatchFrame : public wxFrame, wxThreadHelper
{
public:
//Main constructor
BatchFrame(wxLocale* locale, wxString xrc);
//Main thread for all file polling - checking for new projects and updating modified ones.
void *Entry();
void OnUserExit(wxCommandEvent &event);
void OnButtonAddCommand(wxCommandEvent &event);
void OnButtonAddDir(wxCommandEvent &event);
void OnButtonSearchPano(wxCommandEvent &e);
void OnButtonAddToList(wxCommandEvent &event);
void OnButtonCancel(wxCommandEvent &event);
void OnButtonChangePrefix(wxCommandEvent &event);
void OnButtonClear(wxCommandEvent &event);
void OnButtonHelp(wxCommandEvent &event);
void OnButtonMoveDown(wxCommandEvent &event);
void OnButtonMoveUp(wxCommandEvent &event);
void OnButtonOpenBatch(wxCommandEvent &event);
void OnButtonOpenWithHugin(wxCommandEvent &event);
void OnButtonPause(wxCommandEvent &event);
void OnButtonRemoveComplete(wxCommandEvent &event);
void OnButtonRemoveFromList(wxCommandEvent &event);
void OnButtonReset(wxCommandEvent &event);
void OnButtonResetAll(wxCommandEvent &event);
void OnButtonRunBatch(wxCommandEvent &event);
void OnButtonSaveBatch(wxCommandEvent &event);
void OnButtonSkip(wxCommandEvent &event);
void OnCheckDelete(wxCommandEvent &event);
void OnCheckOverwrite(wxCommandEvent &event);
void OnCheckParallel(wxCommandEvent &event);
void OnCheckShutdown(wxCommandEvent &event);
void OnCheckVerbose(wxCommandEvent &event);
//Called on window close to take care of the child thread
void OnClose(wxCloseEvent &event);
//Resets all checkboxes based on m_batch object properties
void PropagateDefaults();
//Sets all checkboxes corresponding the setting in config
void SetCheckboxes();
//Starts batch execution
void RunBatch();
//Sets locale and XRC prefix pointers from main app
void SetLocaleAndXRC(wxLocale* locale, wxString xrc);
//Swaps the project entry at index in the list with the next (at index+1).
void SwapProject(int index);
//PanoramaOptions readOptions(wxString projectFile);
/** return if parallel checkbox is checked */
bool GetCheckParallel() { return XRCCTRL(*this,"cb_parallel",wxCheckBox)->IsChecked();};
/** return if delete checkbox is checked */
bool GetCheckDelete() { return XRCCTRL(*this,"cb_delete",wxCheckBox)->IsChecked();};
/** return if shutdown checkbox is checked */
bool GetCheckShutdown() { return XRCCTRL(*this,"cb_shutdown",wxCheckBox)->IsChecked();};
/** return if overwrite checkbox is checked */
bool GetCheckOverwrite() { return XRCCTRL(*this,"cb_overwrite",wxCheckBox)->IsChecked();};
/** return if verbose checkbox is checked */
bool GetCheckVerbose() { return XRCCTRL(*this,"cb_verbose",wxCheckBox)->IsChecked();};
void RestoreSize();
void AddToList(wxString aFile, Project::Target target=Project::STITCHING);
void AddDirToList(wxString aDir);
void ChangePrefix(int index,wxString newPrefix);
//wxMutex* projListMutex;
ProjectListBox *projListBox;
private:
wxLocale* m_locale;
wxString m_xrcPrefix;
Batch* m_batch;
bool m_cancelled;
bool m_paused;
bool m_closeThread; //included to signal the thread to finish execution
//TO-DO: include a batch or project progress gauge? Test initialization commented out in constructor
//wxGauge* m_gauge;
wxHtmlHelpController * m_help;
void OnProcessTerminate(wxProcessEvent & event);
/** called by thread when queue was changed outside of PTBatcherGUI
*/
void OnReloadBatch(wxCommandEvent &event);
/** called by thread to update listbox */
void OnUpdateListBox(wxCommandEvent &event);
/** called when batch was finished and there are failed projects */
void OnBatchFailed(wxCommandEvent &event);
DECLARE_EVENT_TABLE()
//PTPrograms progs;
};
//DECLARE_APP(PTBatcherGUI)
#endif //BATCHFRAME_H