Workaround wxWidgets inability to find the default PDF viewer.
Fixes: lp:1843061
* https://bugs.launchpad.net/kicad/+bug/1843061
(cherry picked from commit d55f4d05b4
)
This commit is contained in:
parent
d5275b16aa
commit
75bb864237
|
@ -347,27 +347,27 @@ bool OpenPDF( const wxString& file )
|
||||||
wxString command;
|
wxString command;
|
||||||
wxString filename = file;
|
wxString filename = file;
|
||||||
|
|
||||||
// Quote in case there are spaces in the file name.
|
|
||||||
AddDelimiterString( filename );
|
|
||||||
|
|
||||||
Pgm().ReadPdfBrowserInfos();
|
Pgm().ReadPdfBrowserInfos();
|
||||||
|
|
||||||
if( !Pgm().UseSystemPdfBrowser() ) // Run the preferred PDF Browser
|
if( !Pgm().UseSystemPdfBrowser() ) // Run the preferred PDF Browser
|
||||||
{
|
{
|
||||||
command = Pgm().GetPdfBrowserName() + wxT( " " ) + filename;
|
command = Pgm().GetPdfBrowserName() + wxT( " '" ) + filename + wxT( "'" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( wxLaunchDefaultApplication( filename ) )
|
if( wxLaunchDefaultApplication( filename ) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
command = wxT( "/usr/bin/open -a '" ) + filename + wxT( "'" );
|
||||||
|
#endif
|
||||||
// If launching the system default PDF viewer fails, fall through with empty command
|
// If launching the system default PDF viewer fails, fall through with empty command
|
||||||
// string so the error message is displayed.
|
// string so the error message is displayed.
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !command.IsEmpty() )
|
if( !command.IsEmpty() )
|
||||||
{
|
{
|
||||||
if( ProcessExecute( command ) )
|
if( ProcessExecute( command ) != -1 )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue