Commit c6345965 authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

CvPcb: fix broken event ID for configuration button on toolbar.

* Remap configuration button on toolbar to launch footprint library table
  editor.
* Remove legacy footprint library path dialog from CVPCB_MAINFRAME.
* Remove unused event ID ID_CVPCB_CREATE_CONFIGWINDOW.
* Minor coding policy fixes.
parent c8d69f19
Loading
Loading
Loading
Loading
+20 −35
Original line number Original line Diff line number Diff line
@@ -68,17 +68,14 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, EDA_BASE_FRAME )
    EVT_MENU( wxID_EXIT, CVPCB_MAINFRAME::OnQuit )
    EVT_MENU( wxID_EXIT, CVPCB_MAINFRAME::OnQuit )
    EVT_MENU( wxID_HELP, CVPCB_MAINFRAME::GetKicadHelp )
    EVT_MENU( wxID_HELP, CVPCB_MAINFRAME::GetKicadHelp )
    EVT_MENU( wxID_ABOUT, CVPCB_MAINFRAME::GetKicadAbout )
    EVT_MENU( wxID_ABOUT, CVPCB_MAINFRAME::GetKicadAbout )
    EVT_MENU( wxID_PREFERENCES, CVPCB_MAINFRAME::ConfigCvpcb )
    EVT_MENU( ID_SAVE_PROJECT, CVPCB_MAINFRAME::SaveProjectFile )
    EVT_MENU( ID_SAVE_PROJECT, CVPCB_MAINFRAME::SaveProjectFile )
    EVT_MENU( ID_SAVE_PROJECT_AS, CVPCB_MAINFRAME::SaveProjectFile )
    EVT_MENU( ID_SAVE_PROJECT_AS, CVPCB_MAINFRAME::SaveProjectFile )
    EVT_MENU( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, CVPCB_MAINFRAME::OnKeepOpenOnSave )
    EVT_MENU( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, CVPCB_MAINFRAME::OnKeepOpenOnSave )


    EVT_MENU( ID_CVPCB_LIB_TABLE_EDIT, CVPCB_MAINFRAME::OnEditFootprintLibraryTable )

    // Toolbar events
    // Toolbar events
    EVT_TOOL( ID_CVPCB_QUIT, CVPCB_MAINFRAME::OnQuit )
    EVT_TOOL( ID_CVPCB_QUIT, CVPCB_MAINFRAME::OnQuit )
    EVT_TOOL( ID_CVPCB_READ_INPUT_NETLIST, CVPCB_MAINFRAME::LoadNetList )
    EVT_TOOL( ID_CVPCB_READ_INPUT_NETLIST, CVPCB_MAINFRAME::LoadNetList )
    EVT_TOOL( ID_CVPCB_CREATE_CONFIGWINDOW, CVPCB_MAINFRAME::ConfigCvpcb )
    EVT_TOOL( ID_CVPCB_LIB_TABLE_EDIT, CVPCB_MAINFRAME::OnEditFootprintLibraryTable )
    EVT_TOOL( ID_CVPCB_CREATE_SCREENCMP, CVPCB_MAINFRAME::DisplayModule )
    EVT_TOOL( ID_CVPCB_CREATE_SCREENCMP, CVPCB_MAINFRAME::DisplayModule )
    EVT_TOOL( ID_CVPCB_GOTO_FIRSTNA, CVPCB_MAINFRAME::ToFirstNA )
    EVT_TOOL( ID_CVPCB_GOTO_FIRSTNA, CVPCB_MAINFRAME::ToFirstNA )
    EVT_TOOL( ID_CVPCB_GOTO_PREVIOUSNA, CVPCB_MAINFRAME::ToPreviousNA )
    EVT_TOOL( ID_CVPCB_GOTO_PREVIOUSNA, CVPCB_MAINFRAME::ToPreviousNA )
@@ -459,18 +456,6 @@ bool CVPCB_MAINFRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, i
}
}




void CVPCB_MAINFRAME::ConfigCvpcb( wxCommandEvent& event )
{
    /*  This is showing FOOTPRINT search paths, which are obsoleted.
        I am removing this for the time being, since cvpcb will soon be part of pcbnew.

    DIALOG_CVPCB_CONFIG     dlg( this );

    dlg.ShowModal();
    */
}


