Move the import graphics menu item to the action

This commit is contained in:
Ian McInerney 2021-03-27 19:04:16 +00:00
parent 7bfa8575fa
commit 9535153f9e
6 changed files with 12 additions and 31 deletions

View File

@ -102,8 +102,6 @@ BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME )
EVT_UPDATE_UI( ID_ADD_FOOTPRINT_TO_BOARD,
FOOTPRINT_EDIT_FRAME::OnUpdateSaveFootprintToBoard )
EVT_UPDATE_UI( ID_TOOLBARH_PCB_SELECT_LAYER, FOOTPRINT_EDIT_FRAME::OnUpdateLayerSelectBox )
EVT_UPDATE_UI( ID_GEN_IMPORT_GRAPHICS_FILE, FOOTPRINT_EDIT_FRAME::OnUpdateModuleSelected )
END_EVENT_TABLE()
@ -663,12 +661,6 @@ void FOOTPRINT_EDIT_FRAME::CloseFootprintEditor( wxCommandEvent& Event )
}
void FOOTPRINT_EDIT_FRAME::OnUpdateModuleSelected( wxUpdateUIEvent& aEvent )
{
aEvent.Enable( GetBoard()->GetFirstFootprint() != NULL );
}
void FOOTPRINT_EDIT_FRAME::OnUpdateLoadFootprintFromBoard( wxUpdateUIEvent& aEvent )
{
PCB_EDIT_FRAME* frame = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB_EDITOR, false );
@ -1043,14 +1035,15 @@ void FOOTPRINT_EDIT_FRAME::setupUIConditions()
return IsSearchTreeShown();
};
mgr->SetConditions( ACTIONS::highContrastMode, CHECK( highContrastCond ) );
mgr->SetConditions( PCB_ACTIONS::flipBoard, CHECK( boardFlippedCond ) );
mgr->SetConditions( PCB_ACTIONS::toggleFootprintTree, CHECK( footprintTreeCond ) );
mgr->SetConditions( ACTIONS::highContrastMode, CHECK( highContrastCond ) );
mgr->SetConditions( PCB_ACTIONS::flipBoard, CHECK( boardFlippedCond ) );
mgr->SetConditions( PCB_ACTIONS::toggleFootprintTree, CHECK( footprintTreeCond ) );
mgr->SetConditions( ACTIONS::print, ENABLE( haveFootprintCond ) );
mgr->SetConditions( PCB_ACTIONS::exportFootprint, ENABLE( haveFootprintCond ) );
mgr->SetConditions( PCB_ACTIONS::footprintProperties, ENABLE( haveFootprintCond ) );
mgr->SetConditions( PCB_ACTIONS::cleanupGraphics, ENABLE( haveFootprintCond ) );
mgr->SetConditions( ACTIONS::print, ENABLE( haveFootprintCond ) );
mgr->SetConditions( PCB_ACTIONS::exportFootprint, ENABLE( haveFootprintCond ) );
mgr->SetConditions( PCB_ACTIONS::footprintProperties, ENABLE( haveFootprintCond ) );
mgr->SetConditions( PCB_ACTIONS::cleanupGraphics, ENABLE( haveFootprintCond ) );
mgr->SetConditions( PCB_ACTIONS::placeImportedGraphics, ENABLE( haveFootprintCond ) );
// Only enable a tool if the part is edtable

View File

@ -144,7 +144,6 @@ public:
*/
bool SaveLibraryAs( const wxString& aLibraryPath );
void OnUpdateModuleSelected( wxUpdateUIEvent& aEvent );
void OnUpdateLoadFootprintFromBoard( wxUpdateUIEvent& aEvent );
void OnUpdateSaveFootprintToBoard( wxUpdateUIEvent& aEvent );

View File

@ -69,11 +69,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
submenuImport->SetTitle( _( "Import" ) );
submenuImport->SetIcon( BITMAPS::import );
submenuImport->Add( PCB_ACTIONS::importFootprint, ACTION_MENU::NORMAL, _( "Footprint..." ) );
submenuImport->Add( _( "&Graphics..." ),
_( "Import 2D drawing file to current footprint" ),
ID_GEN_IMPORT_GRAPHICS_FILE,
BITMAPS::import_vector );
submenuImport->Add( PCB_ACTIONS::importFootprint, ACTION_MENU::NORMAL, _( "Footprint..." ) );
submenuImport->Add( PCB_ACTIONS::placeImportedGraphics, ACTION_MENU::NORMAL, _( "Graphics..." ) );
fileMenu->Add( submenuImport );

View File

@ -109,8 +109,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
submenuImport->Add( PCB_ACTIONS::importNetlist, ACTION_MENU::NORMAL, _( "Netlist..." ) );
submenuImport->Add( PCB_ACTIONS::importSpecctraSession, ACTION_MENU::NORMAL, _( "Specctra Session..." ) );
submenuImport->Add( _( "Graphics..." ), _( "Import 2D drawing file" ),
ID_GEN_IMPORT_GRAPHICS_FILE, BITMAPS::import_vector );
submenuImport->Add( PCB_ACTIONS::placeImportedGraphics, ACTION_MENU::NORMAL, _( "Graphics..." ) );
if( Kiface().IsSingle() )
{

View File

@ -86,7 +86,6 @@ enum pcbnew_ids
ID_GEN_EXPORT_FILE_STEP,
ID_GEN_EXPORT_FILE_HYPERLYNX,
ID_GEN_EXPORT_FILE_GENCADFORMAT,
ID_GEN_IMPORT_GRAPHICS_FILE,
ID_TOOLBARH_PCB_ACTION_PLUGIN,
ID_TOOLBARH_PCB_ACTION_PLUGIN_REFRESH,

View File

@ -35,12 +35,6 @@
OPT<TOOL_EVENT> PCB_ACTIONS::TranslateLegacyId( int aId )
{
switch( aId )
{
case ID_GEN_IMPORT_GRAPHICS_FILE:
return PCB_ACTIONS::placeImportedGraphics.MakeEvent();
}
return OPT<TOOL_EVENT>();
}
@ -194,7 +188,7 @@ TOOL_ACTION PCB_ACTIONS::drawSimilarZone( "pcbnew.InteractiveDrawing.similarZone
TOOL_ACTION PCB_ACTIONS::placeImportedGraphics( "pcbnew.InteractiveDrawing.placeImportedGraphics",
AS_GLOBAL,
MD_SHIFT + MD_CTRL + 'F', LEGACY_HK_NAME( "Place DXF" ),
_( "Place Imported Graphics" ), "",
_( "Import Graphics..." ), _( "Import 2D drawing file" ),
BITMAPS::import_vector, AF_ACTIVATE );
TOOL_ACTION PCB_ACTIONS::setAnchor( "pcbnew.InteractiveDrawing.setAnchor",