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.
This commit is contained in:
Wayne Stambaugh 2014-08-13 15:26:31 -04:00
parent c8d69f19c8
commit c63459653a
5 changed files with 56 additions and 80 deletions

View File

@ -68,17 +68,14 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, EDA_BASE_FRAME )
EVT_MENU( wxID_EXIT, CVPCB_MAINFRAME::OnQuit )
EVT_MENU( wxID_HELP, CVPCB_MAINFRAME::GetKicadHelp )
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_AS, CVPCB_MAINFRAME::SaveProjectFile )
EVT_MENU( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, CVPCB_MAINFRAME::OnKeepOpenOnSave )
EVT_MENU( ID_CVPCB_LIB_TABLE_EDIT, CVPCB_MAINFRAME::OnEditFootprintLibraryTable )
// Toolbar events
EVT_TOOL( ID_CVPCB_QUIT, CVPCB_MAINFRAME::OnQuit )
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_GOTO_FIRSTNA, CVPCB_MAINFRAME::ToFirstNA )
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 )
{
bool tableChanged = false;
@ -487,8 +472,8 @@ void CVPCB_MAINFRAME::OnEditFootprintLibraryTable( wxCommandEvent& aEvent )
}
catch( const IO_ERROR& ioe )
{
wxString msg = wxString::Format( _(
"Error occurred saving the global footprint library table:\n'%s'\n%s" ),
wxString msg = wxString::Format(
_( "Error occurred saving the global footprint library table:\n'%s'\n%s" ),
GetChars( fileName ),
GetChars( ioe.errorText )
);
@ -507,8 +492,8 @@ void CVPCB_MAINFRAME::OnEditFootprintLibraryTable( wxCommandEvent& aEvent )
}
catch( const IO_ERROR& ioe )
{
wxString msg = wxString::Format( _(
"Error occurred saving the project footprint library table:\n'%s'\n%s" ),
wxString msg = wxString::Format(
_( "Error occurred saving the project footprint library table:\n'%s'\n%s" ),
GetChars( fileName ),
GetChars( ioe.errorText )
);

View File

@ -18,7 +18,6 @@ enum id_cvpcb_frm
ID_CVPCB_QUIT = ID_END_LIST,
ID_CVPCB_READ_INPUT_NETLIST,
ID_CVPCB_SAVEQUITCVPCB,
ID_CVPCB_CREATE_CONFIGWINDOW,
ID_CVPCB_CREATE_SCREENCMP,
ID_CVPCB_GOTO_FIRSTNA,
ID_CVPCB_GOTO_PREVIOUSNA,

View File

@ -135,8 +135,6 @@ public:
*/
void LoadNetList( wxCommandEvent& event );
void ConfigCvpcb( wxCommandEvent& event );
/**
* Function OnEditLibraryTable
* envokes the footpirnt library table edit dialog.

View File

@ -52,13 +52,12 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
m_mainToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString,
KiBitmap( open_document_xpm ), LOAD_FILE_HELP );
m_mainToolBar->AddTool( wxID_SAVE, wxEmptyString, KiBitmap( save_xpm ),
SAVE_HLP_MSG );
m_mainToolBar->AddTool( wxID_SAVE, wxEmptyString, KiBitmap( save_xpm ), SAVE_HLP_MSG );
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString,
m_mainToolBar->AddTool( ID_CVPCB_LIB_TABLE_EDIT, wxEmptyString,
KiBitmap( config_xpm ),
_( "Set CvPcb config (paths and equ files)" ) );
_( "Edit footprint library table" ) );
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString,

View File

@ -121,11 +121,7 @@ wxString DRC_ITEM::GetErrorText() const
return wxString( _( "Pad inside a text" ) );
default:
{
wxString msg;
msg.Printf( wxT( "Unknown DRC error code %d" ), m_ErrorCode );
return ( msg );
}
return wxString::Format( wxT( "Unknown DRC error code %d" ), m_ErrorCode );
}
}
@ -137,4 +133,3 @@ wxString DRC_ITEM::ShowCoord( const wxPoint& aPos )
ret << aPos;
return ret;
}