Add in-app donate link
This commit is contained in:
parent
9939af3e27
commit
da6f9c399f
|
@ -423,6 +423,7 @@ void EDA_BASE_FRAME::AddStandardHelpMenu( wxMenuBar* aMenuBar )
|
|||
helpMenu->Add( ACTIONS::gettingStarted );
|
||||
helpMenu->Add( ACTIONS::listHotKeys );
|
||||
helpMenu->Add( ACTIONS::getInvolved );
|
||||
helpMenu->Add( ACTIONS::donate );
|
||||
helpMenu->Add( ACTIONS::reportBug );
|
||||
|
||||
helpMenu->AppendSeparator();
|
||||
|
|
|
@ -626,6 +626,11 @@ TOOL_ACTION ACTIONS::getInvolved( "common.SuiteControl.getInvolved",
|
|||
_( "Open \"Contribute to KiCad\" in a web browser" ),
|
||||
BITMAPS::info );
|
||||
|
||||
TOOL_ACTION ACTIONS::donate( "common.SuiteControl.donate",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Donate" ),
|
||||
_( "Open \"Donate to KiCad\" in a web browser" ) );
|
||||
|
||||
TOOL_ACTION ACTIONS::reportBug( "common.SuiteControl.reportBug",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Report Bug" ),
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include <eda_doc.h>
|
||||
|
||||
#define URL_GET_INVOLVED "https://kicad.org/contribute/"
|
||||
#define URL_DONATE "https://go.kicad.org/donate/"
|
||||
|
||||
|
||||
/// URL to launch a new issue with pre-populated description
|
||||
|
@ -241,6 +242,20 @@ int COMMON_CONTROL::GetInvolved( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
|
||||
int COMMON_CONTROL::Donate( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
if( !wxLaunchDefaultBrowser( URL_DONATE ) )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "Could not launch the default browser.\n"
|
||||
"To donate to the KiCad project, visit %s" ),
|
||||
URL_DONATE );
|
||||
wxMessageBox( msg, _( "Donate to KiCad" ), wxOK, m_frame );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int COMMON_CONTROL::ReportBug( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
wxString version = GetVersionInfoData( m_frame->GetAboutTitle(), false, true );
|
||||
|
@ -272,6 +287,7 @@ void COMMON_CONTROL::setTransitions()
|
|||
Go( &COMMON_CONTROL::ShowHelp, ACTIONS::help.MakeEvent() );
|
||||
Go( &COMMON_CONTROL::ListHotKeys, ACTIONS::listHotKeys.MakeEvent() );
|
||||
Go( &COMMON_CONTROL::GetInvolved, ACTIONS::getInvolved.MakeEvent() );
|
||||
Go( &COMMON_CONTROL::Donate, ACTIONS::donate.MakeEvent() );
|
||||
Go( &COMMON_CONTROL::ReportBug, ACTIONS::reportBug.MakeEvent() );
|
||||
}
|
||||
|
||||
|
|
|
@ -178,6 +178,7 @@ public:
|
|||
static TOOL_ACTION gettingStarted;
|
||||
static TOOL_ACTION help;
|
||||
static TOOL_ACTION listHotKeys;
|
||||
static TOOL_ACTION donate;
|
||||
static TOOL_ACTION getInvolved;
|
||||
static TOOL_ACTION reportBug;
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ public:
|
|||
int ShowHelp( const TOOL_EVENT& aEvent );
|
||||
int ListHotKeys( const TOOL_EVENT& aEvent );
|
||||
int GetInvolved( const TOOL_EVENT& aEvent );
|
||||
int Donate( const TOOL_EVENT& aEvent );
|
||||
int ReportBug( const TOOL_EVENT& aEvent );
|
||||
|
||||
///< Sets up handlers for various events.
|
||||
|
|
Loading…
Reference in New Issue