Commit 71c4f49d authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Kicad manager: fix Bug #1385953 (unable to open .PDF files with spaces in...

Kicad manager: fix Bug #1385953 (unable to open .PDF files with spaces in name/path when using default PDF browser).
Fix also an issue when selecting preferred browser.
parent e273a48d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@
#include <cvstruct.h>
#include <wildcards_and_files_ext.h>

#define titleComponentLibErr _( "Component Library Error" )

void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
{
+0 −8
Original line number Diff line number Diff line
@@ -116,14 +116,7 @@ bool TREEPROJECT_ITEM::Rename( const wxString& name, bool check )
            return false;
    }

#if ( ( wxMAJOR_VERSION < 2 ) || ( ( wxMAJOR_VERSION == 2 ) \
    && ( wxMINOR_VERSION < 7 )  ) )

    if( !wxRenameFile( GetFileName(), newFile ) )
#else

    if( !wxRenameFile( GetFileName(), newFile, false ) )
#endif
    {
        wxMessageDialog( m_parent, _( "Unable to rename file ... " ),
                         _( "Permission error ?" ), wxICON_ERROR | wxOK );
@@ -225,7 +218,6 @@ void TREEPROJECT_ITEM::Activate( TREE_PROJECT_FRAME* prjframe )
        break;

    case TREE_PDF:
        AddDelimiterString( fullFileName );
        OpenPDF( fullFileName );
        break;

+3 −6
Original line number Diff line number Diff line
@@ -516,15 +516,12 @@ void KICAD_MANAGER_FRAME::SaveSettings( wxConfigBase* aCfg )

/**
 * a minor helper function:
 * Prints the Current Working Dir name and the projet name on the text panel.
 * Prints the Current Project full name on the text panel.
 */
void KICAD_MANAGER_FRAME::PrintPrjInfo()
{
    wxString msg = wxString::Format( _(
            "Working dir: %s\nProject: %s\n" ),
            GetChars( wxGetCwd() ),
            GetChars( GetProjectFileName() )
            );
    wxString msg = wxString::Format( _( "Project name:\n%s\n" ),
                        GetChars( GetProjectFileName() ) );
    PrintMsg( msg );
}
+21 −15
Original line number Diff line number Diff line
@@ -58,14 +58,17 @@ void KICAD_MANAGER_FRAME::OnUpdatePreferredPdfBrowser( wxUpdateUIEvent& event )

void KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
{
    bool select = event.GetId() == ID_SELECT_PREFERED_PDF_BROWSER_NAME;
    bool setPdfBrowserName = event.GetId() == ID_SELECT_PREFERED_PDF_BROWSER_NAME;

    if( !Pgm().GetPdfBrowserName() && !select )
    if( !Pgm().GetPdfBrowserName() && !setPdfBrowserName )
    {
        DisplayError( this,
                      _( "You must choose a PDF viewer before using this option." ) );
        setPdfBrowserName = true;
    }

    if( setPdfBrowserName )
    {
        wxString mask( wxT( "*" ) );

    #ifdef __WINDOWS__
@@ -85,6 +88,9 @@ void KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
            return;

        Pgm().SetPdfBrowserName( dlg.GetPath() );
    }

    Pgm().ForceSystemPdfBrowser( false );
    Pgm().WritePdfBrowserInfos();
}