void CVPCB_MAINFRAME::OnEditFootprintLibraryTable( wxCommandEvent& aEvent )
void CVPCB_MAINFRAME::OnEditFootprintLibraryTable( wxCommandEvent& aEvent )
{
{
    bool    tableChanged = false;
    bool    tableChanged = false;
@@ -487,8 +472,8 @@ void CVPCB_MAINFRAME::OnEditFootprintLibraryTable( wxCommandEvent& aEvent )
        }
        }
        catch( const IO_ERROR& ioe )
        catch( const IO_ERROR& ioe )
        {
        {
            wxString msg = wxString::Format( _(
            wxString msg = wxString::Format(
                    "Error occurred saving the global footprint library table:\n'%s'\n%s" ),
                    _( "Error occurred saving the global footprint library table:\n'%s'\n%s" ),
                    GetChars( fileName ),
                    GetChars( fileName ),
                    GetChars( ioe.errorText )
                    GetChars( ioe.errorText )
                    );
                    );
@@ -507,8 +492,8 @@ void CVPCB_MAINFRAME::OnEditFootprintLibraryTable( wxCommandEvent& aEvent )
        }
        }
        catch( const IO_ERROR& ioe )
        catch( const IO_ERROR& ioe )
        {
        {
            wxString msg = wxString::Format( _(
            wxString msg = wxString::Format(
                    "Error occurred saving the project footprint library table:\n'%s'\n%s" ),
                    _( "Error occurred saving the project footprint library table:\n'%s'\n%s" ),
                    GetChars( fileName ),
                    GetChars( fileName ),
                    GetChars( ioe.errorText )
                    GetChars( ioe.errorText )
                    );
                    );
+0 −1
Original line number Original line Diff line number Diff line
@@ -18,7 +18,6 @@ enum id_cvpcb_frm
    ID_CVPCB_QUIT = ID_END_LIST,
    ID_CVPCB_QUIT = ID_END_LIST,
    ID_CVPCB_READ_INPUT_NETLIST,
    ID_CVPCB_READ_INPUT_NETLIST,
    ID_CVPCB_SAVEQUITCVPCB,
    ID_CVPCB_SAVEQUITCVPCB,
    ID_CVPCB_CREATE_CONFIGWINDOW,
    ID_CVPCB_CREATE_SCREENCMP,
    ID_CVPCB_CREATE_SCREENCMP,
    ID_CVPCB_GOTO_FIRSTNA,
    ID_CVPCB_GOTO_FIRSTNA,
    ID_CVPCB_GOTO_PREVIOUSNA,
    ID_CVPCB_GOTO_PREVIOUSNA,
+0 −2
Original line number Original line Diff line number Diff line
@@ -135,8 +135,6 @@ public:
     */
     */
    void             LoadNetList( wxCommandEvent& event );
    void             LoadNetList( wxCommandEvent& event );


    void             ConfigCvpcb( wxCommandEvent& event );

    /**
    /**
     * Function OnEditLibraryTable
     * Function OnEditLibraryTable
     * envokes the footpirnt library table edit dialog.
     * envokes the footpirnt library table edit dialog.
+3 −4
Original line number Original line Diff line number Diff line
@@ -52,13 +52,12 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
    m_mainToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString,
    m_mainToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString,
                            KiBitmap( open_document_xpm ), LOAD_FILE_HELP );
                            KiBitmap( open_document_xpm ), LOAD_FILE_HELP );


    m_mainToolBar->AddTool( wxID_SAVE, wxEmptyString, KiBitmap( save_xpm ),
    m_mainToolBar->AddTool( wxID_SAVE, wxEmptyString, KiBitmap( save_xpm ), SAVE_HLP_MSG );
                            SAVE_HLP_MSG );


    m_mainToolBar->AddSeparator();
    m_mainToolBar->AddSeparator();
    m_mainToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString,
    m_mainToolBar->AddTool( ID_CVPCB_LIB_TABLE_EDIT, wxEmptyString,
                            KiBitmap( config_xpm ),
                            KiBitmap( config_xpm ),
                            _( "Set CvPcb config (paths and equ files)" ) );
                            _( "Edit footprint library table" ) );


    m_mainToolBar->AddSeparator();
    m_mainToolBar->AddSeparator();
    m_mainToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString,
    m_mainToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString,
+33 −38
Original line number Original line Diff line number Diff line
@@ -121,11 +121,7 @@ wxString DRC_ITEM::GetErrorText() const
        return wxString( _( "Pad inside a text" ) );
        return wxString( _( "Pad inside a text" ) );


    default:
    default:
        {
        return wxString::Format( wxT( "Unknown DRC error code %d" ), m_ErrorCode );
            wxString msg;
            msg.Printf( wxT( "Unknown DRC error code %d" ), m_ErrorCode );
            return ( msg );
        }
    }
    }
}
}


@@ -137,4 +133,3 @@ wxString DRC_ITEM::ShowCoord( const wxPoint& aPos )
    ret << aPos;
    ret << aPos;
    return ret;
    return ret;
}
}