/** \file * Game Develop * 2008-2012 Florian Rival (Florian.Rival@gmail.com) */ #include "GDCore/Tools/HelpFileAccess.h" #include // mimetype support namespace gd { HelpFileAccess * HelpFileAccess::_singleton = NULL; void HelpFileAccess::OpenURL(wxString link) { wxString mimetype = wxEmptyString; if (link.StartsWith (_T("http://"))) { mimetype = _T("text/html"); }else if (link.StartsWith (_T("ftp://"))) { mimetype = _T("text/html"); }else if (link.StartsWith (_T("mailto:"))) { mimetype = _T("message/rfc822"); }else{ return; } wxFileType *filetype = wxTheMimeTypesManager->GetFileTypeFromMimeType (mimetype); if (filetype) { wxString cmd; if (filetype->GetOpenCommand (&cmd, wxFileType::MessageParameters (link))) { cmd.Replace(_T("file://"), wxEmptyString); ::wxExecute(cmd); } delete filetype; } } }