mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
34 lines
1.0 KiB
C++
34 lines
1.0 KiB
C++
/*
|
|
* GDevelop IDE
|
|
* Copyright 2008-2015 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
|
|
* This project is released under the GNU General Public License.
|
|
*/
|
|
#include "HelpProvider.h"
|
|
#include <wx/utils.h>
|
|
#include <wx/mimetype.h>
|
|
|
|
HelpProvider * HelpProvider::_singleton = NULL;
|
|
|
|
void HelpProvider::OpenLink(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;
|
|
}
|
|
}
|