mirror of https://github.com/BOINC/boinc.git
[Manager] Add HTML TOU support to Wizard
Add function to open links in default browser from Wizard TOU. Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
This commit is contained in:
parent
8ef9bb3b51
commit
cd68801710
|
@ -54,6 +54,7 @@ BEGIN_EVENT_TABLE( CTermsOfUsePage, wxWizardPageEx )
|
||||||
EVT_WIZARDEX_CANCEL( -1, CTermsOfUsePage::OnCancel )
|
EVT_WIZARDEX_CANCEL( -1, CTermsOfUsePage::OnCancel )
|
||||||
EVT_RADIOBUTTON( ID_TERMSOFUSEAGREECTRL, CTermsOfUsePage::OnTermsOfUseStatusChange )
|
EVT_RADIOBUTTON( ID_TERMSOFUSEAGREECTRL, CTermsOfUsePage::OnTermsOfUseStatusChange )
|
||||||
EVT_RADIOBUTTON( ID_TERMSOFUSEDISAGREECTRL, CTermsOfUsePage::OnTermsOfUseStatusChange )
|
EVT_RADIOBUTTON( ID_TERMSOFUSEDISAGREECTRL, CTermsOfUsePage::OnTermsOfUseStatusChange )
|
||||||
|
EVT_HTML_LINK_CLICKED(ID_TERMSOFUSECTRL, CTermsOfUsePage::OnLinkClicked)
|
||||||
////@end CTermsOfUsePage event table entries
|
////@end CTermsOfUsePage event table entries
|
||||||
|
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
@ -138,7 +139,19 @@ void CTermsOfUsePage::CreateControls()
|
||||||
|
|
||||||
////@end CTermsOfUsePage content construction
|
////@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.
|
* Gets the previous page.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -42,6 +42,9 @@ public:
|
||||||
|
|
||||||
/// Creates the controls and sizers
|
/// Creates the controls and sizers
|
||||||
void CreateControls();
|
void CreateControls();
|
||||||
|
|
||||||
|
/// Handles clicks on links
|
||||||
|
void OnLinkClicked( wxHtmlLinkEvent & event );
|
||||||
|
|
||||||
////@begin CTermsOfUsePage event handler declarations
|
////@begin CTermsOfUsePage event handler declarations
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue