PCB updater: open PCBnew automagically, minor fixes to the dialog

This commit is contained in:
Tomasz Wlostowski 2016-01-29 11:36:51 +01:00 committed by Maciej Suminski
parent 570ba5e00a
commit 689072c0e1
3 changed files with 34 additions and 1 deletions

View File

@ -431,7 +431,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
wxMenuItem* updItem = AddMenuItem( toolsMenu,
ID_UPDATE_PCB_FROM_SCH,
text, _( "Updates the PCB design with the current schematic." ),
text, _( "Updates the PCB design with the current schematic (forward annotation)." ),
KiBitmap( libedit_xpm ) );
KIWAY_PLAYER* pcbFrame = Kiway().Player( FRAME_PCB, false ); // test open already.

View File

@ -823,6 +823,36 @@ void SCH_EDIT_FRAME::OnErc( wxCommandEvent& event )
void SCH_EDIT_FRAME::OnUpdatePCB( wxCommandEvent& event )
{
wxFileName fn = Prj().AbsolutePath( g_RootSheet->GetScreen()->GetFileName() );
fn.SetExt( PcbFileExtension );
if( Kiface().IsSingle() )
{
DisplayError( this, _( "Cannot update the PCB, because the Schematic Editor is"
" opened in stand-alone mode. In order to create/update"
" PCBs from schematics, you need to launch Kicad shell"
" and create a PCB project." ) );
return;
} else {
KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB, true );
// a pcb frame can be already existing, but not yet used.
// this is the case when running the footprint editor, or the footprint viewer first
// if the frame is not visible, the board is not yet loaded
if( !frame->IsVisible() )
{
frame->OpenProjectFiles( std::vector<wxString>( 1, fn.GetFullPath() ) );
frame->Show( true );
}
// On Windows, Raise() does not bring the window on screen, when iconized
if( frame->IsIconized() )
frame->Iconize( false );
frame->Raise();
}
NETLIST_OBJECT_LIST* net_atoms = BuildNetListBase();
NETLIST_EXPORTER_KICAD exporter( net_atoms, Prj().SchLibs() );
STRING_FORMATTER formatter;

View File

@ -104,6 +104,9 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun )
m_frame->SetMsgPanel( board );
m_btnPerformUpdate->Enable( false );
m_btnPerformUpdate->SetLabel( _( "Update complete" ) );
m_btnCancel->SetFocus();
}
void DIALOG_UPDATE_PCB::OnMatchChange( wxCommandEvent& event )