Diff of /src/hugin1/base_wx/huginConfig.cpp [6cdbff] .. [d5c5e9]  Maximize  Restore

Switch to unified view

a/src/hugin1/base_wx/huginConfig.cpp b/src/hugin1/base_wx/huginConfig.cpp
...
...
33
using namespace PT;
33
using namespace PT;
34
34
35
std::string getProgram(wxConfigBase * config, wxString bindir, wxString file, wxString name)
35
std::string getProgram(wxConfigBase * config, wxString bindir, wxString file, wxString name)
36
{
36
{
37
    std::string pname;
37
    std::string pname;
38
#ifdef __WXMAC__ && MAC_SELF_CONTAINED_BUNDLE
38
#if defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
39
    if (config->Read(name + wxT("/Custom"), 0l)) {
39
    if (config->Read(name + wxT("/Custom"), 0l)) {
40
        wxString fn = config->Read(name + wxT("/Exe"),wxT(""));
40
        wxString fn = config->Read(name + wxT("/Exe"),wxT(""));
41
        if (wxFileName::FileExists(fn)) {
41
        if (wxFileName::FileExists(fn)) {
42
            pname = fn.mb_str();
42
            pname = fn.mb_str();
43
            return pname;
43
            return pname;
...
...
77
#else
77
#else
78
    // unix, never bundled
78
    // unix, never bundled
79
    if (config->Read(name + wxT("/Custom"), 0l)) {
79
    if (config->Read(name + wxT("/Custom"), 0l)) {
80
        wxString fn = config->Read(name + wxT("/Exe"),wxT(""));
80
        wxString fn = config->Read(name + wxT("/Exe"),wxT(""));
81
        pname = fn.mb_str();
81
        pname = fn.mb_str();
82
        return pname;
83
  // TODO: need to search path, a simple FileExists() doesn't work as expected.
84
  /*
82
        if (wxFileName::FileExists(fn)) {
85
        if (wxFileName::FileExists(fn)) {
83
            pname = fn.mb_str();
86
            pname = fn.mb_str();
84
            return pname;
87
            return pname;
85
        } else {
88
        } else {
86
            wxMessageBox(wxString::Format(_("External program %s not found as specified in preferences, reverting to system path"), file.c_str()), _("Error"));
89
            wxMessageBox(wxString::Format(_("External program %s not found as specified in preferences, reverting to system path"), file.c_str()), _("Error"));
87
        }
90
        }
91
  */
88
    }
92
    }
89
    pname = file.mb_str();
93
    pname = file.mb_str();
90
    return pname;
94
    return pname;
91
#endif
95
#endif
92
}
96
}