Diff of /src/hugin1/base_wx/platform.cpp [a99915] .. [636261] Maximize Restore

  Switch to unified view

a/src/hugin1/base_wx/platform.cpp b/src/hugin1/base_wx/platform.cpp
...
...
130
        cout << "PTBatcherGui check failed \n" << endl;
130
        cout << "PTBatcherGui check failed \n" << endl;
131
        wxMessageBox(wxString::Format(_("External program %s not found in the bundle, reverting to system path"), wxT("open")), _("Error"));
131
        wxMessageBox(wxString::Format(_("External program %s not found in the bundle, reverting to system path"), wxT("open")), _("Error"));
132
    }
132
    }
133
    if(bundleURL == NULL)
133
    if(bundleURL == NULL)
134
    {
134
    {
135
        DEBUG_INFO("Mac: CFURL from string (" << bundlePath << ") failed." );
135
        DEBUG_INFO("Mac: CFURL from string (" << bundleURL << ") failed." );
136
        return theResult;
136
        return theResult;
137
    }
137
    }
138
    
138
    
139
    CFBundleRef bundle = CFBundleCreate(NULL, bundleURL);
139
    CFBundleRef bundle = CFBundleCreate(NULL, bundleURL);
140
    CFRelease(bundleURL);
140
    CFRelease(bundleURL);
141
    
141
    
142
    if(bundle == NULL)
142
    if(bundle == NULL)
143
    {
143
    {
144
        DEBUG_INFO("Mac: CFBundleCreate (" << bundlePath << " ) failed" );
144
        DEBUG_INFO("Mac: CFBundleCreate (" << bundleURL << " ) failed" );
145
    }
145
    }
146
    else
146
    else
147
    {
147
    {
148
        CFURLRef PTOurl = CFBundleCopyExecutableURL(bundle);
148
        CFURLRef PTOurl = CFBundleCopyExecutableURL(bundle);
149
        CFRelease( bundle );
149
        CFRelease( bundle );
...
...
291
        }
291
        }
292
    }
292
    }
293
    return theResult;
293
    return theResult;
294
}
294
}
295
295
296
wxString MacGetPathToBundledFrameworksDirectory()
297
{
298
    wxString theResult = wxT("");
299
    
300
    CFBundleRef mainbundle = CFBundleGetMainBundle();
301
    if(mainbundle == NULL)
302
    {
303
        DEBUG_INFO("Mac: Not bundled");
304
    }
305
    else
306
    {
307
        CFURLRef XRCurl = CFBundleCopyBundleURL(mainbundle);
308
        if(XRCurl == NULL)
309
        {
310
            DEBUG_INFO("Mac: Cannot locate the file in bundle.");
311
        }
312
        else
313
        {
314
            CFStringRef pathInCFString = CFURLCopyFileSystemPath(XRCurl, kCFURLPOSIXPathStyle);
315
            CFRelease( XRCurl );
316
            if(pathInCFString == NULL)
317
            {
318
                DEBUG_INFO("Mac: Failed to get URL in CFString");
319
            }
320
            else
321
            {
322
                CFRetain( pathInCFString );
323
#if wxCHECK_VERSION(2,9,0)
324
                theResult = wxCFStringRef(pathInCFString).AsString(wxLocale::GetSystemEncoding());
325
#else
326
                theResult = wxMacCFStringHolder(pathInCFString).AsString(wxLocale::GetSystemEncoding());
327
#endif
328
                DEBUG_INFO("Mac: the Frameworks file's path in the application bundle: " << theResult.mb_str(wxConvLocal));
329
            }
330
        }
331
    }
332
    return theResult + wxT("/Contents/Frameworks");
333
}
334
296
wxString MacGetPathToBundledExecutableFile(CFStringRef filename)
335
wxString MacGetPathToBundledExecutableFile(CFStringRef filename)
297
{
336
{
298
    wxString theResult = wxT("");
337
    wxString theResult = wxT("");
299
338
300
    CFBundleRef mainbundle = CFBundleGetMainBundle();
339
    CFBundleRef mainbundle = CFBundleGetMainBundle();