Hugin trunk 0.1
Loading...
Searching...
No Matches
FailedProjectsDialog.cpp
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
2
11/* This is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
15 *
16 * This software is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public
22 * License along with this software. If not, see
23 * <http://www.gnu.org/licenses/>.
24 *
25 */
26
28#include "base_wx/wxPlatform.h"
29#include "panoinc.h"
30#include "Batch.h"
31#include "base_wx/wxutils.h"
32
34{
35 // load our children. some children might need special
36 // initialization. this will be done later.
37 wxXmlResource::Get()->LoadDialog(this,parent,"failed_project_dialog");
38
40
41 m_list=XRCCTRL(*this,"failed_list",wxListBox);
43 m_log=XRCCTRL(*this,"failed_log",wxTextCtrl);
44
45 //fill list
46 for(unsigned int i=0; i<batch->GetFailedProjectsCount(); i++)
47 {
48 m_list->AppendString(batch->GetFailedProjectName(i));
49 };
50 if(m_list->GetCount()>0)
51 {
52 m_list->SetSelection(0);
53 wxCommandEvent dummy;
55 };
56
57 //set parameters
58 wxConfigBase* config = wxConfigBase::Get();
59 // restore position and size
60 hugin_utils::RestoreFramePosition(this, "FailedProjectsDialog");
61 //splitter position
62 int splitter_pos=config->Read("/FailedProjectsDialog/splitterPos",-1l);
63 wxSplitterWindow* splitWindow=XRCCTRL(*this,"failed_splitter",wxSplitterWindow);
64 if(splitter_pos>0 && splitter_pos<splitWindow->GetSize().GetWidth())
65 {
66 splitWindow->SetSashPosition(splitter_pos);
67 };
68};
69
71{
72 wxConfigBase* config=wxConfigBase::Get();
73 hugin_utils::StoreFramePosition(this, "FailedProjectsDialog");
74 config->Write("/FailedProjectsDialog/splitterPos", XRCCTRL(*this,"failed_splitter",wxSplitterWindow)->GetSashPosition());
75};
76
78{
79 int sel=m_list->GetSelection();
80 m_log->Clear();
81 if(sel!=wxNOT_FOUND)
82 {
84 if(!logfile.IsEmpty())
85 {
86 if(wxFileName::FileExists(logfile))
87 {
88 m_log->LoadFile(logfile);
89 }
90 };
91 };
92};
Batch processor for Hugin.
Definition of failed projects dialog.
Definition Batch.h:47
wxString GetFailedProjectLog(unsigned int i)
returns log file name of failed project with index i
Definition Batch.cpp:943
void OnSelectProject(wxCommandEvent &e)
event handler, if new project was selected
~FailedProjectsDialog()
destructor, saves size and position
FailedProjectsDialog(wxWindow *parent, Batch *batch, wxString xrcPrefix)
Constructor, read from xrc ressource; restore last uses settings, size and position.
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
Definition wxutils.cpp:106
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
Definition wxutils.cpp:67
include file for the hugin project
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41
platform/compiler specific stuff.