diff --git a/checkin_notes b/checkin_notes index c75e551657..377c102070 100644 --- a/checkin_notes +++ b/checkin_notes @@ -488,3 +488,11 @@ David Jan 14 2008 - updated INSTALL INSTALL + +Rom Jan 14 2008 + - Add a "Forgot your password" hyperlink to the wizards + account info page. + + clientgui/ + AccountInfoPage.cpp, .h + BOINCWizards.h diff --git a/clientgui/AccountInfoPage.cpp b/clientgui/AccountInfoPage.cpp index 3166e4680b..ef877d0891 100644 --- a/clientgui/AccountInfoPage.cpp +++ b/clientgui/AccountInfoPage.cpp @@ -35,9 +35,14 @@ #include "MainDocument.h" #include "wx/valgen.h" #include "wx/valtext.h" +#include "hyperlink.h" #include "ValidateEmailAddress.h" #include "BOINCWizards.h" #include "BOINCBaseWizard.h" +#include "WizardAttachProject.h" +#include "WizardAccountManager.h" +#include "ProjectInfoPage.h" +#include "AccountManagerInfoPage.h" #include "AccountInfoPage.h" @@ -97,6 +102,7 @@ bool CAccountInfoPage::Create( CBOINCBaseWizard* parent ) m_pAccountConfirmPasswordStaticCtrl = NULL; m_pAccountConfirmPasswordCtrl = NULL; m_pAccountPasswordRequirmentsStaticCtrl = NULL; + m_pAccountForgotPasswordCtrl = NULL; ////@end CAccountInfoPage member initialisation ////@begin CAccountInfoPage creation @@ -185,6 +191,10 @@ void CAccountInfoPage::CreateControls() m_pAccountPasswordRequirmentsStaticCtrl->SetFont(wxFont(7, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE)); itemFlexGridSizer64->Add(m_pAccountPasswordRequirmentsStaticCtrl, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); + m_pAccountForgotPasswordCtrl = new wxHyperLink; + m_pAccountForgotPasswordCtrl->Create( itemWizardPage56, ID_ACCOUNTFORGOTPASSWORDCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer64->Add(m_pAccountForgotPasswordCtrl, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); + // Set validators // m_pAccountEmailAddressCtrl is setup when the OnPageChange event is fired since // it can be a username or an email address. @@ -260,10 +270,11 @@ wxIcon CAccountInfoPage::GetIconResource( const wxString& WXUNUSED(name) ) void CAccountInfoPage::OnPageChanged( wxWizardExEvent& event ) { if (event.GetDirection() == false) return; - PROJECT_CONFIG& pc = ((CBOINCBaseWizard*)GetParent())->project_config; - CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); - CSkinWizardATAM* pSkinWizardATAM = wxGetApp().GetSkinManager()->GetWizards()->GetWizardATAM(); - + PROJECT_CONFIG& pc = ((CBOINCBaseWizard*)GetParent())->project_config; + CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); + CSkinWizardATAM* pSkinWizardATAM = wxGetApp().GetSkinManager()->GetWizards()->GetWizardATAM(); + CWizardAttachProject* pWAP = ((CWizardAttachProject*)GetParent()); + CWizardAccountManager* pWAM = ((CWizardAccountManager*)GetParent()); wxASSERT(pSkinAdvanced); wxASSERT(pSkinWizardATAM); @@ -279,6 +290,7 @@ void CAccountInfoPage::OnPageChanged( wxWizardExEvent& event ) { wxASSERT(m_pAccountConfirmPasswordStaticCtrl); wxASSERT(m_pAccountConfirmPasswordCtrl); wxASSERT(m_pAccountPasswordRequirmentsStaticCtrl); + wxASSERT(m_pAccountForgotPasswordCtrl); wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced)); wxASSERT(wxDynamicCast(pSkinWizardATAM, CSkinWizardATAM)); @@ -416,7 +428,23 @@ void CAccountInfoPage::OnPageChanged( wxWizardExEvent& event ) { str.Printf(_("minimum length %d"), ((CBOINCBaseWizard*)GetParent())->project_config.min_passwd_length); m_pAccountPasswordRequirmentsStaticCtrl->SetLabel( str ); } - + + m_pAccountForgotPasswordCtrl->SetLabel( + _("Forgot your password") + ); + + if (!IS_ACCOUNTMANAGERWIZARD()) { + wxASSERT(pWAP); + m_pAccountForgotPasswordCtrl->SetURL( + wxString(pWAP->m_ProjectInfoPage->GetProjectURL() + _T("get_passwd.php")) + ); + } else { + wxASSERT(pWAM); + m_pAccountForgotPasswordCtrl->SetURL( + wxString(pWAM->m_AccountManagerInfoPage->GetProjectURL() + _T("get_passwd.php")) + ); + } + Fit(); m_pAccountEmailAddressCtrl->SetFocus(); } diff --git a/clientgui/AccountInfoPage.h b/clientgui/AccountInfoPage.h index 541977089b..7a0ba1ad99 100644 --- a/clientgui/AccountInfoPage.h +++ b/clientgui/AccountInfoPage.h @@ -24,6 +24,7 @@ #pragma interface "AccountInfoPage.cpp" #endif + /*! * CAccountInfoPage class declaration */ @@ -107,6 +108,7 @@ public: wxString m_strAccountEmailAddress; wxString m_strAccountPassword; wxString m_strAccountConfirmPassword; + wxHyperLink* m_pAccountForgotPasswordCtrl; ////@end CAccountInfoPage member variables }; diff --git a/clientgui/BOINCWizards.h b/clientgui/BOINCWizards.h index bacd0ce71d..aca0bfd34c 100644 --- a/clientgui/BOINCWizards.h +++ b/clientgui/BOINCWizards.h @@ -101,6 +101,7 @@ #define ID_ACCOUNTCONFIRMPASSWORDSTATICCTRL 11406 #define ID_ACCOUNTCONFIRMPASSWORDCTRL 11407 #define ID_ACCOUNTREQUIREMENTSSTATICCTRL 11408 +#define ID_ACCOUNTFORGOTPASSWORDCTRL 11409 // Proxy Page Controls #define ID_PROXYHTTPSERVERSTATICCTRL 11500