Move About dialog to an action

This commit is contained in:
Ian McInerney 2023-10-04 20:42:35 +01:00
parent 31c488bc23
commit fb3bfc3c57
5 changed files with 21 additions and 2 deletions

View File

@ -515,8 +515,8 @@ void EDA_BASE_FRAME::AddStandardHelpMenu( wxMenuBar* aMenuBar )
helpMenu->Add( ACTIONS::reportBug );
helpMenu->AppendSeparator();
helpMenu->Add( _( "&About KiCad" ), "", wxID_ABOUT, BITMAPS::about );
helpMenu->Add( ACTIONS::about );
// Trailing space keeps OSX from hijacking our menu (and disabling everything in it).
aMenuBar->Append( helpMenu, _( "&Help" ) + wxS( " " ) );
helpMenu->wxMenu::SetTitle( _( "&Help" ) + wxS( " " ) );

View File

@ -960,6 +960,14 @@ TOOL_ACTION ACTIONS::help( TOOL_ACTION_ARGS()
.Tooltip( _( "Open product documentation in a web browser" ) )
.Icon( BITMAPS::help_online ) );
TOOL_ACTION ACTIONS::about( TOOL_ACTION_ARGS()
.Name( "common.SuiteControl.about" )
.Scope( AS_GLOBAL )
.MenuText( _( "About KiCad" ) )
.Tooltip( _( "Open about dialog" ) )
.UIId( wxID_ABOUT )
.Icon( BITMAPS::about ) );
TOOL_ACTION ACTIONS::listHotKeys( TOOL_ACTION_ARGS()
.Name( "common.SuiteControl.listHotKeys" )
.Scope( AS_GLOBAL )

View File

@ -271,6 +271,14 @@ int COMMON_CONTROL::ShowHelp( const TOOL_EVENT& aEvent )
}
int COMMON_CONTROL::About( const TOOL_EVENT& aEvent )
{
void ShowAboutDialog( EDA_BASE_FRAME * aParent ); // See AboutDialog_main.cpp
ShowAboutDialog( m_frame );
return 0;
}
int COMMON_CONTROL::ListHotKeys( const TOOL_EVENT& aEvent )
{
DisplayHotkeyList( m_frame );
@ -346,6 +354,7 @@ void COMMON_CONTROL::setTransitions()
Go( &COMMON_CONTROL::GetInvolved, ACTIONS::getInvolved.MakeEvent() );
Go( &COMMON_CONTROL::Donate, ACTIONS::donate.MakeEvent() );
Go( &COMMON_CONTROL::ReportBug, ACTIONS::reportBug.MakeEvent() );
Go( &COMMON_CONTROL::About, ACTIONS::about.MakeEvent() );
}

View File

@ -190,6 +190,7 @@ public:
static TOOL_ACTION showFootprintLibTable;
static TOOL_ACTION gettingStarted;
static TOOL_ACTION help;
static TOOL_ACTION about;
static TOOL_ACTION listHotKeys;
static TOOL_ACTION donate;
static TOOL_ACTION getInvolved;

View File

@ -53,6 +53,7 @@ public:
int ShowProjectManager( const TOOL_EVENT& aEvent );
int ShowHelp( const TOOL_EVENT& aEvent );
int About( const TOOL_EVENT& aEvent );
int ListHotKeys( const TOOL_EVENT& aEvent );
int GetInvolved( const TOOL_EVENT& aEvent );
int Donate( const TOOL_EVENT& aEvent );