Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BatchFrame.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
2 
27 #ifndef BATCHFRAME_H
28 #define BATCHFRAME_H
29 
30 #include "RunStitchFrame.h"
31 #include "Batch.h"
32 #include "ProjectListBox.h"
33 #include "DirTraverser.h"
34 #include "wx/help.h"
35 #if !wxUSE_HELP
36 #error wxWidgets needs to be compiled with help support (wxUSE_HELP not set)
37 #endif
38 #if defined __WXMSW__ && !(wxCHECK_VERSION(3,1,1))
39 #include "base_wx/wxPlatform.h"
40 #define wxHelpController HuginCHMHelpController
41 #endif
42 #include "BatchTrayIcon.h"
43 //#include <wx/app.h>
44 #include "ProgressStatusBar.h"
45 #include <wx/timer.h>
46 
48 class BatchDropTarget : public wxFileDropTarget
49 {
50 public:
57  bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames);
58 };
59 
60 class BatchFrame : public wxFrame
61 {
62 public:
63  //Main constructor
64  BatchFrame(wxLocale* locale, wxString xrc);
65  // create statusbar with progress control
66  wxStatusBar* OnCreateStatusBar(int number, long style, wxWindowID id, const wxString& name);
67 
68  void OnUserExit(wxCommandEvent& event);
69  void OnButtonAddCommand(wxCommandEvent& event);
70  void OnButtonAddDir(wxCommandEvent& event);
71  void OnButtonSearchPano(wxCommandEvent& e);
73  void OnButtonGenerateSequence(wxCommandEvent& e);
75  void OnButtonAddToStitchingQueue(wxCommandEvent& event);
77  void OnButtonAddToAssistantQueue(wxCommandEvent& event);
78  void OnButtonCancel(wxCommandEvent& event);
79  void OnButtonChangePrefix(wxCommandEvent& event);
80  void OnButtonChangeUserDefinedSequence(wxCommandEvent& event);
81  void OnButtonClear(wxCommandEvent& event);
82  void OnMinimizeTrayMenu(wxCommandEvent& e);
83  void OnButtonHelp(wxCommandEvent& event);
84  void OnButtonMoveDown(wxCommandEvent& event);
85  void OnButtonMoveUp(wxCommandEvent& event);
86  void OnButtonOpenBatch(wxCommandEvent& event);
87  void OnButtonOpenWithHugin(wxCommandEvent& event);
88  void OnButtonPause(wxCommandEvent& event);
89  void OnButtonRemoveComplete(wxCommandEvent& event);
90  void OnButtonRemoveFromList(wxCommandEvent& event);
91  void OnButtonReset(wxCommandEvent& event);
92  void OnButtonResetAll(wxCommandEvent& event);
93  void OnButtonRunBatch(wxCommandEvent& event);
94  void OnButtonSaveBatch(wxCommandEvent& event);
95  void OnButtonSkip(wxCommandEvent& event);
96 
97  void OnCheckOverwrite(wxCommandEvent& event);
98  void OnChoiceEnd(wxCommandEvent& event);
99  void OnCheckVerbose(wxCommandEvent& event);
101  void OnCheckAutoRemove(wxCommandEvent& event);
103  void OnCheckAutoStitch(wxCommandEvent& event);
105  void OnCheckSaveLog(wxCommandEvent& event);
107  void OnProgress(wxCommandEvent& event);
108 
109  //Called on window close to take care of the child thread
110  void OnClose(wxCloseEvent& event);
112  void OnMinimize(wxIconizeEvent& e);
113  //Resets all checkboxes based on m_batch object properties
114  void PropagateDefaults();
115  //Sets all checkboxes corresponding the setting in config
116  void SetCheckboxes();
117  //Starts batch execution
118  void RunBatch();
119  //Sets locale and XRC prefix pointers from main app
120  void SetLocaleAndXRC(wxLocale* locale, wxString xrc);
121  //Swaps the project entry at index in the list with the next (at index+1).
122  void SwapProject(int index, bool down);
123  //PanoramaOptions readOptions(wxString projectFile);
127  bool GetCheckOverwrite();
129  bool GetCheckVerbose();
131  bool GetCheckAutoRemove();
133  bool GetCheckAutoStitch();
135  bool GetCheckSaveLog();
136  void RestoreSize();
137  void AddToList(wxString aFile, Project::Target target=Project::STITCHING, wxString userDefined = wxEmptyString);
138  void AddArrayToList(const wxArrayString& fileList, Project::Target target);
139  void AddDirToList(wxString aDir);
140  void ChangePrefix(int index,wxString newPrefix);
141  void ChangeUserDefined(int index, wxString newUserDefined);
143  bool IsRunning();
145  bool IsPaused();
149  void SetStatusInformation(wxString status);
154  {
155  return m_startedMinimized;
156  };
158  void SetInternalVerbose(bool newVerbose);
161 
163  wxHelpController& GetHelpController() { return m_HelpController; }
164 
165  //wxMutex* projListMutex;
167 
168 private:
169  wxLocale* m_locale;
170  wxString m_xrcPrefix;
173  bool m_paused;
174  wxChoice* m_endChoice;
175  // help controller
176  wxHelpController m_HelpController;
179  wxIcon m_iconNormal;
181  wxIcon m_iconPaused;
182  // timer for checking of modified projects
185 
186  void OnProcessTerminate(wxProcessEvent& event);
188  void OnUpdateListBox(wxTimerEvent& event);
190  void OnBatchFailed(wxCommandEvent& event);
192  void OnBatchInformation(wxCommandEvent& e);
194  void OnRefillListBox(wxCommandEvent& e);
196  void UpdateTrayIcon(const bool createTrayIcon);
197 
198  DECLARE_EVENT_TABLE()
199 };
200 
201 #endif //BATCHFRAME_H
void PropagateDefaults()
Stitch a pto project file, with GUI output etc.
void SetLocaleAndXRC(wxLocale *locale, wxString xrc)
void OnButtonChangePrefix(wxCommandEvent &event)
Definition: BatchFrame.cpp:529
definition of statusbar with progress indicator
void ChangePrefix(int index, wxString newPrefix)
Definition: BatchFrame.cpp:597
bool IsStartedMinimized()
returns true, if last session was finished minimized
Definition: BatchFrame.h:153
bool GetCheckAutoRemove()
return if auto remove checkbox is checked
wxHelpController m_HelpController
Definition: BatchFrame.h:176
bool GetCheckSaveLog()
return if always save log is checked
wxIcon m_iconNormal
Definition: BatchFrame.h:179
void AddDirToList(wxString aDir)
Definition: BatchFrame.cpp:468
class for showing a status bar with progress, the progress bar is always in the last field of the sta...
void OnButtonReset(wxCommandEvent &event)
Definition: BatchFrame.cpp:899
ProgressStatusBar * m_progStatusBar
Definition: BatchFrame.h:178
Batch::EndTask GetEndTask()
return which task should be executed at end
void OnButtonOpenBatch(wxCommandEvent &event)
Definition: BatchFrame.cpp:727
void RunBatch()
void AddToList(wxString aFile, Project::Target target=Project::STITCHING, wxString userDefined=wxEmptyString)
Definition: BatchFrame.cpp:489
void OnButtonGenerateSequence(wxCommandEvent &e)
generate a sequence of panoramas
Definition: BatchFrame.cpp:378
void OnButtonPause(wxCommandEvent &event)
Definition: BatchFrame.cpp:797
wxLocale * m_locale
Definition: BatchFrame.h:169
void OnProcessTerminate(wxProcessEvent &event)
void OnButtonHelp(wxCommandEvent &event)
Definition: BatchFrame.cpp:686
void OnButtonChangeUserDefinedSequence(wxCommandEvent &event)
Definition: BatchFrame.cpp:627
void OnClose(wxCloseEvent &event)
bool GetCheckOverwrite()
return if overwrite checkbox is checked
void OnButtonSaveBatch(wxCommandEvent &event)
Definition: BatchFrame.cpp:973
wxString m_xrcPrefix
Definition: BatchFrame.h:170
wxIcon m_iconPaused
Definition: BatchFrame.h:181
void UpdateBatchVerboseStatus()
update visibility of verbose output window depending on status of verbose checkbox ...
void OnUpdateListBox(wxTimerEvent &event)
called by thread to update listbox
Definition: BatchFrame.cpp:271
definition of tray/task bar icon for PTBatcherGUI
void OnButtonSkip(wxCommandEvent &event)
Definition: BatchFrame.cpp:988
void RestoreSize()
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 OnButtonAddCommand(wxCommandEvent &event)
Definition: BatchFrame.cpp:343
void OnButtonMoveUp(wxCommandEvent &event)
Definition: BatchFrame.cpp:713
class for showing a taskbar/tray icon
Definition: BatchTrayIcon.h:33
void ChangeUserDefined(int index, wxString newUserDefined)
Definition: BatchFrame.cpp:612
void UpdateTrayIcon(const bool createTrayIcon)
create or destroy the tray icon
Batch processor for Hugin with GUI.
void OnMinimizeTrayMenu(wxCommandEvent &e)
void OnButtonClear(wxCommandEvent &event)
Definition: BatchFrame.cpp:667
Definition: Batch.h:48
void OnCheckVerbose(wxCommandEvent &event)
wxStatusBar * OnCreateStatusBar(int number, long style, wxWindowID id, const wxString &name)
Definition: BatchFrame.cpp:254
void SetStatusInformation(wxString status)
sets status message, also updates tooltip of taskbar icon
bool m_cancelled
Definition: BatchFrame.h:172
void OnButtonSearchPano(wxCommandEvent &e)
Definition: BatchFrame.cpp:372
void OnButtonAddToStitchingQueue(wxCommandEvent &event)
let the user select a project file which should be added to the stitching queue
Definition: BatchFrame.cpp:411
BatchTaskBarIcon * m_tray
Definition: BatchFrame.h:177
void OnCheckOverwrite(wxCommandEvent &event)
void OnButtonOpenWithHugin(wxCommandEvent &event)
Definition: BatchFrame.cpp:751
void OnMinimize(wxIconizeEvent &e)
handle when minimize or restore image
void OnButtonResetAll(wxCommandEvent &event)
Definition: BatchFrame.cpp:934
void OnButtonMoveDown(wxCommandEvent &event)
Definition: BatchFrame.cpp:699
wxHelpController & GetHelpController()
return help controller for open help
Definition: BatchFrame.h:163
bool IsRunning()
returns true, if batch is running
Definition: BatchFrame.cpp:261
void SwapProject(int index, bool down)
bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &filenames)
File/directory drag and drop handler method.
Definition: BatchFrame.cpp:45
void OnButtonCancel(wxCommandEvent &event)
Definition: BatchFrame.cpp:517
void OnChoiceEnd(wxCommandEvent &event)
Batch * m_batch
Definition: BatchFrame.h:171
void OnButtonRemoveComplete(wxCommandEvent &event)
Definition: BatchFrame.cpp:829
wxTimer * m_updateProjectsTimer
Definition: BatchFrame.h:183
wxChoice * m_endChoice
Definition: BatchFrame.h:174
void OnBatchInformation(wxCommandEvent &e)
called when batch wants to show some progress message
EndTask
Definition: Batch.h:51
wxIcon m_iconRunning
Definition: BatchFrame.h:180
Batch processor for Hugin.
void SetCheckboxes()
void OnUserExit(wxCommandEvent &event)
Definition: BatchFrame.cpp:338
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.
Definition: BatchFrame.h:48
platform/compiler specific stuff.
Batch processor for Hugin.
void OnBatchFailed(wxCommandEvent &event)
called when batch was finished and there are failed projects
bool m_paused
Definition: BatchFrame.h:173
bool IsPaused()
returns true, if batch is paused
Definition: BatchFrame.cpp:266
void OnCheckAutoStitch(wxCommandEvent &event)
event handler called when auto stitch checkbox was changed
void OnCheckSaveLog(wxCommandEvent &event)
event handler called when always save log checkbox was changed
void OnButtonRemoveFromList(wxCommandEvent &event)
Definition: BatchFrame.cpp:859
ProjectListBox * projListBox
Definition: BatchFrame.h:166
void OnProgress(wxCommandEvent &event)
event handler for update progress controls
void OnButtonAddDir(wxCommandEvent &event)
Definition: BatchFrame.cpp:358
bool GetCheckVerbose()
return if verbose checkbox is checked
void OnButtonRunBatch(wxCommandEvent &event)
Definition: BatchFrame.cpp:960
void SetInternalVerbose(bool newVerbose)
sets the current verbose status, does not update the checkbox
BatchFrame(wxLocale *locale, wxString xrc)
Definition: BatchFrame.cpp:135
bool m_startedMinimized
Definition: BatchFrame.h:184
void OnButtonAddToAssistantQueue(wxCommandEvent &event)
let the user select a project file which should be added to the stitching queue
Definition: BatchFrame.cpp:439
void AddArrayToList(const wxArrayString &fileList, Project::Target target)
Definition: BatchFrame.cpp:507