Retire disabled buttons in favour of info boxes.

Fixes https://gitlab.com/kicad/code/kicad/issues/7229
This commit is contained in:
Jeff Young 2021-02-01 18:00:11 +00:00
parent eba98aa9f6
commit 1394c1f4d4
4 changed files with 13 additions and 4 deletions

View File

@ -38,7 +38,6 @@ FOOTPRINT_SELECT_WIDGET::FOOTPRINT_SELECT_WIDGET( EDA_DRAW_FRAME* aFrame, wxWind
m_kiway( nullptr ),
m_update( aUpdate ),
m_max_items( aMaxItems ),
m_last_item( 0 ),
m_fp_list( aFpList )
{
m_zero_filter = true;

View File

@ -131,7 +131,6 @@ private:
bool m_update;
int m_max_items;
wxString m_default_footprint;
int m_last_item;
FOOTPRINT_LIST* m_fp_list;
FOOTPRINT_FILTER m_fp_filter;

View File

@ -227,8 +227,6 @@ void KICAD_MANAGER_FRAME::setupUIConditions()
ACTION_CONDITIONS activeProjectCond;
activeProjectCond.Enable( activeProject );
manager->SetConditions( KICAD_MANAGER_ACTIONS::editSchematic, activeProjectCond );
manager->SetConditions( KICAD_MANAGER_ACTIONS::editPCB, activeProjectCond );
manager->SetConditions( ACTIONS::saveAs, activeProjectCond );
manager->SetConditions( KICAD_MANAGER_ACTIONS::closeProject, activeProjectCond );

View File

@ -596,6 +596,19 @@ int KICAD_MANAGER_CONTROL::ShowPlayer( const TOOL_EVENT& aEvent )
FRAME_T playerType = aEvent.Parameter<FRAME_T>();
KIWAY_PLAYER* player;
if( playerType == FRAME_SCH && !m_frame->IsProjectActive() )
{
DisplayInfoMessage( m_frame, _( "Create (or open) a project to edit a schematic." ),
wxEmptyString );
return -1;
}
else if( playerType == FRAME_PCB_EDITOR && !m_frame->IsProjectActive() )
{
DisplayInfoMessage( m_frame, _( "Create (or open) a project to edit a pcb." ),
wxEmptyString );
return -1;
}
// Prevent multiple KIWAY_PLAYER loading at one time
if( !m_loading.try_lock() )
return -1;