From: <hug...@li...> - 2011-10-08 09:34:52
|
branch: details: http://hugin.hg.sourceforge.net/hgweb/hugin/hugin/hgrepo/h/hu/hugin/hugin/rev/eae49ac5569a changeset: 5618:eae49ac5569a user: tmodes date: Sat Oct 08 11:34:28 2011 +0200 description: PTBatcherGUI: Added menu item to add project to assistant queue diffstat: src/hugin1/hugin/xrc/batch_menu.xrc | 10 +++++++--- src/hugin1/ptbatcher/BatchFrame.cpp | 30 +++++++++++++++++++++++++++--- src/hugin1/ptbatcher/BatchFrame.h | 5 ++++- src/hugin1/ptbatcher/BatchTrayIcon.cpp | 11 ++++++++++- src/hugin1/ptbatcher/BatchTrayIcon.h | 2 ++ src/hugin1/ptbatcher/PTBatcherGUI.cpp | 2 +- 6 files changed, 51 insertions(+), 9 deletions(-) diffs (162 lines): diff -r f9027b57c3d0 -r eae49ac5569a src/hugin1/hugin/xrc/batch_menu.xrc --- a/src/hugin1/hugin/xrc/batch_menu.xrc Sat Oct 08 11:07:56 2011 +0200 +++ b/src/hugin1/hugin/xrc/batch_menu.xrc Sat Oct 08 11:34:28 2011 +0200 @@ -4,8 +4,12 @@ <object class="wxMenu" name="file_menu"> <label>&File</label> <object class="wxMenuItem" name="menu_add"> - <label>Add project...</label> - <help>Adds a project to the batch list.</help> + <label>Add project to stitching queue...</label> + <help>Adds a project to the stitching queue</help> + </object> + <object class="wxMenuItem" name="menu_add_assistant"> + <label>Add project to assistant queue...</label> + <help>Adds a project to the assistant queue</help> </object> <object class="wxMenuItem" name="menu_remove"> <label>Remove project</label> @@ -50,4 +54,4 @@ </object> </object> </object> -</resource> +</resource> \ No newline at end of file diff -r f9027b57c3d0 -r eae49ac5569a src/hugin1/ptbatcher/BatchFrame.cpp --- a/src/hugin1/ptbatcher/BatchFrame.cpp Sat Oct 08 11:07:56 2011 +0200 +++ b/src/hugin1/ptbatcher/BatchFrame.cpp Sat Oct 08 11:34:28 2011 +0200 @@ -82,10 +82,11 @@ EVT_TOOL(XRCID("tool_skip"),BatchFrame::OnButtonSkip) EVT_TOOL(XRCID("tool_pause"),BatchFrame::OnButtonPause) EVT_TOOL(XRCID("tool_cancel"),BatchFrame::OnButtonCancel) - EVT_TOOL(XRCID("tool_add"),BatchFrame::OnButtonAddToList) + EVT_TOOL(XRCID("tool_add"),BatchFrame::OnButtonAddToStitchingQueue) EVT_TOOL(XRCID("tool_remove"),BatchFrame::OnButtonRemoveFromList) EVT_TOOL(XRCID("tool_adddir"),BatchFrame::OnButtonAddDir) - EVT_MENU(XRCID("menu_add"),BatchFrame::OnButtonAddToList) + EVT_MENU(XRCID("menu_add"),BatchFrame::OnButtonAddToStitchingQueue) + EVT_MENU(XRCID("menu_add_assistant"),BatchFrame::OnButtonAddToAssistantQueue) EVT_MENU(XRCID("menu_remove"),BatchFrame::OnButtonRemoveFromList) EVT_MENU(XRCID("menu_adddir"),BatchFrame::OnButtonAddDir) EVT_MENU(XRCID("menu_searchpano"), BatchFrame::OnButtonSearchPano) @@ -342,7 +343,7 @@ findpano_dlg.ShowModal(); }; -void BatchFrame::OnButtonAddToList(wxCommandEvent& event) +void BatchFrame::OnButtonAddToStitchingQueue(wxCommandEvent& event) { wxString defaultdir = wxConfigBase::Get()->Read(wxT("/BatchFrame/actualPath"),wxT("")); wxFileDialog dlg(0, @@ -365,6 +366,29 @@ }; } +void BatchFrame::OnButtonAddToAssistantQueue(wxCommandEvent& event) +{ + wxString defaultdir = wxConfigBase::Get()->Read(wxT("/BatchFrame/actualPath"),wxT("")); + wxFileDialog dlg(0, + _("Specify project source file(s)"), + defaultdir, wxT(""), + _("Project files (*.pto,*.ptp,*.pts,*.oto)|*.pto;*.ptp;*.pts;*.oto;|All files (*)|*"), + wxFD_OPEN | wxFD_MULTIPLE, wxDefaultPosition); + dlg.SetDirectory(wxConfigBase::Get()->Read(wxT("/BatchFrame/actualPath"),wxT(""))); + + if (dlg.ShowModal() == wxID_OK) + { + wxConfig::Get()->Write(wxT("/BatchFrame/actualPath"), dlg.GetDirectory()); // remember for later + wxArrayString paths; + dlg.GetPaths(paths); + for(unsigned int i=0; i<paths.GetCount(); i++) + { + AddToList(paths.Item(i),Project::DETECTING); + } + m_batch->SaveTemp(); + }; +} + void BatchFrame::AddDirToList(wxString aDir) { //we traverse all subdirectories of chosen path diff -r f9027b57c3d0 -r eae49ac5569a src/hugin1/ptbatcher/BatchFrame.h --- a/src/hugin1/ptbatcher/BatchFrame.h Sat Oct 08 11:07:56 2011 +0200 +++ b/src/hugin1/ptbatcher/BatchFrame.h Sat Oct 08 11:34:28 2011 +0200 @@ -62,7 +62,10 @@ void OnButtonAddCommand(wxCommandEvent& event); void OnButtonAddDir(wxCommandEvent& event); void OnButtonSearchPano(wxCommandEvent& e); - void OnButtonAddToList(wxCommandEvent& event); + /** let the user select a project file which should be added to the stitching queue */ + void OnButtonAddToStitchingQueue(wxCommandEvent& event); + /** let the user select a project file which should be added to the stitching queue */ + void OnButtonAddToAssistantQueue(wxCommandEvent& event); void OnButtonCancel(wxCommandEvent& event); void OnButtonChangePrefix(wxCommandEvent& event); void OnButtonClear(wxCommandEvent& event); diff -r f9027b57c3d0 -r eae49ac5569a src/hugin1/ptbatcher/BatchTrayIcon.cpp --- a/src/hugin1/ptbatcher/BatchTrayIcon.cpp Sat Oct 08 11:07:56 2011 +0200 +++ b/src/hugin1/ptbatcher/BatchTrayIcon.cpp Sat Oct 08 11:34:28 2011 +0200 @@ -37,6 +37,7 @@ ID_PAUSE=wxID_HIGHEST+103, ID_STOP=wxID_HIGHEST+104, ID_ADDPROJECT=wxID_HIGHEST+105, + ID_ADDPROJECTASSISTANT=wxID_HIGHEST+106, ID_EXIT=wxID_HIGHEST+120 }; @@ -47,6 +48,7 @@ EVT_MENU(ID_PAUSE, BatchTaskBarIcon::OnPauseBatch) EVT_MENU(ID_STOP, BatchTaskBarIcon::OnStopBatch) EVT_MENU(ID_ADDPROJECT, BatchTaskBarIcon::OnAddProject) + EVT_MENU(ID_ADDPROJECTASSISTANT, BatchTaskBarIcon::OnAddProjectToAssistant) EVT_MENU(ID_EXIT, BatchTaskBarIcon::OnExit) END_EVENT_TABLE() @@ -71,7 +73,8 @@ menu->Append(ID_STOP,_("Stop batch")); menu->Enable(ID_STOP,isRunning); menu->AppendSeparator(); - menu->Append(ID_ADDPROJECT,_("Add project to queue...")); + menu->Append(ID_ADDPROJECT,_("Add project to stitching queue...")); + menu->Append(ID_ADDPROJECTASSISTANT,_("Add project to assistant queue...")); #ifndef __WXMAC_OSX__ /*Mac has built-in quit menu*/ menu->AppendSeparator(); @@ -111,6 +114,12 @@ wxGetApp().GetFrame()->GetEventHandler()->AddPendingEvent(ev); }; +void BatchTaskBarIcon::OnAddProjectToAssistant(wxCommandEvent& e) +{ + wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED ,XRCID("menu_add_assistant")); + wxGetApp().GetFrame()->GetEventHandler()->AddPendingEvent(ev); +}; + void BatchTaskBarIcon::OnExit(wxCommandEvent& e) { wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED ,XRCID("menu_exit")); diff -r f9027b57c3d0 -r eae49ac5569a src/hugin1/ptbatcher/BatchTrayIcon.h --- a/src/hugin1/ptbatcher/BatchTrayIcon.h Sat Oct 08 11:07:56 2011 +0200 +++ b/src/hugin1/ptbatcher/BatchTrayIcon.h Sat Oct 08 11:34:28 2011 +0200 @@ -47,6 +47,8 @@ void OnExit(wxCommandEvent& e); /** handler to adding a project to stitching queue */ void OnAddProject(wxCommandEvent& e); + /** handler to adding a project to assistant queue */ + void OnAddProjectToAssistant(wxCommandEvent& e); /** creates the popup menu */ virtual wxMenu* CreatePopupMenu(); diff -r f9027b57c3d0 -r eae49ac5569a src/hugin1/ptbatcher/PTBatcherGUI.cpp --- a/src/hugin1/ptbatcher/PTBatcherGUI.cpp Sat Oct 08 11:07:56 2011 +0200 +++ b/src/hugin1/ptbatcher/PTBatcherGUI.cpp Sat Oct 08 11:34:28 2011 +0200 @@ -419,7 +419,7 @@ m_frame->OnButtonRemoveFromList(dummy); break; case WXK_INSERT: - m_frame->OnButtonAddToList(dummy); + m_frame->OnButtonAddToStitchingQueue(dummy); break; case WXK_ESCAPE: m_frame->OnButtonCancel(dummy); |