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

map class CPolyLine (used in zones) in Python.

parent 9f6d1d0e
Loading
Loading
Loading
Loading
+9 −10
Original line number Original line Diff line number Diff line
@@ -176,21 +176,20 @@ void DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked( wxCommandEvent& even


    wxFileName      dirName = wxFileName::DirName( dirDialog.GetPath() );
    wxFileName      dirName = wxFileName::DirName( dirDialog.GetPath() );


    wxMessageDialog dialog( this, _( "Use a relative path? " ),
    fn = Prj().AbsolutePath( g_RootSheet->GetFileName() );
                            _( "Plot Output Directory" ),
    wxString defaultPath = fn.GetPathWithSep();
    wxString msg;
    msg.Printf( _( "Do you want to use a path relative to\n'%s'" ),
                GetChars( defaultPath ) );

    wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ),
                            wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
                            wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );


    // relative directory selected
    // relative directory selected
    if( dialog.ShowModal() == wxID_YES )
    if( dialog.ShowModal() == wxID_YES )
    {
    {

        if( !dirName.MakeRelativeTo( defaultPath ) )
        wxString plotFilePath = g_RootSheet->GetFileName();
            wxMessageBox( _( "Cannot make path relative (target volume different from file volume)!" ),

        plotFilePath = Prj().AbsolutePath(plotFilePath);
        plotFilePath = wxPathOnly( plotFilePath );

        if( !dirName.MakeRelativeTo( plotFilePath ) )
            wxMessageBox( _( "Cannot make path relative (target volume different from board file volume)!" ),
                          _( "Plot Output Directory" ), wxOK | wxICON_ERROR );
                          _( "Plot Output Directory" ), wxOK | wxICON_ERROR );
    }
    }


+9 −8
Original line number Original line Diff line number Diff line
@@ -315,18 +315,19 @@ void DIALOG_PLOT::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )


    wxFileName      dirName = wxFileName::DirName( dirDialog.GetPath() );
    wxFileName      dirName = wxFileName::DirName( dirDialog.GetPath() );


    wxMessageDialog dialog( this, _( "Use a relative path? " ),
    fn = Prj().AbsolutePath( m_parent->GetBoard()->GetFileName() );
                            _( "Plot Output Directory" ),
    wxString defaultPath = fn.GetPathWithSep();
    wxString msg;
    msg.Printf( _( "Do you want to use a path relative to\n'%s'" ),
                   GetChars( defaultPath ) );

    wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ),
                            wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
                            wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );


    if( dialog.ShowModal() == wxID_YES )
    if( dialog.ShowModal() == wxID_YES )
    {
    {
        wxString boardFilePath = Prj().AbsolutePath( m_parent->GetBoard()->GetFileName() );
        if( !dirName.MakeRelativeTo( defaultPath ) )

            wxMessageBox( _( "Cannot make path relative (target volume different from file volume)!" ),
        boardFilePath = wxPathOnly( boardFilePath );

        if( !dirName.MakeRelativeTo( boardFilePath ) )
            wxMessageBox( _( "Cannot make path relative (target volume different from board file volume)!" ),
                          _( "Plot Output Directory" ), wxOK | wxICON_ERROR );
                          _( "Plot Output Directory" ), wxOK | wxICON_ERROR );
    }
    }


+4 −0
Original line number Original line Diff line number Diff line
@@ -115,6 +115,10 @@
/* KiCad plugin handling */
/* KiCad plugin handling */
%include "kicadplugins.i"
%include "kicadplugins.i"


// map CPolyLine and classes used in CPolyLine:
#include <../polygon/PolyLine.h>
%include <../polygon/PolyLine.h>

// ignore warning relative to operator = and operator ++:
// ignore warning relative to operator = and operator ++:
#pragma SWIG nowarn=362,383
#pragma SWIG nowarn=362,383