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 #ifdef __WXMSW__
00035 #include "wx/msw/helpchm.h"
00036 #include "base_wx/wxPlatform.h"
00037 #endif
00038 #include "BatchTrayIcon.h"
00039 //#include <wx/app.h>
00040 #include "ProgressStatusBar.h"
00041 
00043 class BatchDropTarget : public wxFileDropTarget
00044 {
00045 public:
00052     bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames);
00053 };
00054 
00055 class BatchFrame : public wxFrame, public wxThreadHelper
00056 {
00057 public:
00058     //Main constructor
00059     BatchFrame(wxLocale* locale, wxString xrc);
00060     //Main thread for all file polling - checking for new projects and updating modified ones.
00061     void* Entry();
00062     // create statusbar with progress control
00063     wxStatusBar* OnCreateStatusBar(int number, long style, wxWindowID id, const wxString& name);
00064 
00065     void OnUserExit(wxCommandEvent& event);
00066     void OnButtonAddCommand(wxCommandEvent& event);
00067     void OnButtonAddDir(wxCommandEvent& event);
00068     void OnButtonSearchPano(wxCommandEvent& e);
00070     void OnButtonAddToStitchingQueue(wxCommandEvent& event);
00072     void OnButtonAddToAssistantQueue(wxCommandEvent& event);
00073     void OnButtonCancel(wxCommandEvent& event);
00074     void OnButtonChangePrefix(wxCommandEvent& event);
00075     void OnButtonClear(wxCommandEvent& event);
00076     void OnMinimizeTrayMenu(wxCommandEvent& e);
00077     void OnButtonHelp(wxCommandEvent& event);
00078     void OnButtonMoveDown(wxCommandEvent& event);
00079     void OnButtonMoveUp(wxCommandEvent& event);
00080     void OnButtonOpenBatch(wxCommandEvent& event);
00081     void OnButtonOpenWithHugin(wxCommandEvent& event);
00082     void OnButtonPause(wxCommandEvent& event);
00083     void OnButtonRemoveComplete(wxCommandEvent& event);
00084     void OnButtonRemoveFromList(wxCommandEvent& event);
00085     void OnButtonReset(wxCommandEvent& event);
00086     void OnButtonResetAll(wxCommandEvent& event);
00087     void OnButtonRunBatch(wxCommandEvent& event);
00088     void OnButtonSaveBatch(wxCommandEvent& event);
00089     void OnButtonSkip(wxCommandEvent& event);
00090 
00091     void OnCheckOverwrite(wxCommandEvent& event);
00092     void OnChoiceEnd(wxCommandEvent& event);
00093     void OnCheckVerbose(wxCommandEvent& event);
00095     void OnCheckAutoRemove(wxCommandEvent& event);
00097     void OnCheckAutoStitch(wxCommandEvent& event);
00099     void OnCheckSaveLog(wxCommandEvent& event);
00101     void OnProgress(wxCommandEvent& event);
00102 
00103     //Called on window close to take care of the child thread
00104     void OnClose(wxCloseEvent& event);
00106     void OnMinimize(wxIconizeEvent& e);
00107     //Resets all checkboxes based on m_batch object properties
00108     void PropagateDefaults();
00109     //Sets all checkboxes corresponding the setting in config
00110     void SetCheckboxes();
00111     //Starts batch execution
00112     void RunBatch();
00113     //Sets locale and XRC prefix pointers from main app
00114     void SetLocaleAndXRC(wxLocale* locale, wxString xrc);
00115     //Swaps the project entry at index in the list with the next (at index+1).
00116     void SwapProject(int index);
00117     //PanoramaOptions readOptions(wxString projectFile);
00119     Batch::EndTask GetEndTask();
00121     bool GetCheckOverwrite();
00123     bool GetCheckVerbose();
00125     bool GetCheckAutoRemove();
00127     bool GetCheckAutoStitch();
00129     bool GetCheckSaveLog();
00130     void RestoreSize();
00131     void AddToList(wxString aFile, Project::Target target=Project::STITCHING);
00132     void AddDirToList(wxString aDir);
00133     void ChangePrefix(int index,wxString newPrefix);
00135     bool IsRunning();
00137     bool IsPaused();
00141     void SetStatusInformation(wxString status);
00143     void UpdateBatchVerboseStatus();
00145     bool IsStartedMinimized()
00146     {
00147         return m_startedMinimized;
00148     };
00150     void SetInternalVerbose(bool newVerbose);
00152     void UpdateTaskBarProgressBar();
00153 
00154 #ifdef __WXMSW__
00155 
00156 #if wxCHECK_VERSION(3,1,1)
00157     wxCHMHelpController& GetHelpController()
00158     {
00159         return m_msHtmlHelp;
00160     }
00161 #else
00162     HuginCHMHelpController& GetHelpController()
00163     {
00164         return m_msHtmlHelp;
00165     }
00166 #endif
00167 #endif
00168 
00169     //wxMutex* projListMutex;
00170     ProjectListBox* projListBox;
00171 
00172 private:
00173     wxLocale* m_locale;
00174     wxString m_xrcPrefix;
00175     Batch* m_batch;
00176     bool m_cancelled;
00177     bool m_paused;
00178     bool m_closeThread; //included to signal the thread to finish execution
00179     wxChoice* m_endChoice;
00180     //TO-DO: include a batch or project progress gauge? Test initialization commented out in constructor
00181     //wxGauge* m_gauge;
00182 #ifdef __WXMSW__
00183 #if wxCHECK_VERSION(3,1,1)
00184     wxCHMHelpController m_msHtmlHelp;
00185 #else
00186     HuginCHMHelpController m_msHtmlHelp;
00187 #endif
00188 #else
00189     wxHtmlHelpController* m_help;
00190 #endif
00191     BatchTaskBarIcon* m_tray;
00192     ProgressStatusBar* m_progStatusBar;
00193     wxIcon m_iconNormal;
00194     wxIcon m_iconRunning;
00195     wxIcon m_iconPaused;
00196     bool m_startedMinimized;
00197 
00198     void OnProcessTerminate(wxProcessEvent& event);
00201     void OnReloadBatch(wxCommandEvent& event);
00203     void OnUpdateListBox(wxCommandEvent& event);
00205     void OnBatchFailed(wxCommandEvent& event);
00207     void OnBatchInformation(wxCommandEvent& e);
00209     void OnRefillListBox(wxCommandEvent& e);
00211     void UpdateTrayIcon(const bool createTrayIcon);
00212 
00213     DECLARE_EVENT_TABLE()
00214 };
00215 
00216 #endif //BATCHFRAME_H

Generated on 25 Aug 2016 for Hugintrunk by  doxygen 1.4.7