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_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()
|
||||
|
@ -139,6 +140,18 @@ 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.
|
||||
*/
|
||||
|
|
|
@ -43,6 +43,9 @@ public:
|
|||
/// Creates the controls and sizers
|
||||
void CreateControls();
|
||||
|
||||
/// Handles clicks on links
|
||||
void OnLinkClicked( wxHtmlLinkEvent & event );
|
||||
|
||||
////@begin CTermsOfUsePage event handler declarations
|
||||
|
||||
/// wxEVT_WIZARD_PAGE_CHANGED event handler for ID_TERMSOFUSEPAGE
|
||||
|
|
Loading…
Reference in New Issue