78
78
wxString getDefaultProjectName(const Panorama & pano)
80
if (pano.getNrOfImages() > 0) {
82
wxString first_img(stripExtension(stripPath(pano.getImage(0).getFilename())).c_str(), HUGIN_CONV_FILENAME);
83
wxString last_img(stripExtension(stripPath(pano.getImage(pano.getNrOfImages()-1).getFilename())).c_str(), HUGIN_CONV_FILENAME);
84
return first_img + wxT("-") + last_img;
86
return wxString(wxT("pano"));
80
bool t = (wxConfigBase::Get()->Read(wxT("ProjectNamingConvention"), HUGIN_PROJECT_NAMING_CONVENTION) != 0);
82
if (pano.getNrOfImages() > 0) {
83
wxString first_img(hugin_utils::getFolder(pano.getImage(0).getFilename()).c_str(), HUGIN_CONV_FILENAME);
86
return wxString(wxT("pano"));
89
if (pano.getNrOfImages() > 0) {
91
wxString first_img(stripExtension(stripPath(pano.getImage(0).getFilename())).c_str(), HUGIN_CONV_FILENAME);
92
wxString last_img(stripExtension(stripPath(pano.getImage(pano.getNrOfImages()-1).getFilename())).c_str(), HUGIN_CONV_FILENAME);
93
return first_img + wxT("-") + last_img;
95
return wxString(wxT("pano"));
100
DEFINE_EVENT_TYPE( EVT_IMAGE_READY )
102
BEGIN_EVENT_TABLE(huginApp, wxApp)
103
EVT_IMAGE_READY2(-1, huginApp::relayImageLoaded)
92
106
// make wxwindows use this class as the main application
93
107
IMPLEMENT_APP(huginApp)
117
131
DEBUG_TRACE("=========================== huginApp::OnInit() begin ===================");
118
132
SetAppName(wxT("hugin"));
134
// Connect to ImageCache: we need to tell it when it is safe to handle UI events.
135
ImageCache::getInstance().asyncLoadCompleteSignal = &huginApp::imageLoadedAsync;
121
138
// do not use the native list control on OSX (it is very slow with the control point list window)
270
291
// setup main frame size, after it has been created.
271
292
RestoreFramePosition(frame, wxT("MainFrame"));
294
provider->SetHelpController(&frame->GetHelpController());
295
frame->GetHelpController().Initialize(m_xrcPrefix+wxT("data/hugin_help_en_EN.chm"));
273
296
frame->SendSizeEvent();
470
MainFrame* huginApp::getMainFrame()
473
return m_this->frame;
479
void huginApp::relayImageLoaded(ImageReadyEvent & event)
481
ImageCache::getInstance().postEvent(event.request, event.entry);
484
void huginApp::imageLoadedAsync(ImageCache::RequestPtr request, ImageCache::EntryPtr entry)
486
ImageReadyEvent event(request, entry);
487
// AddPendingEvent adds the event to the event queue and returns without
488
// processing it. This is necessary since we are probably not in the
489
// UI thread, but the event handler must be run in the UI thread since it
490
// could update image views.
491
Get()->AddPendingEvent(event);
448
495
void huginApp::MacOpenFile(const wxString &fileName)
600
IMPLEMENT_DYNAMIC_CLASS(MyHTML, wxHtmlWindow)
602
BEGIN_EVENT_TABLE(MyHTML, wxHtmlWindow)
603
// Add event tables here
606
bool MyHTML::Create(wxWindow * parent, wxWindowID id,
612
wxXmlResource::Get()->LoadPanel(this, GetParent(), _T("dedication_html"));
613
GetSizer()->Fit(this);
618
void MyHTML::OnLinkClicked(const wxHtmlLinkInfo& link)
620
if (link.GetHref().StartsWith(_T("http://")))
621
wxLaunchDefaultBrowser(link.GetHref());
623
wxHtmlWindow::OnLinkClicked(link);