mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-25 12:25:52 -04:00
fbb309a6cf
git-svn-id: svn://localhost@721 8062f311-0dae-4547-b526-b8ab9ac864a5
38 lines
975 B
C++
38 lines
975 B
C++
/** \file
|
|
* Game Develop
|
|
* 2008-2012 Florian Rival (Florian.Rival@gmail.com)
|
|
*/
|
|
|
|
#include "GDCore/Tools/HelpFileAccess.h"
|
|
#include <wx/mimetype.h> // 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;
|
|
}
|
|
}
|
|
|
|
}
|