Disable commands in SingleTop

We cannot do forward/reverse annotation in Single Top mode because we
depend on shared memory access.  This disables the menu options in this
case and replaces the toolbar update pcb icon with the import netlist,
which is more appropriate for single top mode

Fixes https://gitlab.com/kicad/code/kicad/issues/7637
This commit is contained in:
Seth Hillbrand 2021-02-22 14:45:29 -08:00
parent d3cf97847e
commit b484c0787b
3 changed files with 20 additions and 5 deletions

View File

@ -236,8 +236,11 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// //
ACTION_MENU* toolsMenu = new ACTION_MENU( false, selTool ); ACTION_MENU* toolsMenu = new ACTION_MENU( false, selTool );
toolsMenu->Add( ACTIONS::updatePcbFromSchematic ); wxMenuItem* update = toolsMenu->Add( ACTIONS::updatePcbFromSchematic );
toolsMenu->Add( ACTIONS::updateSchematicFromPcb ); update->Enable( !Kiface().IsSingle() );
update = toolsMenu->Add( ACTIONS::updateSchematicFromPcb );
update->Enable( !Kiface().IsSingle() );
toolsMenu->Add( EE_ACTIONS::showPcbNew ); toolsMenu->Add( EE_ACTIONS::showPcbNew );
toolsMenu->AppendSeparator(); toolsMenu->AppendSeparator();

View File

@ -377,7 +377,9 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// //
ACTION_MENU* toolsMenu = new ACTION_MENU( false, selTool ); ACTION_MENU* toolsMenu = new ACTION_MENU( false, selTool );
toolsMenu->Add( ACTIONS::updatePcbFromSchematic ); wxMenuItem* update = toolsMenu->Add( ACTIONS::updatePcbFromSchematic );
update->Enable( !Kiface().IsSingle() );
toolsMenu->Add( PCB_ACTIONS::showEeschema ); toolsMenu->Add( PCB_ACTIONS::showEeschema );
toolsMenu->AppendSeparator(); toolsMenu->AppendSeparator();
@ -392,7 +394,9 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
toolsMenu->AppendSeparator(); toolsMenu->AppendSeparator();
toolsMenu->Add( PCB_ACTIONS::boardReannotate ); toolsMenu->Add( PCB_ACTIONS::boardReannotate );
toolsMenu->Add( ACTIONS::updateSchematicFromPcb ); update = toolsMenu->Add( ACTIONS::updateSchematicFromPcb );
update->Enable( !Kiface().IsSingle() );
#if defined(KICAD_SCRIPTING_WXPYTHON) #if defined(KICAD_SCRIPTING_WXPYTHON)
toolsMenu->AppendSeparator(); toolsMenu->AppendSeparator();

View File

@ -269,7 +269,15 @@ void PCB_EDIT_FRAME::ReCreateHToolbar()
m_mainToolBar->Add( ACTIONS::showFootprintBrowser ); m_mainToolBar->Add( ACTIONS::showFootprintBrowser );
m_mainToolBar->AddScaledSeparator( this ); m_mainToolBar->AddScaledSeparator( this );
m_mainToolBar->Add( ACTIONS::updatePcbFromSchematic ); if( !Kiface().IsSingle() )
{
m_mainToolBar->Add( ACTIONS::updatePcbFromSchematic );
}
else
{
m_mainToolBar->Add( PCB_ACTIONS::importNetlist );
}
m_mainToolBar->Add( PCB_ACTIONS::runDRC ); m_mainToolBar->Add( PCB_ACTIONS::runDRC );
m_mainToolBar->AddScaledSeparator( this ); m_mainToolBar->AddScaledSeparator( this );