Browse Source

Eeschema: fix a minor bug: the board editor was not launched from the toolbar, if the footprint viewer or the footprint editor was previously run from Eeschema.

pull/5/head
jean-pierre charras 11 years ago
parent
commit
35fe8b7a36
  1. 19
      eeschema/schframe.cpp
  2. 14
      kicad/mainframe.cpp

19
eeschema/schframe.cpp

@ -972,15 +972,22 @@ void SCH_EDIT_FRAME::OnOpenPcbnew( wxCommandEvent& event )
}
else
{
KIWAY_PLAYER* player = Kiway().Player( FRAME_PCB, false ); // test open already.
KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB, true );
if( !player )
// 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() )
{
player = Kiway().Player( FRAME_PCB, true );
player->OpenProjectFiles( std::vector<wxString>( 1, fn.GetFullPath() ) );
player->Show( true );
frame->OpenProjectFiles( std::vector<wxString>( 1, fn.GetFullPath() ) );
frame->Show( true );
}
player->Raise();
// On Windows, Raise() does not bring the window on screen, when iconized
if( frame->IsIconized() )
frame->Iconize( false );
frame->Raise();
}
}
else

14
kicad/mainframe.cpp

@ -340,25 +340,17 @@ void KICAD_MANAGER_FRAME::OnRunSchLibEditor( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::RunPcbNew( const wxString& aProjectBoardFileName )
{
#if 0 // line 171 of modview_frame.cpp breaks this code
KIWAY_PLAYER* frame = Kiway.Player( FRAME_PCB, false );
if( !frame )
{
frame = Kiway.Player( FRAME_PCB, true );
frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectBoardFileName ) );
frame->Show( true );
}
#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, aProjectBoardFileName ) );
frame->Show( true );
}
#endif
// On Windows, Raise() does not bring the window on screen, when iconized
if( frame->IsIconized() )
frame->Iconize( false );

Loading…
Cancel
Save