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 #include "BatchTrayIcon.h"
39 //#include <wx/app.h>
40 #include "ProgressStatusBar.h"
41 #include <wx/timer.h>
42 
44 class BatchDropTarget : public wxFileDropTarget
45 {
46 public:
53  bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames);
54 };
55 
56 class BatchFrame : public wxFrame
57 {
58 public:
59  //Main constructor
60  BatchFrame(wxLocale* locale, wxString xrc);
61  // create statusbar with progress control
62  wxStatusBar* OnCreateStatusBar(int number, long style, wxWindowID id, const wxString& name);
63 
64  void OnUserExit(wxCommandEvent& event);
65  void OnButtonAddCommand(wxCommandEvent& event);
66  void OnButtonAddDir(wxCommandEvent& event);
67  void OnButtonSearchPano(wxCommandEvent& e);
69  void OnButtonGenerateSequence(wxCommandEvent& e);
71  void OnButtonAddToStitchingQueue(wxCommandEvent& event);
73  void OnButtonAddToAssistantQueue(wxCommandEvent& event);
74  void OnButtonCancel(wxCommandEvent& event);
75  void OnButtonChangePrefix(wxCommandEvent& event);
76  void OnButtonChangeUserDefinedSequence(wxCommandEvent& event);
77  void OnButtonClear(wxCommandEvent& event);
78  void OnMinimizeTrayMenu(wxCommandEvent& e);
79  void OnButtonHelp(wxCommandEvent& event);
80  void OnButtonMoveDown(wxCommandEvent& event);
81  void OnButtonMoveUp(wxCommandEvent& event);
82  void OnButtonOpenBatch(wxCommandEvent& event);
83  void OnButtonOpenWithHugin(wxCommandEvent& event);
84  void OnButtonPause(wxCommandEvent& event);
85  void OnButtonRemoveComplete(wxCommandEvent& event);
86  void OnButtonRemoveFromList(wxCommandEvent& event);
87  void OnButtonReset(wxCommandEvent& event);
88  void OnButtonResetAll(wxCommandEvent& event);
89  void OnButtonRunBatch(wxCommandEvent& event);
90  void OnButtonSaveBatch(wxCommandEvent& event);
91  void OnButtonSkip(wxCommandEvent& event);
92 
93  void OnCheckOverwrite(wxCommandEvent& event);
94  void OnChoiceEnd(wxCommandEvent& event);
95  void OnCheckVerbose(wxCommandEvent& event);
97  void OnCheckAutoRemove(wxCommandEvent& event);
99  void OnCheckAutoStitch(wxCommandEvent& event);
101  void OnCheckSaveLog(wxCommandEvent& event);
103  void OnProgress(wxCommandEvent& event);
104 
105  //Called on window close to take care of the child thread
106  void OnClose(wxCloseEvent& event);
108  void OnMinimize(wxIconizeEvent& e);
109  //Resets all checkboxes based on m_batch object properties
110  void PropagateDefaults();
111  //Sets all checkboxes corresponding the setting in config
112  void SetCheckboxes();
113  //Starts batch execution
114  void RunBatch();
115  //Sets locale and XRC prefix pointers from main app
116  void SetLocaleAndXRC(wxLocale* locale, wxString xrc);
117  //Swaps the project entry at index in the list with the next (at index+1).
118  void SwapProject(int index, bool down);
119  //PanoramaOptions readOptions(wxString projectFile);
123  bool GetCheckOverwrite();
125  bool GetCheckVerbose();
127  bool GetCheckAutoRemove();
129  bool GetCheckAutoStitch();
131  bool GetCheckSaveLog();
132  void RestoreSize();
133  void AddToList(wxString aFile, Project::Target target=Project::STITCHING, wxString userDefined = wxEmptyString);
134  void AddArrayToList(const wxArrayString& fileList, Project::Target target);
135  void AddDirToList(wxString aDir);
136  void ChangePrefix(int index,wxString newPrefix);
137  void ChangeUserDefined(int index, wxString newUserDefined);
139  bool IsRunning();
141  bool IsPaused();
145  void SetStatusInformation(wxString status);
150  {
151  return m_startedMinimized;
152  };
154  void SetInternalVerbose(bool newVerbose);
157 
159  wxHelpController& GetHelpController() { return m_HelpController; }
160 
161  //wxMutex* projListMutex;
163 
164 private:
165  wxLocale* m_locale;
166  wxString m_xrcPrefix;
169  bool m_paused;
170  wxChoice* m_endChoice;
171  // help controller
172  wxHelpController m_HelpController;
175  wxIcon m_iconNormal;
177  wxIcon m_iconPaused;
178  // timer for checking of modified projects
181 
182  void OnProcessTerminate(wxProcessEvent& event);
184  void OnUpdateListBox(wxTimerEvent& event);
186  void OnBatchFailed(wxCommandEvent& event);
188  void OnBatchInformation(wxCommandEvent& e);
190  void OnRefillListBox(wxCommandEvent& e);
192  void UpdateTrayIcon(const bool createTrayIcon);
193 };
194 
195 #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:531
definition of statusbar with progress indicator
void ChangePrefix(int index, wxString newPrefix)
Definition: BatchFrame.cpp:605
bool IsStartedMinimized()
returns true, if last session was finished minimized
Definition: BatchFrame.h:149
bool GetCheckAutoRemove()
return if auto remove checkbox is checked
wxHelpController m_HelpController
Definition: BatchFrame.h:172
bool GetCheckSaveLog()
return if always save log is checked
wxIcon m_iconNormal
Definition: BatchFrame.h:175
void AddDirToList(wxString aDir)
Definition: BatchFrame.cpp:470
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:900
ProgressStatusBar * m_progStatusBar
Definition: BatchFrame.h:174
Batch::EndTask GetEndTask()
return which task should be executed at end
void OnButtonOpenBatch(wxCommandEvent &event)
Definition: BatchFrame.cpp:728
void RunBatch()
void AddToList(wxString aFile, Project::Target target=Project::STITCHING, wxString userDefined=wxEmptyString)
Definition: BatchFrame.cpp:491
void OnButtonGenerateSequence(wxCommandEvent &e)
generate a sequence of panoramas
Definition: BatchFrame.cpp:380
void OnButtonPause(wxCommandEvent &event)
Definition: BatchFrame.cpp:798
wxLocale * m_locale
Definition: BatchFrame.h:165
void OnProcessTerminate(wxProcessEvent &event)
void OnButtonHelp(wxCommandEvent &event)
Definition: BatchFrame.cpp:694
void OnButtonChangeUserDefinedSequence(wxCommandEvent &event)
Definition: BatchFrame.cpp:635
void OnClose(wxCloseEvent &event)
bool GetCheckOverwrite()
return if overwrite checkbox is checked
void OnButtonSaveBatch(wxCommandEvent &event)
Definition: BatchFrame.cpp:974
wxString m_xrcPrefix
Definition: BatchFrame.h:166
wxIcon m_iconPaused
Definition: BatchFrame.h:177
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:273
definition of tray/task bar icon for PTBatcherGUI
void OnButtonSkip(wxCommandEvent &event)
Definition: BatchFrame.cpp:989
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:345
void OnButtonMoveUp(wxCommandEvent &event)
Definition: BatchFrame.cpp:714
class for showing a taskbar/tray icon
Definition: BatchTrayIcon.h:33
void ChangeUserDefined(int index, wxString newUserDefined)
Definition: BatchFrame.cpp:620
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:675
Definition: Batch.h:46
void OnCheckVerbose(wxCommandEvent &event)
wxStatusBar * OnCreateStatusBar(int number, long style, wxWindowID id, const wxString &name)
Definition: BatchFrame.cpp:256
void SetStatusInformation(wxString status)
sets status message, also updates tooltip of taskbar icon
bool m_cancelled
Definition: BatchFrame.h:168
void OnButtonSearchPano(wxCommandEvent &e)
Definition: BatchFrame.cpp:374
void OnButtonAddToStitchingQueue(wxCommandEvent &event)
let the user select a project file which should be added to the stitching queue
Definition: BatchFrame.cpp:413
BatchTaskBarIcon * m_tray
Definition: BatchFrame.h:173
void OnCheckOverwrite(wxCommandEvent &event)
void OnButtonOpenWithHugin(wxCommandEvent &event)
Definition: BatchFrame.cpp:752
void OnMinimize(wxIconizeEvent &e)
handle when minimize or restore image
void OnButtonResetAll(wxCommandEvent &event)
Definition: BatchFrame.cpp:935
void OnButtonMoveDown(wxCommandEvent &event)
Definition: BatchFrame.cpp:700
wxHelpController & GetHelpController()
return help controller for open help
Definition: BatchFrame.h:159
bool IsRunning()
returns true, if batch is running
Definition: BatchFrame.cpp:263
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:43
void OnButtonCancel(wxCommandEvent &event)
Definition: BatchFrame.cpp:519
void OnChoiceEnd(wxCommandEvent &event)
Batch * m_batch
Definition: BatchFrame.h:167
void OnButtonRemoveComplete(wxCommandEvent &event)
Definition: BatchFrame.cpp:830
wxTimer * m_updateProjectsTimer
Definition: BatchFrame.h:179
wxChoice * m_endChoice
Definition: BatchFrame.h:170
void OnBatchInformation(wxCommandEvent &e)
called when batch wants to show some progress message
EndTask
Definition: Batch.h:49
wxIcon m_iconRunning
Definition: BatchFrame.h:176
Batch processor for Hugin.
void SetCheckboxes()
void OnUserExit(wxCommandEvent &event)
Definition: BatchFrame.cpp:340
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:44
Batch processor for Hugin.
void OnBatchFailed(wxCommandEvent &event)
called when batch was finished and there are failed projects
bool m_paused
Definition: BatchFrame.h:169
bool IsPaused()
returns true, if batch is paused
Definition: BatchFrame.cpp:268
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:860
ProjectListBox * projListBox
Definition: BatchFrame.h:162
void OnProgress(wxCommandEvent &event)
event handler for update progress controls
void OnButtonAddDir(wxCommandEvent &event)
Definition: BatchFrame.cpp:360
bool GetCheckVerbose()
return if verbose checkbox is checked
void OnButtonRunBatch(wxCommandEvent &event)
Definition: BatchFrame.cpp:961
void SetInternalVerbose(bool newVerbose)
sets the current verbose status, does not update the checkbox
BatchFrame(wxLocale *locale, wxString xrc)
Definition: BatchFrame.cpp:85
bool m_startedMinimized
Definition: BatchFrame.h:180
void OnButtonAddToAssistantQueue(wxCommandEvent &event)
let the user select a project file which should be added to the stitching queue
Definition: BatchFrame.cpp:441
void AddArrayToList(const wxArrayString &fileList, Project::Target target)
Definition: BatchFrame.cpp:509