29 #include <wx/stdpaths.h>
49 #if wxUSE_ON_FATAL_EXCEPTION
50 wxHandleFatalExceptions();
52 SetAppName(wxT(
"hugin"));
54 CheckConfigFilename();
60 wxFileName exeDir(wxStandardPaths::Get().GetExecutablePath());
61 exeDir.RemoveLastDir();
62 m_xrcPrefix = exeDir.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR) + wxT(
"share\\hugin\\xrc\\");
64 locale.AddCatalogLookupPathPrefix(exeDir.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR) + wxT(
"share\\locale"));
65 #elif defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
67 wxString thePath = MacGetPathToBundledResourceFile(CFSTR(
"xrc"));
68 if (thePath == wxT(
"")) {
69 wxMessageBox(_(
"xrc directory not found in bundle"), _(
"Fatal Error"));
72 m_xrcPrefix = thePath + wxT(
"/");
73 #elif defined UNIX_SELF_CONTAINED_BUNDLE
76 wxFileName exePath(wxStandardPaths::Get().GetExecutablePath());
77 exePath.RemoveLastDir();
78 const wxString huginRoot=exePath.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR);
80 m_xrcPrefix = huginRoot + wxT(
"share/hugin/xrc/");
81 locale.AddCatalogLookupPathPrefix(huginRoot + wxT(
"share/locale"));
85 m_xrcPrefix = wxT(INSTALL_XRC_DIR);
86 locale.AddCatalogLookupPathPrefix(wxT(INSTALL_LOCALE_DIR));
89 if ( ! wxFile::Exists(m_xrcPrefix + wxT(
"/lenscal_frame.xrc")) )
91 wxMessageBox(wxString::Format(_(
"xrc directory not found, hugin needs to be properly installed\nTried Path: %s"), m_xrcPrefix), _(
"Fatal Error"));
96 wxConfigBase * config = wxConfigBase::Get();
98 config->SetRecordDefaults(
false);
102 setlocale(LC_ALL,
"");
104 int localeID = config->Read(wxT(
"language"), (
long)
HUGIN_LANGUAGE);
108 bLInit = locale.Init(localeID);
111 DEBUG_TRACE(
"System Locale: " << locale.GetSysName().mb_str(wxConvLocal))
112 DEBUG_TRACE(
"Canonical Locale: " << locale.GetCanonicalName().mb_str(wxConvLocal))
119 locale.AddCatalog(wxT(
"hugin"));
122 wxInitAllImageHandlers();
125 wxXmlResource::Get()->InitAllHandlers();
128 wxXmlResource::Get()->Load(m_xrcPrefix + wxT(
"lenscal_frame.xrc"));
129 wxXmlResource::Get()->Load(m_xrcPrefix + wxT(
"lensdb_dialogs.xrc"));
130 wxXmlResource::Get()->Load(m_xrcPrefix + wxT(
"dlg_warning.xrc"));
134 SetTopWindow(m_frame);
143 TIFFSetWarningHandler(0);
148 #if wxUSE_ON_FATAL_EXCEPTION
149 void LensCalApp::OnFatalException()
151 GenerateReport(wxDebugReport::Context_Exception);
xrc handler for LensCalImageCtrl
void registerPTWXDlgFcn()
include file for the hugin project
declaration of preview for lens calibration gui
include file for the hugin project
The application class for lens_calibrate_gui .
functions for interaction with the hugin configuration file
declaration of application class for lens calibrate application
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
Restore window size and position from configfile/registry.