Use wxLaunchDefaultBrowser instead of custom-built solution for opening URL's

Originally committed to SVN as r1064.
This commit is contained in:
Niels Martin Hansen 2007-04-13 00:04:44 +00:00
parent 50c14d9067
commit 07cc2d8042

View file

@ -41,6 +41,7 @@
#include <wx/filename.h>
#include <wx/msgdlg.h>
#include <wx/mimetype.h>
#include <wx/utils.h>
#include "main.h"
#include "frame_main.h"
#include "options.h"
@ -114,7 +115,7 @@ bool AegisubApp::OnInit() {
AssExportFilterChain::PrepareFilters();
// Set association
#ifndef DEBUG
#ifndef _DEBUG
RegistryAssociate();
#endif
@ -370,11 +371,7 @@ void AegisubApp::GetFolderName () {
////////////
// Open URL
void AegisubApp::OpenURL(wxString url) {
wxFileType *type = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("html"));
if (type) {
wxString command = type->GetOpenCommand(url);
if (!command.empty()) wxExecute(command);
}
wxLaunchDefaultBrowser(url, wxBROWSER_NEW_WINDOW);
}