Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages
hugin1/ptbatcher/BatchFrame.h
Go to the documentation of this file.00001 // -*- c-basic-offset: 4 -*- 00002 00027 #ifndef BATCHFRAME_H 00028 #define BATCHFRAME_H 00029 00030 #include "RunStitchFrame.h" 00031 #include "Batch.h" 00032 #include "ProjectListBox.h" 00033 #include "DirTraverser.h" 00034 //#include <wx/app.h> 00035 00037 class BatchDropTarget : public wxFileDropTarget 00038 { 00039 public: 00046 bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames); 00047 }; 00048 00049 class BatchFrame : public wxFrame, wxThreadHelper 00050 { 00051 public: 00052 //Main constructor 00053 BatchFrame(wxLocale* locale, wxString xrc); 00054 //Main thread for all file polling - checking for new projects and updating modified ones. 00055 void *Entry(); 00056 00057 void OnUserExit(wxCommandEvent &event); 00058 void OnButtonAddCommand(wxCommandEvent &event); 00059 void OnButtonAddDir(wxCommandEvent &event); 00060 void OnButtonAddToList(wxCommandEvent &event); 00061 void OnButtonCancel(wxCommandEvent &event); 00062 void OnButtonChangePrefix(wxCommandEvent &event); 00063 void OnButtonClear(wxCommandEvent &event); 00064 void OnButtonHelp(wxCommandEvent &event); 00065 void OnButtonMoveDown(wxCommandEvent &event); 00066 void OnButtonMoveUp(wxCommandEvent &event); 00067 void OnButtonOpenBatch(wxCommandEvent &event); 00068 void OnButtonOpenWithHugin(wxCommandEvent &event); 00069 void OnButtonPause(wxCommandEvent &event); 00070 void OnButtonRemoveComplete(wxCommandEvent &event); 00071 void OnButtonRemoveFromList(wxCommandEvent &event); 00072 void OnButtonReset(wxCommandEvent &event); 00073 void OnButtonResetAll(wxCommandEvent &event); 00074 void OnButtonRunBatch(wxCommandEvent &event); 00075 void OnButtonSaveBatch(wxCommandEvent &event); 00076 void OnButtonSkip(wxCommandEvent &event); 00077 00078 void OnCheckDelete(wxCommandEvent &event); 00079 void OnCheckOverwrite(wxCommandEvent &event); 00080 void OnCheckParallel(wxCommandEvent &event); 00081 void OnCheckShutdown(wxCommandEvent &event); 00082 void OnCheckVerbose(wxCommandEvent &event); 00083 00084 //Called on window close to take care of the child thread 00085 void OnClose(wxCloseEvent &event); 00086 //Resets all checkboxes based on m_batch object properties 00087 void PropagateDefaults(); 00088 //Sets all checkboxes corresponding the setting in config 00089 void SetCheckboxes(); 00090 //Starts batch execution 00091 void RunBatch(); 00092 //Sets locale and XRC prefix pointers from main app 00093 void SetLocaleAndXRC(wxLocale* locale, wxString xrc); 00094 //Swaps the project entry at index in the list with the next (at index+1). 00095 void SwapProject(int index); 00096 //PanoramaOptions readOptions(wxString projectFile); 00098 bool GetCheckParallel() { return XRCCTRL(*this,"cb_parallel",wxCheckBox)->IsChecked();}; 00100 bool GetCheckDelete() { return XRCCTRL(*this,"cb_delete",wxCheckBox)->IsChecked();}; 00102 bool GetCheckShutdown() { return XRCCTRL(*this,"cb_shutdown",wxCheckBox)->IsChecked();}; 00104 bool GetCheckOverwrite() { return XRCCTRL(*this,"cb_overwrite",wxCheckBox)->IsChecked();}; 00106 bool GetCheckVerbose() { return XRCCTRL(*this,"cb_verbose",wxCheckBox)->IsChecked();}; 00107 void RestoreSize(); 00108 void AddToList(wxString aFile); 00109 void AddDirToList(wxString aDir); 00110 void ChangePrefix(int index,wxString newPrefix); 00111 00112 //wxMutex* projListMutex; 00113 ProjectListBox *projListBox; 00114 00115 private: 00116 wxLocale* m_locale; 00117 wxString m_xrcPrefix; 00118 Batch* m_batch; 00119 bool m_cancelled; 00120 bool m_paused; 00121 bool m_closeThread; //included to signal the thread to finish execution 00122 //TO-DO: include a batch or project progress gauge? Test initialization commented out in constructor 00123 //wxGauge* m_gauge; 00124 wxHtmlHelpController * m_help; 00125 00126 void OnProcessTerminate(wxProcessEvent & event); 00129 void OnReloadBatch(wxCommandEvent &event); 00131 void OnUpdateListBox(wxCommandEvent &event); 00132 00133 DECLARE_EVENT_TABLE() 00134 //PTPrograms progs; 00135 }; 00136 00137 //DECLARE_APP(PTBatcherGUI) 00138 00139 #endif //BATCHFRAME_H
1.3.9.1