diff --git a/checkin_notes b/checkin_notes index 018afbecfb..7a963870a3 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5866,3 +5866,21 @@ Charlie 19 June 2009 mac_installer/ make_GridRepublic.sh make_ProgThruProc.sh + +Rom 19 June 2009 + - MGR: Make the Account Manager Properties page and the Project + Properties page the start for all automated wizard processes + so that we can successfully handle the need to check for + proxy servers. When directly advancing to the Processing + pages the proxy server checks were being skipped. + - MGR: Add some more smarts to the terms of use page which should + advance to the processing pages and skip the Account Info + page when the desired credentials are already known. + + clientgui/ + AccountInfoPage.cpp + AccountManagerPropertiesPage.cpp, .h + ProjectPropertiesPage.cpp, .h + TermsOfUsePage.cpp, .h + WelcomePage.cpp + WizardAttachProject.cpp diff --git a/clientgui/AccountInfoPage.cpp b/clientgui/AccountInfoPage.cpp index cd154ece8f..18cbfd6434 100644 --- a/clientgui/AccountInfoPage.cpp +++ b/clientgui/AccountInfoPage.cpp @@ -504,8 +504,7 @@ void CAccountInfoPage::OnPageChanged( wxWizardExEvent& event ) { * wxEVT_WIZARD_PAGE_CHANGING event handler for ID_ACCOUNTINFOPAGE */ -void CAccountInfoPage::OnPageChanging( wxWizardExEvent& event ) -{ +void CAccountInfoPage::OnPageChanging( wxWizardExEvent& event ) { if (event.GetDirection() == false) return; wxString strTitle; diff --git a/clientgui/AccountManagerPropertiesPage.cpp b/clientgui/AccountManagerPropertiesPage.cpp index ccd07c200e..9774bb6d12 100644 --- a/clientgui/AccountManagerPropertiesPage.cpp +++ b/clientgui/AccountManagerPropertiesPage.cpp @@ -38,6 +38,7 @@ #include "WizardAttachProject.h" #include "AccountManagerPropertiesPage.h" #include "AccountManagerInfoPage.h" +#include "AccountInfoPage.h" #include "CompletionErrorPage.h" #include "TermsOfUsePage.h" @@ -117,6 +118,7 @@ bool CAccountManagerPropertiesPage::Create( CBOINCBaseWizard* parent ) m_bNetworkConnectionDetected = false; m_bServerReportedError = false; m_bTermsOfUseRequired = true; + m_bCredentialsAlreadyAvailable = false; m_iBitmapIndex = 0; m_iCurrentState = ACCTMGRPROP_INIT; @@ -210,6 +212,8 @@ void CAccountManagerPropertiesPage::OnPageChanged( wxWizardExEvent& event ) SetProjectAccountCreationDisabled(false); SetProjectClientAccountCreationDisabled(false); SetNetworkConnectionDetected(false); + SetTermsOfUseRequired(true); + SetCredentialsAlreadyAvailable(false); SetNextState(ACCTMGRPROP_INIT); CAccountManagerPropertiesPageEvent TransitionEvent(wxEVT_ACCOUNTMANAGERPROPERTIES_STATECHANGE, this); @@ -232,7 +236,7 @@ void CAccountManagerPropertiesPage::OnCancel( wxWizardExEvent& event ) { void CAccountManagerPropertiesPage::OnStateChange( CAccountManagerPropertiesPageEvent& WXUNUSED(event) ) { - CMainDocument* pDoc = wxGetApp().GetDocument(); + CMainDocument* pDoc = wxGetApp().GetDocument(); CWizardAttachProject* pWAP = ((CWizardAttachProject*)GetParent()); PROJECT_CONFIG* pc; CC_STATUS status; @@ -248,6 +252,8 @@ void CAccountManagerPropertiesPage::OnStateChange( CAccountManagerPropertiesPage wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); + wxASSERT(pWAP); + wxASSERT(wxDynamicCast(pWAP, CWizardAttachProject)); switch(GetCurrentState()) { case ACCTMGRPROP_INIT: @@ -393,6 +399,20 @@ void CAccountManagerPropertiesPage::OnStateChange( CAccountManagerPropertiesPage SetNetworkConnectionDetected(false); } + SetNextState(ACCTMGRPROP_DETERMINEACCOUNTINFOSTATUS_BEGIN); + break; + case ACCTMGRPROP_DETERMINEACCOUNTINFOSTATUS_BEGIN: + SetNextState(ACCTMGRPROP_DETERMINEACCOUNTINFOSTATUS_EXECUTE); + break; + case ACCTMGRPROP_DETERMINEACCOUNTINFOSTATUS_EXECUTE: + // Determine if the account settings are already pre-populated. + // If so, advance to the Account Manager Processing page. + if ( pWAP->m_bCredentialsCached || pWAP->m_bCredentialsDetected) { + SetCredentialsAlreadyAvailable(true); + } else { + SetCredentialsAlreadyAvailable(false); + } + SetNextState(ACCTMGRPROP_CLEANUP); break; case ACCTMGRPROP_CLEANUP: @@ -438,6 +458,9 @@ wxWizardPageEx* CAccountManagerPropertiesPage::GetNext() const } else if (GetProjectPropertiesSucceeded() && GetTermsOfUseRequired()) { // Terms of Use are required before requesting account information return PAGE_TRANSITION_NEXT(ID_TERMSOFUSEPAGE); + } else if (GetProjectPropertiesSucceeded() && GetCredentialsAlreadyAvailable()) { + // Credentials are already available, do whatever we need to do. + return PAGE_TRANSITION_NEXT(ID_ACCOUNTMANAGERPROCESSINGPAGE); } else if (GetProjectPropertiesSucceeded()) { // We were successful in retrieving the project properties return PAGE_TRANSITION_NEXT(ID_ACCOUNTINFOPAGE); diff --git a/clientgui/AccountManagerPropertiesPage.h b/clientgui/AccountManagerPropertiesPage.h index fe79f1b883..08f350d2ca 100644 --- a/clientgui/AccountManagerPropertiesPage.h +++ b/clientgui/AccountManagerPropertiesPage.h @@ -55,8 +55,10 @@ END_DECLARE_EVENT_TYPES() #define ACCTMGRPROP_RETRPROJECTPROPERTIES_EXECUTE 2 #define ACCTMGRPROP_DETERMINENETWORKSTATUS_BEGIN 3 #define ACCTMGRPROP_DETERMINENETWORKSTATUS_EXECUTE 4 -#define ACCTMGRPROP_CLEANUP 5 -#define ACCTMGRPROP_END 6 +#define ACCTMGRPROP_DETERMINEACCOUNTINFOSTATUS_BEGIN 5 +#define ACCTMGRPROP_DETERMINEACCOUNTINFOSTATUS_EXECUTE 6 +#define ACCTMGRPROP_CLEANUP 7 +#define ACCTMGRPROP_END 8 /*! * CAccountManagerPropertiesPage class declaration @@ -127,6 +129,9 @@ public: bool GetTermsOfUseRequired() const { return m_bTermsOfUseRequired ; } void SetTermsOfUseRequired(bool value) { m_bTermsOfUseRequired = value ; } + bool GetCredentialsAlreadyAvailable() const { return m_bCredentialsAlreadyAvailable ; } + void SetCredentialsAlreadyAvailable(bool value) { m_bCredentialsAlreadyAvailable = value ; } + wxInt32 GetCurrentState() const { return m_iCurrentState ; } void SetNextState(wxInt32 value) { m_iCurrentState = value ; } @@ -150,6 +155,7 @@ public: bool m_bNetworkConnectionDetected; bool m_bServerReportedError; bool m_bTermsOfUseRequired; + bool m_bCredentialsAlreadyAvailable; int m_iBitmapIndex; int m_iCurrentState; }; diff --git a/clientgui/ProjectPropertiesPage.cpp b/clientgui/ProjectPropertiesPage.cpp index 913b5f8ef1..bc68c53835 100644 --- a/clientgui/ProjectPropertiesPage.cpp +++ b/clientgui/ProjectPropertiesPage.cpp @@ -188,6 +188,9 @@ wxWizardPageEx* CProjectPropertiesPage::GetNext() const } else if (GetProjectPropertiesSucceeded() && GetTermsOfUseRequired()) { // Terms of Use are required before requesting account information return PAGE_TRANSITION_NEXT(ID_TERMSOFUSEPAGE); + } else if (GetProjectPropertiesSucceeded() && GetCredentialsAlreadyAvailable()) { + // Credentials are already available, do whatever we need to do. + return PAGE_TRANSITION_NEXT(ID_PROJECTPROCESSINGPAGE); } else if (GetProjectPropertiesSucceeded()) { // We were successful in retrieving the project properties return PAGE_TRANSITION_NEXT(ID_ACCOUNTINFOPAGE); @@ -525,8 +528,22 @@ void CProjectPropertiesPage::OnStateChange( CProjectPropertiesPageEvent& WXUNUSE } else { SetNetworkConnectionDetected(false); } - SetNextState(PROJPROP_CLEANUP); + SetNextState(PROJPROP_DETERMINEACCOUNTINFOSTATUS_BEGIN); + break; + case PROJPROP_DETERMINEACCOUNTINFOSTATUS_BEGIN: + SetNextState(PROJPROP_DETERMINEACCOUNTINFOSTATUS_EXECUTE); + break; + case PROJPROP_DETERMINEACCOUNTINFOSTATUS_EXECUTE: + // Determine if the account settings are already pre-populated. + // If so, advance to the Project Processing page. + if ( pWAP->m_bCredentialsCached || pWAP->m_bCredentialsDetected) { + SetCredentialsAlreadyAvailable(true); + } else { + SetCredentialsAlreadyAvailable(false); + } + + SetNextState(PROJPROP_CLEANUP); break; case PROJPROP_CLEANUP: FinishProgress(m_pProgressIndicator); diff --git a/clientgui/ProjectPropertiesPage.h b/clientgui/ProjectPropertiesPage.h index f3f3aa5ad0..c2f36530d8 100644 --- a/clientgui/ProjectPropertiesPage.h +++ b/clientgui/ProjectPropertiesPage.h @@ -55,8 +55,10 @@ END_DECLARE_EVENT_TYPES() #define PROJPROP_RETRPROJECTPROPERTIES_EXECUTE 2 #define PROJPROP_DETERMINENETWORKSTATUS_BEGIN 3 #define PROJPROP_DETERMINENETWORKSTATUS_EXECUTE 4 -#define PROJPROP_CLEANUP 5 -#define PROJPROP_END 6 +#define PROJPROP_DETERMINEACCOUNTINFOSTATUS_BEGIN 5 +#define PROJPROP_DETERMINEACCOUNTINFOSTATUS_EXECUTE 6 +#define PROJPROP_CLEANUP 7 +#define PROJPROP_END 8 /*! * CProjectPropertiesPage class declaration @@ -130,6 +132,9 @@ public: bool GetTermsOfUseRequired() const { return m_bTermsOfUseRequired ; } void SetTermsOfUseRequired(bool value) { m_bTermsOfUseRequired = value ; } + bool GetCredentialsAlreadyAvailable() const { return m_bCredentialsAlreadyAvailable ; } + void SetCredentialsAlreadyAvailable(bool value) { m_bCredentialsAlreadyAvailable = value ; } + wxInt32 GetCurrentState() const { return m_iCurrentState ; } void SetNextState(wxInt32 value) { m_iCurrentState = value ; } @@ -153,6 +158,7 @@ public: bool m_bNetworkConnectionDetected; bool m_bServerReportedError; bool m_bTermsOfUseRequired; + bool m_bCredentialsAlreadyAvailable; int m_iBitmapIndex; int m_iCurrentState; }; diff --git a/clientgui/TermsOfUsePage.cpp b/clientgui/TermsOfUsePage.cpp index 884f7137d8..c856824c07 100644 --- a/clientgui/TermsOfUsePage.cpp +++ b/clientgui/TermsOfUsePage.cpp @@ -33,6 +33,7 @@ #include "MainDocument.h" #include "BOINCWizards.h" #include "BOINCBaseWizard.h" +#include "WizardAttachProject.h" #include "TermsOfUsePage.h" @@ -50,9 +51,10 @@ BEGIN_EVENT_TABLE( CTermsOfUsePage, wxWizardPageEx ) ////@begin CTermsOfUsePage event table entries EVT_WIZARDEX_PAGE_CHANGED( -1, CTermsOfUsePage::OnPageChanged ) + EVT_WIZARDEX_PAGE_CHANGING( -1, CTermsOfUsePage::OnPageChanging ) EVT_WIZARDEX_CANCEL( -1, CTermsOfUsePage::OnCancel ) - EVT_RADIOBUTTON( ID_TERMSOFUSEAGREECTRL, CTermsOfUsePage::OnAgree ) - EVT_RADIOBUTTON( ID_TERMSOFUSEDISAGREECTRL, CTermsOfUsePage::OnDisagree ) + EVT_RADIOBUTTON( ID_TERMSOFUSEAGREECTRL, CTermsOfUsePage::OnTermsOfUseStatusChange ) + EVT_RADIOBUTTON( ID_TERMSOFUSEDISAGREECTRL, CTermsOfUsePage::OnTermsOfUseStatusChange ) ////@end CTermsOfUsePage event table entries END_EVENT_TABLE() @@ -154,6 +156,10 @@ wxWizardPageEx* CTermsOfUsePage::GetNext() const if (CHECK_CLOSINGINPROGRESS()) { // Cancel Event Detected return PAGE_TRANSITION_NEXT(ID_COMPLETIONERRORPAGE); + } else if (IS_ATTACHTOPROJECTWIZARD() && GetUserAgrees() && GetCredentialsAlreadyAvailable()) { + return PAGE_TRANSITION_NEXT(ID_PROJECTPROCESSINGPAGE); + } else if (IS_ACCOUNTMANAGERWIZARD() && GetUserAgrees() && GetCredentialsAlreadyAvailable()) { + return PAGE_TRANSITION_NEXT(ID_ACCOUNTMANAGERPROCESSINGPAGE); } else if (GetUserAgrees()) { return PAGE_TRANSITION_NEXT(ID_ACCOUNTINFOPAGE); } else { @@ -237,6 +243,33 @@ void CTermsOfUsePage::OnPageChanged( wxWizardExEvent& event ) { Fit(); } +/*! + * wxEVT_WIZARD_PAGE_CHANGING event handler for ID_TERMSOFUSEPAGE + */ + +void CTermsOfUsePage::OnPageChanging( wxWizardExEvent& event ) { + if (event.GetDirection() == false) return; + + CWizardAttachProject* pWAP = ((CWizardAttachProject*)GetParent()); + + wxASSERT(pWAP); + wxASSERT(wxDynamicCast(pWAP, CWizardAttachProject)); + + + if (!CHECK_CLOSINGINPROGRESS()) { + // We are leaving this page. + + // Determine if the account settings are already pre-populated. + // If so, advance to the Account Manager Processing page or the + // Project Processing page. + if ( pWAP->m_bCredentialsCached || pWAP->m_bCredentialsDetected) { + SetCredentialsAlreadyAvailable(true); + } else { + SetCredentialsAlreadyAvailable(false); + } + } +} + /*! * wxEVT_WIZARD_CANCEL event handler for ID_TERMSOFUSEPAGE */ @@ -247,23 +280,19 @@ void CTermsOfUsePage::OnCancel( wxWizardExEvent& event ) { /*! * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_TERMSOFUSEAGREECTRL + * or ID_TERMSOFUSEDISAGREECTRL */ -void CTermsOfUsePage::OnAgree( wxCommandEvent& event ) { - if (event.IsChecked()){ - wxLogTrace(wxT("Function Status"), wxT("CTermsOfUsePage::OnAgree - SetUserAgrees(true)")); +void CTermsOfUsePage::OnTermsOfUseStatusChange( wxCommandEvent& event ) { + wxLogTrace(wxT("Function Start/End"), wxT("CTermsOfUsePage::OnTermsOfUseStatusChange - Function Begin")); + + if ((ID_TERMSOFUSEAGREECTRL == event.GetId()) && event.IsChecked()){ + wxLogTrace(wxT("Function Status"), wxT("CTermsOfUsePage::OnTermsOfUseStatusChange - SetUserAgrees(true)")); + SetUserAgrees(true); + } else { + wxLogTrace(wxT("Function Status"), wxT("CTermsOfUsePage::OnTermsOfUseStatusChange - SetUserAgrees(false)")); SetUserAgrees(true); } + + wxLogTrace(wxT("Function Start/End"), wxT("CTermsOfUsePage::OnTermsOfUseStatusChange - Function End")); } - -/*! - * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_TERMSOFUSEDISAGREECTRL - */ - -void CTermsOfUsePage::OnDisagree( wxCommandEvent& event ) { - if (event.IsChecked()) { - wxLogTrace(wxT("Function Status"), wxT("CTermsOfUsePage::OnDisagree - SetUserAgrees(false)")); - SetUserAgrees(false); - } -} - diff --git a/clientgui/TermsOfUsePage.h b/clientgui/TermsOfUsePage.h index d75a327af9..a93d41dd4b 100644 --- a/clientgui/TermsOfUsePage.h +++ b/clientgui/TermsOfUsePage.h @@ -48,14 +48,15 @@ public: /// wxEVT_WIZARD_PAGE_CHANGED event handler for ID_TERMSOFUSEPAGE void OnPageChanged( wxWizardExEvent& event ); + /// wxEVT_WIZARD_PAGE_CHANGING event handler for ID_TERMSOFUSEPAGE + void OnPageChanging( wxWizardExEvent& event ); + /// wxEVT_WIZARD_CANCEL event handler for ID_TERMSOFUSEPAGE void OnCancel( wxWizardExEvent& event ); /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_TERMSOFUSEAGREECTRL - void OnAgree( wxCommandEvent& event ); - - /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_TERMSOFUSEDISAGREECTRL - void OnDisagree( wxCommandEvent& event ); + /// or ID_TERMSOFUSEDISAGREECTRL + void OnTermsOfUseStatusChange( wxCommandEvent& event ); ////@end CTermsOfUsePage event handler declarations @@ -77,6 +78,9 @@ public: bool GetUserAgrees() const { return m_bUserAgrees ; } void SetUserAgrees(bool value) { m_bUserAgrees = value ; } + bool GetCredentialsAlreadyAvailable() const { return m_bCredentialsAlreadyAvailable ; } + void SetCredentialsAlreadyAvailable(bool value) { m_bCredentialsAlreadyAvailable = value ; } + /// Should we show tooltips? static bool ShowToolTips(); @@ -88,6 +92,7 @@ public: wxRadioButton* m_pDisagreeCtrl; ////@end CTermsOfUsePage member variables bool m_bUserAgrees; + bool m_bCredentialsAlreadyAvailable; }; #endif diff --git a/clientgui/WelcomePage.cpp b/clientgui/WelcomePage.cpp index 6d817f2ba2..863339dcb5 100644 --- a/clientgui/WelcomePage.cpp +++ b/clientgui/WelcomePage.cpp @@ -217,8 +217,8 @@ wxIcon CWelcomePage::GetIconResource( const wxString& WXUNUSED(name) ) */ void CWelcomePage::OnPageChanged( wxWizardExEvent& event ) { - wxLogTrace(wxT("Function Start/End"), wxT("CWelcomePage::OnPageChanged - Function Begin")); if (event.GetDirection() == false) return; + wxLogTrace(wxT("Function Start/End"), wxT("CWelcomePage::OnPageChanged - Function Begin")); CMainDocument* pDoc = wxGetApp().GetDocument(); ACCT_MGR_INFO ami; diff --git a/clientgui/WizardAttachProject.cpp b/clientgui/WizardAttachProject.cpp index dc30ed6b98..bcb0d9a807 100644 --- a/clientgui/WizardAttachProject.cpp +++ b/clientgui/WizardAttachProject.cpp @@ -380,9 +380,7 @@ bool CWizardAttachProject::Run( wxString& WXUNUSED(strName), wxString& strURL, b } } - if ( strURL.Length() && (bCredentialsCached || m_bCredentialsDetected) && m_ProjectProcessingPage) { - return RunWizard(m_ProjectProcessingPage); - } else if (strURL.Length() && !bCredentialsCached && m_ProjectPropertiesPage) { + if (strURL.Length() && m_ProjectPropertiesPage) { return RunWizard(m_ProjectPropertiesPage); } else if (m_WelcomePage) { return RunWizard(m_WelcomePage); @@ -410,6 +408,10 @@ bool CWizardAttachProject::SyncToAccountManager() { m_bCredentialsCached = ami.have_credentials; m_bCookieRequired = ami.cookie_required; m_strCookieFailureURL = wxString(ami.cookie_failure_url.c_str(), wxConvUTF8); + + if (m_bCredentialsCached) { + IsAccountManagerUpdateWizard = true; + } } if (ami.acct_mgr_url.size() && !m_bCredentialsCached) { @@ -436,10 +438,7 @@ bool CWizardAttachProject::SyncToAccountManager() { } } - if ( !ami.acct_mgr_url.empty() && (m_bCredentialsCached || m_bCredentialsDetected) && m_AccountManagerProcessingPage) { - IsAccountManagerUpdateWizard = true; - return RunWizard(m_AccountManagerProcessingPage); - } else if ( ami.acct_mgr_url.size() && !m_bCredentialsCached && m_AccountManagerProcessingPage) { + if (m_AccountManagerPropertiesPage) { return RunWizard(m_AccountManagerPropertiesPage); }