Commit ab468e20 authored by charras's avatar charras
Browse files

Cvpcb relative paths patch

parent 0bf4b5ae
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -267,6 +267,20 @@ void DIALOG_CVPCB_CONFIG::OnAddOrInsertPath( wxCommandEvent& event )
            if( jj >= 0 )
                ipos = jj;
        }

        // Ask the user if this is a relative path
        int diag = wxMessageBox(
            _( "Use a relative path?" ),
            _( "Path type" ),
            wxYES_NO | wxICON_QUESTION, this );

        if( diag == wxYES )
        {   // Make it relative
            wxFileName fn = path;
            fn.MakeRelativeTo( wxT(".") );
            path = fn.GetPathWithSep() + fn.GetFullName();
        }

        m_listUserPaths->Insert( path, ipos );
        m_LibPathChanged = true;
        wxGetApp().InsertLibraryPath( path, ipos + 1 );