diff --git a/clientgui/TermsOfUsePage.cpp b/clientgui/TermsOfUsePage.cpp index 5e779fd9f9..81eb54f696 100644 --- a/clientgui/TermsOfUsePage.cpp +++ b/clientgui/TermsOfUsePage.cpp @@ -54,6 +54,7 @@ BEGIN_EVENT_TABLE( CTermsOfUsePage, wxWizardPageEx ) EVT_WIZARDEX_CANCEL( -1, CTermsOfUsePage::OnCancel ) EVT_RADIOBUTTON( ID_TERMSOFUSEAGREECTRL, CTermsOfUsePage::OnTermsOfUseStatusChange ) EVT_RADIOBUTTON( ID_TERMSOFUSEDISAGREECTRL, CTermsOfUsePage::OnTermsOfUseStatusChange ) + EVT_HTML_LINK_CLICKED(ID_TERMSOFUSECTRL, CTermsOfUsePage::OnLinkClicked) ////@end CTermsOfUsePage event table entries END_EVENT_TABLE() @@ -138,7 +139,19 @@ void CTermsOfUsePage::CreateControls() ////@end CTermsOfUsePage content construction } - + + +void CTermsOfUsePage::OnLinkClicked( wxHtmlLinkEvent& event ) { + wxString url = event.GetLinkInfo().GetHref(); + if (url.StartsWith(wxT("http://")) || url.StartsWith(wxT("https://"))) { + // wxHtmlLinkEvent doesn't have Veto(), but only loads the page if you + // call Skip(). + wxLaunchDefaultBrowser(url); + } else { + event.Skip(); + } + } + /*! * Gets the previous page. */ diff --git a/clientgui/TermsOfUsePage.h b/clientgui/TermsOfUsePage.h index 43a97f84f2..614d2c175c 100644 --- a/clientgui/TermsOfUsePage.h +++ b/clientgui/TermsOfUsePage.h @@ -42,6 +42,9 @@ public: /// Creates the controls and sizers void CreateControls(); + + /// Handles clicks on links + void OnLinkClicked( wxHtmlLinkEvent & event ); ////@begin CTermsOfUsePage event handler declarations