Fix URL launching on MacOS
This commit is contained in:
parent
41b7c62c15
commit
80233aece9
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <kicad_curl/kicad_curl_easy.h>
|
#include <kicad_curl/kicad_curl_easy.h>
|
||||||
|
#include <launch_ext.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
// kicad_curl.h must be included before wx headers, to avoid
|
// kicad_curl.h must be included before wx headers, to avoid
|
||||||
|
@ -677,5 +678,5 @@ void DIALOG_ABOUT::onReportBug( wxCommandEvent& event )
|
||||||
wxString url_string;
|
wxString url_string;
|
||||||
url_string.Printf( m_bugReportUrl, kcurl.Escape( message.ToStdString() ) );
|
url_string.Printf( m_bugReportUrl, kcurl.Escape( message.ToStdString() ) );
|
||||||
|
|
||||||
wxLaunchDefaultApplication( url_string );
|
LaunchURL( url_string );
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,3 +40,17 @@ void LaunchExternal( const wxString& aPath )
|
||||||
wxLaunchDefaultApplication( path );
|
wxLaunchDefaultApplication( path );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LaunchURL( const wxString& aUrl )
|
||||||
|
{
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
wxString msg;
|
||||||
|
|
||||||
|
msg.Printf( "open %s", aUrl );
|
||||||
|
|
||||||
|
system( msg.c_str() );
|
||||||
|
#else
|
||||||
|
wxLaunchDefaultApplication( aUrl );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
|
@ -29,4 +29,10 @@ class wxString;
|
||||||
*/
|
*/
|
||||||
void LaunchExternal( const wxString& aPath );
|
void LaunchExternal( const wxString& aPath );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempts to launch a given URL in the user's browser
|
||||||
|
* @param aUrl is a valid URL (already escaped)
|
||||||
|
*/
|
||||||
|
void LaunchURL( const wxString& aUrl );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue