2008-08-06 18:36:30 +00:00
// This file is part of BOINC.
2005-09-26 11:29:28 +00:00
// http://boinc.berkeley.edu
2008-08-06 18:36:30 +00:00
// Copyright (C) 2008 University of California
2005-09-26 11:29:28 +00:00
//
2008-08-06 18:36:30 +00:00
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
2005-09-26 11:29:28 +00:00
//
2008-08-06 18:36:30 +00:00
// BOINC is distributed in the hope that it will be useful,
2005-09-26 11:29:28 +00:00
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
2008-08-06 18:36:30 +00:00
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
2005-09-26 11:29:28 +00:00
//
# if defined(__GNUG__) && !defined(__APPLE__)
# pragma implementation "WelcomePage.h"
# endif
2007-01-05 00:24:54 +00:00
//#define __WIZ_DEBUG__
2005-09-26 11:29:28 +00:00
# include "stdwx.h"
2006-10-20 15:00:14 +00:00
# include "diagnostics.h"
# include "util.h"
# include "mfile.h"
# include "miofile.h"
# include "parse.h"
# include "error_numbers.h"
2005-09-26 11:29:28 +00:00
# include "wizardex.h"
# include "error_numbers.h"
# include "BOINCGUIApp.h"
2006-10-20 15:00:14 +00:00
# include "SkinManager.h"
# include "MainDocument.h"
2005-09-26 11:29:28 +00:00
# include "BOINCWizards.h"
# include "BOINCBaseWizard.h"
2006-02-16 19:03:02 +00:00
# include "WizardAttachProject.h"
2009-05-15 08:21:04 +00:00
//#include "WizardAccountManager.h"
2005-09-26 11:29:28 +00:00
# include "WelcomePage.h"
2008-10-14 23:07:40 +00:00
# include "hyperlink.h"
2005-09-26 11:29:28 +00:00
////@begin XPM images
////@end XPM images
/*!
* CWelcomePage type definition
*/
IMPLEMENT_DYNAMIC_CLASS ( CWelcomePage , wxWizardPageEx )
/*!
* CWelcomePage event table definition
*/
BEGIN_EVENT_TABLE ( CWelcomePage , wxWizardPageEx )
////@begin CWelcomePage event table entries
EVT_WIZARDEX_PAGE_CHANGED ( - 1 , CWelcomePage : : OnPageChanged )
EVT_WIZARDEX_PAGE_CHANGING ( - 1 , CWelcomePage : : OnPageChanging )
EVT_WIZARDEX_CANCEL ( - 1 , CWelcomePage : : OnCancel )
2007-03-09 23:44:34 +00:00
EVT_SET_FOCUS ( CWelcomePage : : OnSetFocus )
EVT_SHOW ( CWelcomePage : : OnShow )
2008-10-17 18:37:45 +00:00
EVT_BUTTON ( ID_CHANGEAPPS , CWelcomePage : : OpenWCG )
2009-05-13 12:42:05 +00:00
EVT_RADIOBUTTON ( ID_SELECTPROJECTWIZARD , CWelcomePage : : OnProjectWizardCtrlSelected )
EVT_RADIOBUTTON ( ID_SELECTAMWIZARD , CWelcomePage : : OnAMWizardCtrlSelected )
2005-09-26 11:29:28 +00:00
////@end CWelcomePage event table entries
END_EVENT_TABLE ( )
/*!
* CWelcomePage constructors
*/
CWelcomePage : : CWelcomePage ( )
{
}
CWelcomePage : : CWelcomePage ( CBOINCBaseWizard * parent )
{
Create ( parent ) ;
}
/*!
* WizardPage creator
*/
bool CWelcomePage : : Create ( CBOINCBaseWizard * parent )
{
2008-10-17 18:37:45 +00:00
// Determine if we are the wcg version of the client
// and connect to wcg
wcg = false ;
2008-10-14 23:07:40 +00:00
# if defined (_WCG)
2008-10-17 18:37:45 +00:00
std : : string wcgUrl = " http://www.worldcommunitygrid.org/ " ;
2008-10-14 23:07:40 +00:00
CMainDocument * pDoc = wxGetApp ( ) . GetDocument ( ) ;
2008-10-17 18:37:45 +00:00
if ( pDoc - > state . lookup_project ( wcgUrl ) ) {
wcg = true ;
}
2008-10-14 23:07:40 +00:00
# endif
2005-09-26 11:29:28 +00:00
////@begin CWelcomePage member initialisation
2006-01-27 00:34:53 +00:00
m_pTitleStaticCtrl = NULL ;
m_pDescriptionStaticCtrl = NULL ;
m_pDirectionsStaticCtrl = NULL ;
2009-05-13 12:42:05 +00:00
m_pSelectProjectWizardCtrl = NULL ;
m_pSelectAMWizardCtrl = NULL ;
2007-01-05 00:24:54 +00:00
# if defined(__WIZ_DEBUG__)
2006-01-27 00:34:53 +00:00
m_pErrDescriptionCtrl = NULL ;
m_pErrProjectPropertiesCtrl = NULL ;
m_pErrProjectCommCtrl = NULL ;
m_pErrProjectPropertiesURLCtrl = NULL ;
m_pErrAccountCreationDisabledCtrl = NULL ;
m_pErrClientAccountCreationDisabledCtrl = NULL ;
m_pErrAccountAlreadyExistsCtrl = NULL ;
m_pErrProjectAlreadyAttachedCtrl = NULL ;
m_pErrProjectAttachFailureCtrl = NULL ;
m_pErrGoogleCommCtrl = NULL ;
m_pErrNetDetectionCtrl = NULL ;
2005-09-26 11:29:28 +00:00
# endif
////@end CWelcomePage member initialisation
////@begin CWelcomePage creation
2006-01-25 11:58:02 +00:00
wxBitmap wizardBitmap ( wxNullBitmap ) ;
2007-03-09 23:44:34 +00:00
wxWizardPageEx : : Create ( parent , ID_WELCOMEPAGE , wizardBitmap ) ;
2005-09-26 11:29:28 +00:00
CreateControls ( ) ;
GetSizer ( ) - > Fit ( this ) ;
////@end CWelcomePage creation
return TRUE ;
}
/*!
* Control creation for WizardPage
*/
void CWelcomePage : : CreateControls ( )
{
////@begin CWelcomePage content construction
CWelcomePage * itemWizardPage2 = this ;
wxBoxSizer * itemBoxSizer3 = new wxBoxSizer ( wxVERTICAL ) ;
itemWizardPage2 - > SetSizer ( itemBoxSizer3 ) ;
2006-01-27 00:34:53 +00:00
m_pTitleStaticCtrl = new wxStaticText ;
m_pTitleStaticCtrl - > Create ( itemWizardPage2 , wxID_STATIC , wxEmptyString , wxDefaultPosition , wxSize ( 355 , 24 ) , 0 ) ;
m_pTitleStaticCtrl - > SetFont ( wxFont ( 12 , wxSWISS , wxNORMAL , wxBOLD , FALSE , _T ( " Verdana " ) ) ) ;
itemBoxSizer3 - > Add ( m_pTitleStaticCtrl , 0 , wxALIGN_LEFT | wxALL , 5 ) ;
2005-09-26 11:29:28 +00:00
2006-01-27 00:34:53 +00:00
m_pDescriptionStaticCtrl = new wxStaticText ;
m_pDescriptionStaticCtrl - > Create ( itemWizardPage2 , wxID_STATIC , wxEmptyString , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemBoxSizer3 - > Add ( m_pDescriptionStaticCtrl , 0 , wxALIGN_LEFT | wxALL , 5 ) ;
2005-09-26 11:29:28 +00:00
itemBoxSizer3 - > Add ( 5 , 5 , 0 , wxALIGN_LEFT | wxALL , 5 ) ;
2009-05-13 12:42:05 +00:00
wxFlexGridSizer * itemFlexGridSizer62 = new wxFlexGridSizer ( 2 , 1 , 0 , 0 ) ;
itemFlexGridSizer62 - > AddGrowableCol ( 1 ) ;
itemBoxSizer3 - > Add ( itemFlexGridSizer62 , 0 , wxGROW | wxALL , 5 ) ;
if ( IS_ATTACHTOPROJECTWIZARD ( ) | | IS_ACCOUNTMANAGERWIZARD ( ) ) {
m_pSelectProjectWizardCtrl = new wxRadioButton ;
m_pSelectProjectWizardCtrl - > Create ( itemWizardPage2 , ID_SELECTPROJECTWIZARD , wxEmptyString , wxDefaultPosition , wxDefaultSize , wxRB_GROUP ) ;
m_pSelectProjectWizardCtrl - > SetValue ( TRUE ) ;
itemFlexGridSizer62 - > Add ( m_pSelectProjectWizardCtrl , 0 , wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
m_pSelectAMWizardCtrl = new wxRadioButton ;
m_pSelectAMWizardCtrl - > Create ( itemWizardPage2 , ID_SELECTAMWIZARD , wxEmptyString , wxDefaultPosition , wxDefaultSize , 0 ) ;
m_pSelectAMWizardCtrl - > SetValue ( FALSE ) ;
itemFlexGridSizer62 - > Add ( m_pSelectAMWizardCtrl , 0 , wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
}
2007-01-05 00:24:54 +00:00
# if defined(__WIZ_DEBUG__)
2006-01-27 00:34:53 +00:00
m_pErrDescriptionCtrl = new wxStaticBox ( itemWizardPage2 , wxID_ANY , wxEmptyString ) ;
wxStaticBoxSizer * itemStaticBoxSizer7 = new wxStaticBoxSizer ( m_pErrDescriptionCtrl , wxVERTICAL ) ;
2005-09-26 11:29:28 +00:00
itemBoxSizer3 - > Add ( itemStaticBoxSizer7 , 0 , wxGROW | wxALL , 5 ) ;
wxFlexGridSizer * itemFlexGridSizer8 = new wxFlexGridSizer ( - 1 , 2 , 0 , 0 ) ;
itemFlexGridSizer8 - > AddGrowableCol ( 0 ) ;
itemFlexGridSizer8 - > AddGrowableCol ( 1 ) ;
itemStaticBoxSizer7 - > Add ( itemFlexGridSizer8 , 0 , wxGROW | wxALL , 5 ) ;
2006-01-27 00:34:53 +00:00
m_pErrProjectPropertiesCtrl = new wxCheckBox ;
m_pErrProjectPropertiesCtrl - > Create ( itemWizardPage2 , ID_ERRPROJECTPROPERTIES , wxEmptyString , wxDefaultPosition , wxDefaultSize , wxCHK_2STATE ) ;
m_pErrProjectPropertiesCtrl - > SetValue ( FALSE ) ;
itemFlexGridSizer8 - > Add ( m_pErrProjectPropertiesCtrl , 0 , wxGROW | wxALIGN_CENTER_VERTICAL | wxALL , 0 ) ;
m_pErrProjectCommCtrl = new wxCheckBox ;
m_pErrProjectCommCtrl - > Create ( itemWizardPage2 , ID_ERRPROJECTCOMM , wxEmptyString , wxDefaultPosition , wxDefaultSize , wxCHK_2STATE ) ;
m_pErrProjectCommCtrl - > SetValue ( FALSE ) ;
itemFlexGridSizer8 - > Add ( m_pErrProjectCommCtrl , 0 , wxGROW | wxALIGN_CENTER_VERTICAL | wxALL , 0 ) ;
m_pErrProjectPropertiesURLCtrl = new wxCheckBox ;
m_pErrProjectPropertiesURLCtrl - > Create ( itemWizardPage2 , ID_ERRPROJECTPROPERTIESURL , wxEmptyString , wxDefaultPosition , wxDefaultSize , wxCHK_2STATE ) ;
m_pErrProjectPropertiesURLCtrl - > SetValue ( FALSE ) ;
itemFlexGridSizer8 - > Add ( m_pErrProjectPropertiesURLCtrl , 0 , wxGROW | wxALIGN_CENTER_VERTICAL | wxALL , 0 ) ;
m_pErrAccountCreationDisabledCtrl = new wxCheckBox ;
m_pErrAccountCreationDisabledCtrl - > Create ( itemWizardPage2 , ID_ERRACCOUNTCREATIONDISABLED , wxEmptyString , wxDefaultPosition , wxDefaultSize , wxCHK_2STATE ) ;
m_pErrAccountCreationDisabledCtrl - > SetValue ( FALSE ) ;
itemFlexGridSizer8 - > Add ( m_pErrAccountCreationDisabledCtrl , 0 , wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL , 0 ) ;
m_pErrClientAccountCreationDisabledCtrl = new wxCheckBox ;
m_pErrClientAccountCreationDisabledCtrl - > Create ( itemWizardPage2 , ID_ERRCLIENTACCOUNTCREATIONDISABLED , wxEmptyString , wxDefaultPosition , wxDefaultSize , wxCHK_2STATE ) ;
m_pErrClientAccountCreationDisabledCtrl - > SetValue ( FALSE ) ;
itemFlexGridSizer8 - > Add ( m_pErrClientAccountCreationDisabledCtrl , 0 , wxGROW | wxALIGN_CENTER_VERTICAL | wxALL , 0 ) ;
m_pErrAccountAlreadyExistsCtrl = new wxCheckBox ;
m_pErrAccountAlreadyExistsCtrl - > Create ( itemWizardPage2 , ID_ERRACCOUNTALREADYEXISTS , wxEmptyString , wxDefaultPosition , wxDefaultSize , wxCHK_2STATE ) ;
m_pErrAccountAlreadyExistsCtrl - > SetValue ( FALSE ) ;
itemFlexGridSizer8 - > Add ( m_pErrAccountAlreadyExistsCtrl , 0 , wxGROW | wxALIGN_CENTER_VERTICAL | wxALL , 0 ) ;
m_pErrProjectAlreadyAttachedCtrl = new wxCheckBox ;
m_pErrProjectAlreadyAttachedCtrl - > Create ( itemWizardPage2 , ID_ERRPROJECTALREADYATTACHED , wxEmptyString , wxDefaultPosition , wxDefaultSize , wxCHK_2STATE ) ;
m_pErrProjectAlreadyAttachedCtrl - > SetValue ( FALSE ) ;
itemFlexGridSizer8 - > Add ( m_pErrProjectAlreadyAttachedCtrl , 0 , wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL , 0 ) ;
m_pErrProjectAttachFailureCtrl = new wxCheckBox ;
m_pErrProjectAttachFailureCtrl - > Create ( itemWizardPage2 , ID_ERRPROJECTATTACHFAILURE , wxEmptyString , wxDefaultPosition , wxDefaultSize , wxCHK_2STATE ) ;
m_pErrProjectAttachFailureCtrl - > SetValue ( FALSE ) ;
itemFlexGridSizer8 - > Add ( m_pErrProjectAttachFailureCtrl , 0 , wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL , 0 ) ;
m_pErrGoogleCommCtrl = new wxCheckBox ;
m_pErrGoogleCommCtrl - > Create ( itemWizardPage2 , ID_ERRGOOGLECOMM , wxEmptyString , wxDefaultPosition , wxDefaultSize , wxCHK_2STATE ) ;
m_pErrGoogleCommCtrl - > SetValue ( FALSE ) ;
itemFlexGridSizer8 - > Add ( m_pErrGoogleCommCtrl , 0 , wxGROW | wxALIGN_CENTER_VERTICAL | wxALL , 0 ) ;
2005-09-26 11:29:28 +00:00
itemFlexGridSizer8 - > Add ( 5 , 5 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2006-01-27 00:34:53 +00:00
m_pErrNetDetectionCtrl = new wxCheckBox ;
m_pErrNetDetectionCtrl - > Create ( itemWizardPage2 , ID_ERRNETDETECTION , wxEmptyString , wxDefaultPosition , wxDefaultSize , wxCHK_2STATE ) ;
m_pErrNetDetectionCtrl - > SetValue ( FALSE ) ;
itemFlexGridSizer8 - > Add ( m_pErrNetDetectionCtrl , 0 , wxGROW | wxALIGN_CENTER_VERTICAL | wxALL , 0 ) ;
2005-09-26 11:29:28 +00:00
# endif
2006-01-27 00:34:53 +00:00
m_pDirectionsStaticCtrl = new wxStaticText ;
m_pDirectionsStaticCtrl - > Create ( itemWizardPage2 , wxID_STATIC , wxEmptyString , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemBoxSizer3 - > Add ( m_pDirectionsStaticCtrl , 0 , wxALIGN_LEFT | wxALL , 5 ) ;
2005-09-26 11:29:28 +00:00
2008-10-17 18:37:45 +00:00
if ( wcg ) {
2008-11-18 21:50:00 +00:00
m_pAppButton = new wxButton ( itemWizardPage2 , ID_CHANGEAPPS , _ ( " Change Research Applications at World Community Grid " ) ) ;
itemBoxSizer3 - > Add ( m_pAppButton , 0 , wxALIGN_CENTER , 5 ) ;
2008-10-17 18:37:45 +00:00
}
2008-10-14 23:07:40 +00:00
2007-03-09 23:44:34 +00:00
itemWizardPage2 - > SetSizer ( itemBoxSizer3 ) ;
2005-09-26 11:29:28 +00:00
////@end CWelcomePage content construction
}
2006-01-25 11:58:02 +00:00
2008-10-14 23:07:40 +00:00
/*
2005-09-26 11:29:28 +00:00
* Gets the previous page .
*/
wxWizardPageEx * CWelcomePage : : GetPrev ( ) const
{
return NULL ;
}
/*!
* Gets the next page .
*/
wxWizardPageEx * CWelcomePage : : GetNext ( ) const
{
if ( CHECK_CLOSINGINPROGRESS ( ) ) {
// Cancel Event Detected
return PAGE_TRANSITION_NEXT ( ID_COMPLETIONERRORPAGE ) ;
} else if ( IS_ATTACHTOPROJECTWIZARD ( ) ) {
return PAGE_TRANSITION_NEXT ( ID_PROJECTINFOPAGE ) ;
2006-02-16 19:03:02 +00:00
} else if ( IS_ACCOUNTMANAGERUPDATEWIZARD ( ) | | IS_ACCOUNTMANAGERREMOVEWIZARD ( ) ) {
return PAGE_TRANSITION_NEXT ( ID_ACCOUNTMANAGERPROCESSINGPAGE ) ;
2006-01-27 00:34:53 +00:00
} else if ( IS_ACCOUNTMANAGERWIZARD ( ) ) {
2005-09-26 11:29:28 +00:00
return PAGE_TRANSITION_NEXT ( ID_ACCOUNTMANAGERINFOPAGE ) ;
}
return NULL ;
}
/*!
* Should we show tooltips ?
*/
bool CWelcomePage : : ShowToolTips ( )
{
return TRUE ;
}
/*!
* Get bitmap resources
*/
2006-07-21 08:23:26 +00:00
wxBitmap CWelcomePage : : GetBitmapResource ( const wxString & WXUNUSED ( name ) )
2005-09-26 11:29:28 +00:00
{
// Bitmap retrieval
////@begin CWelcomePage bitmap retrieval
return wxNullBitmap ;
////@end CWelcomePage bitmap retrieval
}
/*!
* Get icon resources
*/
2006-07-21 08:23:26 +00:00
wxIcon CWelcomePage : : GetIconResource ( const wxString & WXUNUSED ( name ) )
2005-09-26 11:29:28 +00:00
{
// Icon retrieval
////@begin CWelcomePage icon retrieval
return wxNullIcon ;
////@end CWelcomePage icon retrieval
}
/*!
* wxEVT_WIZARD_PAGE_CHANGED event handler for ID_WELCOMEPAGE
*/
void CWelcomePage : : OnPageChanged ( wxWizardExEvent & event ) {
2007-03-09 23:44:34 +00:00
wxLogTrace ( wxT ( " Function Start/End " ) , wxT ( " CWelcomePage::OnPageChanged - Function Begin " ) ) ;
2006-01-27 00:34:53 +00:00
if ( event . GetDirection ( ) = = false ) return ;
2007-08-02 20:03:21 +00:00
CMainDocument * pDoc = wxGetApp ( ) . GetDocument ( ) ;
2009-05-15 08:21:04 +00:00
CWizardAttachProject * pWAP = ( ( CWizardAttachProject * ) GetParent ( ) ) ;
2007-08-02 20:03:21 +00:00
ACCT_MGR_INFO ami ;
bool is_acct_mgr_detected = false ;
wxString strBuffer = wxEmptyString ;
2006-02-16 19:03:02 +00:00
2007-08-02 20:03:21 +00:00
wxASSERT ( pDoc ) ;
wxASSERT ( wxDynamicCast ( pDoc , CMainDocument ) ) ;
2006-01-27 00:34:53 +00:00
wxASSERT ( m_pTitleStaticCtrl ) ;
wxASSERT ( m_pDescriptionStaticCtrl ) ;
wxASSERT ( m_pDirectionsStaticCtrl ) ;
2007-01-05 00:24:54 +00:00
# if defined(__WIZ_DEBUG__)
2006-01-27 00:34:53 +00:00
wxASSERT ( m_pErrDescriptionCtrl ) ;
wxASSERT ( m_pErrProjectPropertiesCtrl ) ;
wxASSERT ( m_pErrProjectCommCtrl ) ;
wxASSERT ( m_pErrProjectPropertiesURLCtrl ) ;
wxASSERT ( m_pErrAccountCreationDisabledCtrl ) ;
wxASSERT ( m_pErrClientAccountCreationDisabledCtrl ) ;
wxASSERT ( m_pErrAccountAlreadyExistsCtrl ) ;
wxASSERT ( m_pErrProjectAlreadyAttachedCtrl ) ;
wxASSERT ( m_pErrProjectAttachFailureCtrl ) ;
wxASSERT ( m_pErrGoogleCommCtrl ) ;
wxASSERT ( m_pErrNetDetectionCtrl ) ;
# endif
2009-05-13 12:42:05 +00:00
if ( IS_ATTACHTOPROJECTWIZARD ( ) | | IS_ACCOUNTMANAGERWIZARD ( ) ) {
wxASSERT ( m_pSelectProjectWizardCtrl ) ;
wxASSERT ( m_pSelectAMWizardCtrl ) ;
m_pSelectProjectWizardCtrl - > SetLabel (
_ ( " Attach to project " )
) ;
m_pSelectProjectWizardCtrl - > Show ( ) ;
m_pSelectProjectWizardCtrl - > Enable ( ) ;
m_pSelectAMWizardCtrl - > SetLabel (
_ ( " Attach to account manager " )
) ;
m_pSelectAMWizardCtrl - > Show ( ) ;
}
2006-01-27 00:34:53 +00:00
if ( IS_ATTACHTOPROJECTWIZARD ( ) ) {
2009-05-13 12:42:05 +00:00
m_pSelectProjectWizardCtrl - > SetValue ( true ) ;
m_pSelectAMWizardCtrl - > SetValue ( false ) ;
2007-08-02 20:03:21 +00:00
pDoc - > rpc . acct_mgr_info ( ami ) ;
is_acct_mgr_detected = ami . acct_mgr_url . size ( ) ? true : false ;
if ( is_acct_mgr_detected ) {
m_pTitleStaticCtrl - > SetLabel (
2007-08-11 03:30:03 +00:00
_ ( " Attach to project " )
2007-08-02 20:03:21 +00:00
) ;
strBuffer . Printf (
2008-07-08 20:05:07 +00:00
_ ( " If possible, add projects at the \n %s web site. \n \n Projects added via this wizard will not be \n listed on or managed via %s. " ) ,
2007-08-11 03:30:03 +00:00
wxString ( ami . acct_mgr_name . c_str ( ) , wxConvUTF8 ) . c_str ( ) ,
wxString ( ami . acct_mgr_name . c_str ( ) , wxConvUTF8 ) . c_str ( )
2007-08-02 20:03:21 +00:00
) ;
m_pDescriptionStaticCtrl - > SetLabel (
strBuffer
) ;
2009-05-13 12:42:05 +00:00
m_pSelectAMWizardCtrl - > Disable ( ) ;
2007-08-02 20:03:21 +00:00
} else {
m_pTitleStaticCtrl - > SetLabel (
_ ( " Attach to project " )
) ;
2008-10-14 23:07:40 +00:00
if ( ! wcg ) {
m_pDescriptionStaticCtrl - > SetLabel (
2009-01-27 23:00:19 +00:00
_ ( " We'll now guide you through the process of attaching \n to a project. " )
2008-10-14 23:07:40 +00:00
) ;
} else {
m_pDescriptionStaticCtrl - > SetLabel (
2009-01-27 23:00:19 +00:00
_ ( " You have selected to attach to a new BOINC project. Attaching to a new \n project means that you will be connecting your computer to a new website \n and organization. If this is what you wanted to do, then please click on \n the 'Next' button below. \n \n Some projects like World Community Grid run multiple research applications. \n If you want to change which research applications are sent to your computer \n to run, then you should visit the project's website and modify your \n preferences there. \n \n To change which research applications are sent to you from \n World Community Grid then please click on the following button: " )
2008-10-14 23:07:40 +00:00
) ;
}
2009-05-13 12:42:05 +00:00
m_pSelectAMWizardCtrl - > Enable ( ) ;
2007-08-02 20:03:21 +00:00
}
2006-02-16 19:03:02 +00:00
} else if ( IS_ACCOUNTMANAGERREMOVEWIZARD ( ) ) {
2009-05-15 08:21:04 +00:00
wxASSERT ( pWAP ) ;
wxASSERT ( wxDynamicCast ( pWAP , CWizardAttachProject ) ) ;
2006-02-16 19:03:02 +00:00
strBuffer . Printf (
2007-01-17 20:28:17 +00:00
_ ( " &Stop using%s " ) ,
2009-05-15 08:21:04 +00:00
pWAP - > m_strProjectName . c_str ( )
2006-02-16 19:03:02 +00:00
) ;
m_pTitleStaticCtrl - > SetLabel (
strBuffer
) ;
strBuffer . Printf (
2008-07-08 20:05:07 +00:00
_ ( " We'll now remove this computer from %s. From now on, \n attach and detach projects directly from this computer. \n "
2007-01-06 01:07:35 +00:00
) ,
2009-05-15 08:21:04 +00:00
pWAP - > m_strProjectName . c_str ( )
2006-02-16 19:03:02 +00:00
) ;
m_pDescriptionStaticCtrl - > SetLabel (
strBuffer
) ;
2009-05-13 12:42:05 +00:00
if ( m_pSelectProjectWizardCtrl ) {
m_pSelectProjectWizardCtrl - > SetValue ( false ) ;
m_pSelectProjectWizardCtrl - > Hide ( ) ;
m_pSelectProjectWizardCtrl - > Disable ( ) ;
}
if ( m_pSelectAMWizardCtrl ) {
m_pSelectAMWizardCtrl - > SetValue ( false ) ;
m_pSelectAMWizardCtrl - > Hide ( ) ;
m_pSelectAMWizardCtrl - > Disable ( ) ;
}
2006-01-27 00:34:53 +00:00
} else if ( IS_ACCOUNTMANAGERWIZARD ( ) ) {
2009-05-15 08:21:04 +00:00
wxASSERT ( pWAP ) ;
wxASSERT ( wxDynamicCast ( pWAP , CWizardAttachProject ) ) ;
2006-01-27 00:34:53 +00:00
m_pTitleStaticCtrl - > SetLabel (
_ ( " Account manager " )
) ;
m_pDescriptionStaticCtrl - > SetLabel (
2008-07-08 20:05:07 +00:00
_ ( " We'll now guide you through the process of attaching \n to an account manager. \n \n If you want to attach to a single project, click Cancel, \n then select the 'Attach to project' menu item instead. "
2008-10-17 18:37:45 +00:00
)
2006-01-27 00:34:53 +00:00
) ;
2009-05-13 12:42:05 +00:00
if ( m_pSelectProjectWizardCtrl ) {
m_pSelectProjectWizardCtrl - > SetValue ( false ) ;
m_pSelectProjectWizardCtrl - > Hide ( ) ;
m_pSelectProjectWizardCtrl - > Disable ( ) ;
}
if ( m_pSelectAMWizardCtrl ) {
m_pSelectAMWizardCtrl - > SetValue ( false ) ;
m_pSelectAMWizardCtrl - > Hide ( ) ;
m_pSelectAMWizardCtrl - > Disable ( ) ;
}
2006-01-27 00:34:53 +00:00
} else {
wxASSERT ( FALSE ) ;
}
2007-01-05 00:24:54 +00:00
# if defined(__WIZ_DEBUG__)
2006-01-27 00:34:53 +00:00
m_pErrDescriptionCtrl - > SetLabel (
_ ( " Debug Flags " )
) ;
m_pErrProjectPropertiesCtrl - > SetLabel (
_ ( " Project Properties Failure " )
) ;
m_pErrProjectCommCtrl - > SetLabel (
2008-06-14 20:38:57 +00:00
_ ( " Project Communication Failure " )
2006-01-27 00:34:53 +00:00
) ;
m_pErrProjectPropertiesURLCtrl - > SetLabel (
_ ( " Project Properties URL Failure " )
) ;
m_pErrAccountCreationDisabledCtrl - > SetLabel (
_ ( " Account Creation Disabled " )
) ;
m_pErrClientAccountCreationDisabledCtrl - > SetLabel (
_ ( " Client Account Creation Disabled " )
) ;
m_pErrAccountAlreadyExistsCtrl - > SetLabel (
_ ( " Account Already Exists " )
) ;
m_pErrProjectAlreadyAttachedCtrl - > SetLabel (
_ ( " Project Already Attached " )
) ;
m_pErrProjectAttachFailureCtrl - > SetLabel (
_ ( " Project Attach Failure " )
) ;
m_pErrGoogleCommCtrl - > SetLabel (
2008-06-14 20:38:57 +00:00
_ ( " Failure Communicating with Reference Site " )
2006-01-27 00:34:53 +00:00
) ;
m_pErrNetDetectionCtrl - > SetLabel (
_ ( " Net Detection Failure " )
) ;
# endif
2008-10-17 18:37:45 +00:00
if ( ! wcg ) {
m_pDirectionsStaticCtrl - > SetLabel (
_ ( " To continue, click Next. " )
) ;
}
2006-01-27 00:34:53 +00:00
2006-01-27 08:11:29 +00:00
Fit ( ) ;
2007-03-09 23:44:34 +00:00
wxLogTrace ( wxT ( " Function Start/End " ) , wxT ( " CWelcomePage::OnPageChanged - Function End " ) ) ;
2005-09-26 11:29:28 +00:00
}
/*!
* wxEVT_WIZARD_PAGE_CHANGING event handler for ID_WELCOMEPAGE
*/
void CWelcomePage : : OnPageChanging ( wxWizardExEvent & event ) {
if ( event . GetDirection ( ) = = false ) return ;
unsigned long ulFlags = 0 ;
2007-01-05 00:24:54 +00:00
# if defined(__WIZ_DEBUG__)
2006-01-27 00:34:53 +00:00
if ( m_pErrProjectPropertiesCtrl - > GetValue ( ) ) {
2005-09-26 11:29:28 +00:00
ulFlags | = WIZDEBUG_ERRPROJECTPROPERTIES ;
2006-01-27 00:34:53 +00:00
}
if ( m_pErrProjectPropertiesURLCtrl - > GetValue ( ) ) {
2005-09-26 11:29:28 +00:00
ulFlags | = WIZDEBUG_ERRPROJECTPROPERTIESURL ;
2006-01-27 00:34:53 +00:00
}
if ( m_pErrProjectCommCtrl - > GetValue ( ) ) {
2005-09-26 11:29:28 +00:00
ulFlags | = WIZDEBUG_ERRPROJECTCOMM ;
2006-01-27 00:34:53 +00:00
}
if ( m_pErrGoogleCommCtrl - > GetValue ( ) ) {
2005-09-26 11:29:28 +00:00
ulFlags | = WIZDEBUG_ERRGOOGLECOMM ;
2006-01-27 00:34:53 +00:00
}
if ( m_pErrAccountAlreadyExistsCtrl - > GetValue ( ) ) {
2005-09-26 11:29:28 +00:00
ulFlags | = WIZDEBUG_ERRACCOUNTALREADYEXISTS ;
2006-01-27 00:34:53 +00:00
}
if ( m_pErrAccountCreationDisabledCtrl - > GetValue ( ) ) {
2005-09-26 11:29:28 +00:00
ulFlags | = WIZDEBUG_ERRACCOUNTCREATIONDISABLED ;
2006-01-27 00:34:53 +00:00
}
if ( m_pErrClientAccountCreationDisabledCtrl - > GetValue ( ) ) {
2005-09-26 11:29:28 +00:00
ulFlags | = WIZDEBUG_ERRCLIENTACCOUNTCREATIONDISABLED ;
2006-01-27 00:34:53 +00:00
}
if ( m_pErrProjectAttachFailureCtrl - > GetValue ( ) ) {
2005-09-26 11:29:28 +00:00
ulFlags | = WIZDEBUG_ERRPROJECTATTACH ;
2006-01-27 00:34:53 +00:00
}
if ( m_pErrProjectAlreadyAttachedCtrl - > GetValue ( ) ) {
2005-09-26 11:29:28 +00:00
ulFlags | = WIZDEBUG_ERRPROJECTALREADYATTACHED ;
2006-01-27 00:34:53 +00:00
}
if ( m_pErrNetDetectionCtrl - > GetValue ( ) ) {
2005-09-26 11:29:28 +00:00
ulFlags | = WIZDEBUG_ERRNETDETECTION ;
2006-01-27 00:34:53 +00:00
}
2005-09-26 11:29:28 +00:00
# endif
PROCESS_DEBUG_FLAG ( ulFlags ) ;
}
/*!
* wxEVT_WIZARD_CANCEL event handler for ID_WELCOMEPAGE
*/
void CWelcomePage : : OnCancel ( wxWizardExEvent & event ) {
PROCESS_CANCELEVENT ( event ) ;
}
2007-03-09 23:44:34 +00:00
/*!
* wxEVT_SET_FOCUS event handler for ID_WELCOMEPAGE
*/
void CWelcomePage : : OnSetFocus ( wxFocusEvent & event ) {
wxLogTrace ( wxT ( " Function Start/End " ) , wxT ( " CWelcomePage::OnSetFocus - Function Begin " ) ) ;
event . Skip ( ) ;
wxLogTrace ( wxT ( " Function Start/End " ) , wxT ( " CWelcomePage::OnSetFocus - Function End " ) ) ;
}
/*!
* wxEVT_SHOW event handler for ID_WELCOMEPAGE
*/
void CWelcomePage : : OnShow ( wxShowEvent & event ) {
wxLogTrace ( wxT ( " Function Start/End " ) , wxT ( " CWelcomePage::OnShow - Function Begin " ) ) ;
event . Skip ( ) ;
wxLogTrace ( wxT ( " Function Start/End " ) , wxT ( " CWelcomePage::OnShow - Function End " ) ) ;
}
2008-10-14 23:07:40 +00:00
/*!
* event handler for ID_WELCOMEPAGE
*/
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
void CWelcomePage : : OpenWCG ( wxCommandEvent & /* event */ ) {
2008-10-14 23:07:40 +00:00
wxLogTrace ( wxT ( " Function Start/End " ) , wxT ( " CWelcomePage::OpenWCG - Function Begin " ) ) ;
2008-10-17 18:37:45 +00:00
wxString wcgUrl ( " http://www.worldcommunitygrid.org/ms/viewMyProjects.do " , wxConvUTF8 ) ;
2008-10-14 23:07:40 +00:00
wxHyperLink : : ExecuteLink ( wcgUrl ) ;
2008-10-17 18:37:45 +00:00
CWizardAttachProject * pWAP = ( ( CWizardAttachProject * ) GetParent ( ) ) ;
pWAP - > SimulateCancelButton ( ) ;
2008-10-14 23:07:40 +00:00
wxLogTrace ( wxT ( " Function Start/End " ) , wxT ( " CWelcomePage::OpenWCG- Function End " ) ) ;
}
2009-05-13 12:42:05 +00:00
void CWelcomePage : : OnProjectWizardCtrlSelected ( wxCommandEvent & /* event */ ) {
CBOINCBaseWizard * pBW = ( CWizardAttachProject * ) GetParent ( ) ;
pBW - > IsAttachToProjectWizard = true ;
pBW - > IsAccountManagerWizard = false ;
}
void CWelcomePage : : OnAMWizardCtrlSelected ( wxCommandEvent & /* event */ ) {
CBOINCBaseWizard * pBW = ( CWizardAttachProject * ) GetParent ( ) ;
pBW - > IsAttachToProjectWizard = false ;
pBW - > IsAccountManagerWizard = true ;
}