Convert ShowEEschema to an ACTION so it can get a hotkey assignment.

Fixes: lp:1686010
* https://bugs.launchpad.net/kicad/+bug/1686010
This commit is contained in:
Jeff Young 2019-07-09 00:43:08 +01:00
parent d3d0bdbe17
commit 3a8f32c380
9 changed files with 24 additions and 12 deletions

View File

@ -565,7 +565,7 @@ TOOL_ACTION EE_ACTIONS::drawSheetOnClipboard( "eeschema.EditorControl.drawSheetO
TOOL_ACTION EE_ACTIONS::showPcbNew( "eeschema.EditorControl.showPcbNew",
AS_GLOBAL, 0, "",
_( "Open PCB Editor" ), _( "Run Pcbnew" ),
_( "Switch to PCB Editor" ), _( "Open PCB in Pcbnew" ),
pcbnew_xpm );
TOOL_ACTION EE_ACTIONS::exportNetlist( "eeschema.EditorControl.exportNetlist",

View File

@ -158,8 +158,6 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_TOOL( ID_TOOLBARH_PCB_ACTION_PLUGIN_REFRESH, PCB_EDIT_FRAME::OnActionPluginRefresh )
#endif
EVT_TOOL( ID_RUN_EESCHEMA, PCB_EDIT_FRAME::OnRunEeschema )
// Tracks and vias sizes general options
EVT_MENU_RANGE( ID_POPUP_PCB_SELECT_WIDTH_START_RANGE,
ID_POPUP_PCB_SELECT_WIDTH_END_RANGE,
@ -987,7 +985,7 @@ void PCB_EDIT_FRAME::DoUpdatePCBFromNetlist( NETLIST& aNetlist, bool aUseTimesta
}
void PCB_EDIT_FRAME::OnRunEeschema( wxCommandEvent& event )
void PCB_EDIT_FRAME::RunEeschema()
{
wxString msg;
wxFileName schfn( Prj().GetProjectPath(), Prj().GetProjectName(), SchematicFileExtension );

View File

@ -303,7 +303,8 @@ public:
void OnUpdateSelectViaSize( wxUpdateUIEvent& aEvent );
void OnUpdateSelectTrackWidth( wxUpdateUIEvent& aEvent );
void OnLayerColorChange( wxCommandEvent& aEvent );
void OnRunEeschema( wxCommandEvent& event );
void RunEeschema();
void UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox, bool aEdit = true );
void UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox, bool aEdit = true );

View File

@ -146,7 +146,6 @@ enum pcbnew_ids
ID_FOOTPRINT_WIZARD_RESET_TO_DEFAULT,
ID_ADD_FOOTPRINT_TO_BOARD,
ID_RUN_EESCHEMA,
ID_PCBNEW_END_LIST
};

View File

@ -285,7 +285,7 @@ void PCB_EDIT_FRAME::ReCreateHToolbar()
PrepareLayerIndicator(); // Initialize the bitmap with the active layer colors
KiScaledSeparator( m_mainToolBar, this );
ADD_TOOL( ID_RUN_EESCHEMA, eeschema_xpm, _( "Open schematic in Eeschema" ) );
m_mainToolBar->Add( PCB_ACTIONS::showEeschema );
// Access to the scripting console
#if defined(KICAD_SCRIPTING_WXPYTHON)

View File

@ -594,6 +594,15 @@ TOOL_ACTION PCB_ACTIONS::highlightNetSelection( "pcbnew.EditorControl.highlightN
_( "Highlight Net" ), _( "Highlight all copper items of a net" ),
net_highlight_xpm );
TOOL_ACTION PCB_ACTIONS::showEeschema( "pcbnew.EditorControl.showEeschema",
AS_GLOBAL, 0, "",
_( "Switch to Schematic Editor" ), _( "Open schematic in Eeschema" ),
eeschema_xpm );
// PCBNEW_CONTROL
//
TOOL_ACTION PCB_ACTIONS::localRatsnestTool( "pcbnew.Control.localRatsnestTool",
AS_GLOBAL, 0, "",
_( "Highlight Ratsnest" ), _( "Show ratsnest of selected item(s)" ),
@ -630,10 +639,6 @@ TOOL_ACTION PCB_ACTIONS::flipBoard( "pcbnew.Control.flipBoard",
_( "Flip Board View" ), _( "Flip (mirror) the board view" ),
flip_board_xpm );
// PCBNEW_CONTROL
//
// Display modes
TOOL_ACTION PCB_ACTIONS::showRatsnest( "pcbnew.Control.showRatsnest",
AS_GLOBAL, 0, "",
@ -1175,4 +1180,3 @@ TOOL_ACTION PCB_ACTIONS::dragFreeAngle( "pcbnew.InteractiveRouter.DragFreeAngle"
_( "Drags the nearest joint in the track without restricting the track angle." ),
move_xpm );

View File

@ -413,6 +413,7 @@ public:
static TOOL_ACTION highlightNetSelection;
static TOOL_ACTION drillOrigin;
static TOOL_ACTION appendBoard;
static TOOL_ACTION showEeschema;
// Ratsnest
static TOOL_ACTION localRatsnestTool;

View File

@ -413,6 +413,13 @@ int PCB_EDITOR_CONTROL::UpdatePCBFromSchematic( const TOOL_EVENT& aEvent )
}
int PCB_EDITOR_CONTROL::ShowEeschema( const TOOL_EVENT& aEvent )
{
m_frame->RunEeschema();
return 0;
}
int PCB_EDITOR_CONTROL::ToggleLayersManager( const TOOL_EVENT& aEvent )
{
getEditFrame<PCB_EDIT_FRAME>()->ToggleLayersManager();
@ -1549,6 +1556,7 @@ void PCB_EDITOR_CONTROL::setTransitions()
Go( &PCB_EDITOR_CONTROL::ListNets, PCB_ACTIONS::listNets.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::UpdatePCBFromSchematic, ACTIONS::updatePcbFromSchematic.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ShowEeschema, PCB_ACTIONS::showEeschema.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ToggleLayersManager, PCB_ACTIONS::showLayersManager.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ToggleMicrowaveToolbar, PCB_ACTIONS::showMicrowaveToolbar.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::TogglePythonConsole, PCB_ACTIONS::showPythonConsole.MakeEvent() );

View File

@ -68,6 +68,7 @@ public:
int GenerateFabFiles( const TOOL_EVENT& aEvent );
int UpdatePCBFromSchematic( const TOOL_EVENT& aEvent );
int ShowEeschema( const TOOL_EVENT& aEvent );
int ToggleLayersManager( const TOOL_EVENT& aEvent );
int ToggleMicrowaveToolbar( const TOOL_EVENT& aEvent );
int TogglePythonConsole( const TOOL_EVENT& aEvent );