KiCad PCB EDA Suite
launch_ext.h File Reference

Go to the source code of this file.

Functions

void LaunchExternal (const wxString &aPath)
 Launches the given file or folder in the host OS. More...
 
void LaunchURL (const wxString &aUrl)
 Attempts to launch a given URL in the user's browser. More...
 

Function Documentation

◆ LaunchExternal()

void LaunchExternal ( const wxString &  aPath)

Launches the given file or folder in the host OS.

Parameters
aPathis a path to a file or folder

Definition at line 26 of file launch_ext.cpp.

27 {
28 #ifdef __WXMAC__
29  wxString msg;
30 
31  // Quote in case there are spaces in the path.
32  msg.Printf( "open \"%s\"", aPath );
33 
34  system( msg.c_str() );
35 #else
36  wxString path( aPath );
37  // Quote in case there are spaces in the path.
38  AddDelimiterString( path );
39 
40  wxLaunchDefaultApplication( path );
41 #endif
42 }
void AddDelimiterString(wxString &string)
Function AddDelimiterString Add un " to the start and the end of string (if not already done).
Definition: gestfich.cpp:42

References AddDelimiterString().

Referenced by KICAD_MANAGER_FRAME::OnBrowseInFileExplorer(), and PANEL_COLOR_SETTINGS::OnBtnOpenThemeFolderClicked().

◆ LaunchURL()

void LaunchURL ( const wxString &  aUrl)

Attempts to launch a given URL in the user's browser.

Parameters
aUrlis a valid URL (already escaped)

Definition at line 45 of file launch_ext.cpp.

46 {
47 #ifdef __WXMAC__
48  wxString msg;
49 
50  msg.Printf( "open %s", aUrl );
51 
52  system( msg.c_str() );
53 #else
54  wxLaunchDefaultApplication( aUrl );
55 #endif
56 }