Pcbnew: Try to fix MacOSX crash when loading a file at start time by removing a useless call to wxSafeYield() in load file function.
Eeschema: Calling Viewlib to load a component uses now MakeModal() instead of wxFRAME_FLOAT_ON_PARENT (better behavior, like a dialog).
This commit is contained in:
commit
ea7dfc355b
|
@ -70,6 +70,7 @@ static void abortMoveComponent( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
|
|||
wxString SCH_EDIT_FRAME::SelectFromLibBrowser( void )
|
||||
{
|
||||
wxSemaphore semaphore( 0, 1 );
|
||||
wxString cmpname;
|
||||
|
||||
/* Close the current Lib browser, if open, and open a new one, in "modal" mode */
|
||||
if( m_ViewlibFrame )
|
||||
|
@ -80,7 +81,6 @@ wxString SCH_EDIT_FRAME::SelectFromLibBrowser( void )
|
|||
|
||||
m_ViewlibFrame = new LIB_VIEW_FRAME( this, NULL, &semaphore );
|
||||
m_ViewlibFrame->AdjustScrollBars( wxPoint( 0 , 0 ) );
|
||||
|
||||
// Show the library viewer frame until it is closed
|
||||
while( semaphore.TryWait() == wxSEMA_BUSY ) // Wait for viewer closing event
|
||||
{
|
||||
|
@ -88,7 +88,10 @@ wxString SCH_EDIT_FRAME::SelectFromLibBrowser( void )
|
|||
wxMilliSleep( 50 );
|
||||
}
|
||||
|
||||
return m_ViewlibFrame->GetSelectedComponent();
|
||||
cmpname = m_ViewlibFrame->GetSelectedComponent();
|
||||
m_ViewlibFrame->Destroy();
|
||||
|
||||
return cmpname;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
|
|||
m_exportToEeschemaCmpName.Empty();
|
||||
|
||||
if( m_Semaphore )
|
||||
SetWindowStyle( GetWindowStyle() | wxFRAME_FLOAT_ON_PARENT );
|
||||
MakeModal(true);
|
||||
|
||||
SetScreen( new SCH_SCREEN() );
|
||||
GetScreen()->m_Center = true; // Center coordinate origins on screen.
|
||||
|
@ -247,20 +247,16 @@ void LIB_VIEW_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
|||
{
|
||||
SaveSettings();
|
||||
|
||||
if( m_Semaphore )
|
||||
m_Semaphore->Post();
|
||||
|
||||
Destroy();
|
||||
|
||||
if( m_Semaphore )
|
||||
{
|
||||
// Raise EESchema above all other windows when the library viewer is being used
|
||||
// to select a component.
|
||||
wxWindow* parent = GetParent();
|
||||
|
||||
if( parent )
|
||||
parent->Raise();
|
||||
m_Semaphore->Post();
|
||||
MakeModal(false);
|
||||
// This window will be destroyed by the calling function,
|
||||
// to avoid side effects
|
||||
}
|
||||
|
||||
else
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -281,9 +281,9 @@ this file again." ) );
|
|||
|
||||
// Display the loaded board:
|
||||
Zoom_Automatique( false );
|
||||
wxSafeYield(); // Needed if we want to see the board now.
|
||||
|
||||
// Compile ratsnest and displays net info
|
||||
wxBusyCursor dummy; // Displays an Hourglass while building connectivity
|
||||
Compile_Ratsnest( NULL, true );
|
||||
GetBoard()->DisplayInfo( this );
|
||||
|
||||
|
|
Loading…
Reference in New Issue