2005-09-26 11:29:28 +00:00
|
|
|
// Berkeley Open Infrastructure for Network Computing
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2005 University of California
|
|
|
|
//
|
|
|
|
// This 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 2.1 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This software is distributed in the hope that it will be useful,
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// To view the GNU Lesser General Public License visit
|
|
|
|
// http://www.gnu.org/copyleft/lesser.html
|
|
|
|
// or write to the Free Software Foundation, Inc.,
|
|
|
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
//
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma implementation "AccountManagerProcessingPage.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#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"
|
|
|
|
#include "WizardAccountManager.h"
|
|
|
|
#include "AccountManagerProcessingPage.h"
|
|
|
|
#include "AccountManagerInfoPage.h"
|
|
|
|
#include "AccountInfoPage.h"
|
2005-09-29 00:50:19 +00:00
|
|
|
#include "CompletionErrorPage.h"
|
2005-09-26 11:29:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
////@begin XPM images
|
|
|
|
#include "res/wizprogress01.xpm"
|
|
|
|
#include "res/wizprogress02.xpm"
|
|
|
|
#include "res/wizprogress03.xpm"
|
|
|
|
#include "res/wizprogress04.xpm"
|
|
|
|
#include "res/wizprogress05.xpm"
|
|
|
|
#include "res/wizprogress06.xpm"
|
|
|
|
#include "res/wizprogress07.xpm"
|
|
|
|
#include "res/wizprogress08.xpm"
|
|
|
|
#include "res/wizprogress09.xpm"
|
|
|
|
#include "res/wizprogress10.xpm"
|
|
|
|
#include "res/wizprogress11.xpm"
|
|
|
|
#include "res/wizprogress12.xpm"
|
|
|
|
////@end XPM images
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* CAccountManagerProcessingPage custom event definition
|
|
|
|
*/
|
|
|
|
|
|
|
|
DEFINE_EVENT_TYPE(wxEVT_ACCOUNTMANAGERPROCESSING_STATECHANGE)
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* CAccountManagerProcessingPage type definition
|
|
|
|
*/
|
|
|
|
|
|
|
|
IMPLEMENT_DYNAMIC_CLASS( CAccountManagerProcessingPage, wxWizardPageEx )
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* CAccountManagerProcessingPage event table definition
|
|
|
|
*/
|
|
|
|
|
|
|
|
BEGIN_EVENT_TABLE( CAccountManagerProcessingPage, wxWizardPageEx )
|
|
|
|
|
|
|
|
EVT_ACCOUNTMANAGERPROCESSING_STATECHANGE( CAccountManagerProcessingPage::OnStateChange )
|
|
|
|
|
|
|
|
////@begin CAccountManagerProcessingPage event table entries
|
|
|
|
EVT_WIZARDEX_PAGE_CHANGED( -1, CAccountManagerProcessingPage::OnPageChanged )
|
|
|
|
EVT_WIZARDEX_CANCEL( -1, CAccountManagerProcessingPage::OnCancel )
|
|
|
|
|
|
|
|
////@end CAccountManagerProcessingPage event table entries
|
|
|
|
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* CAccountManagerProcessingPage constructors
|
|
|
|
*/
|
|
|
|
|
|
|
|
CAccountManagerProcessingPage::CAccountManagerProcessingPage( )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
CAccountManagerProcessingPage::CAccountManagerProcessingPage( CBOINCBaseWizard* parent )
|
|
|
|
{
|
|
|
|
Create( parent );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* CAttachProjectPage creator
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool CAccountManagerProcessingPage::Create( CBOINCBaseWizard* parent )
|
|
|
|
{
|
|
|
|
////@begin CAccountManagerProcessingPage member initialisation
|
2006-01-27 00:34:53 +00:00
|
|
|
m_pTitleStaticCtrl = NULL;
|
2006-02-01 12:18:10 +00:00
|
|
|
m_pPleaseWaitStaticCtrl = NULL;
|
2006-01-27 00:34:53 +00:00
|
|
|
m_pProgressIndicator = NULL;
|
2005-09-26 11:29:28 +00:00
|
|
|
////@end CAccountManagerProcessingPage member initialisation
|
|
|
|
|
|
|
|
m_bProjectCommunitcationsSucceeded = false;
|
|
|
|
m_bProjectUnavailable = false;
|
|
|
|
m_bProjectAccountAlreadyExists = false;
|
|
|
|
m_iBitmapIndex = 0;
|
|
|
|
m_iCurrentState = ATTACHACCTMGR_INIT;
|
|
|
|
|
|
|
|
////@begin CAccountManagerProcessingPage creation
|
|
|
|
wxBitmap wizardBitmap(wxNullBitmap);
|
|
|
|
wxWizardPageEx::Create( parent, wizardBitmap );
|
|
|
|
|
|
|
|
CreateControls();
|
|
|
|
GetSizer()->Fit(this);
|
|
|
|
////@end CAccountManagerProcessingPage creation
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Control creation for CAttachProjectPage
|
|
|
|
*/
|
|
|
|
|
|
|
|
void CAccountManagerProcessingPage::CreateControls()
|
|
|
|
{
|
|
|
|
////@begin CAccountManagerProcessingPage content construction
|
2006-01-27 00:34:53 +00:00
|
|
|
CAccountManagerProcessingPage* itemWizardPage36 = this;
|
2005-09-26 11:29:28 +00:00
|
|
|
|
2006-01-27 00:34:53 +00:00
|
|
|
wxBoxSizer* itemBoxSizer37 = new wxBoxSizer(wxVERTICAL);
|
|
|
|
itemWizardPage36->SetSizer(itemBoxSizer37);
|
2005-09-26 11:29:28 +00:00
|
|
|
|
2006-01-27 00:34:53 +00:00
|
|
|
m_pTitleStaticCtrl = new wxStaticText;
|
|
|
|
m_pTitleStaticCtrl->Create( itemWizardPage36, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
m_pTitleStaticCtrl->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, FALSE, _T("Verdana")));
|
|
|
|
itemBoxSizer37->Add(m_pTitleStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
|
2005-09-26 11:29:28 +00:00
|
|
|
|
2006-02-01 12:18:10 +00:00
|
|
|
m_pPleaseWaitStaticCtrl = new wxStaticText;
|
|
|
|
m_pPleaseWaitStaticCtrl->Create( itemWizardPage36, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
itemBoxSizer37->Add(m_pPleaseWaitStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
|
|
|
|
|
2006-01-27 00:34:53 +00:00
|
|
|
itemBoxSizer37->Add(5, 80, 0, wxALIGN_LEFT|wxALL, 5);
|
2005-09-26 11:29:28 +00:00
|
|
|
|
2006-01-27 00:34:53 +00:00
|
|
|
wxFlexGridSizer* itemFlexGridSizer40 = new wxFlexGridSizer(1, 3, 0, 0);
|
|
|
|
itemFlexGridSizer40->AddGrowableRow(0);
|
|
|
|
itemFlexGridSizer40->AddGrowableCol(0);
|
|
|
|
itemFlexGridSizer40->AddGrowableCol(1);
|
|
|
|
itemFlexGridSizer40->AddGrowableCol(2);
|
|
|
|
itemBoxSizer37->Add(itemFlexGridSizer40, 0, wxGROW|wxALL, 5);
|
2005-09-26 11:29:28 +00:00
|
|
|
|
2006-01-27 00:34:53 +00:00
|
|
|
itemFlexGridSizer40->Add(5, 5, 0, wxGROW|wxGROW|wxALL, 5);
|
2005-09-26 11:29:28 +00:00
|
|
|
|
2006-01-27 00:34:53 +00:00
|
|
|
wxBitmap itemBitmap41(GetBitmapResource(wxT("res/wizprogress01.xpm")));
|
|
|
|
m_pProgressIndicator = new wxStaticBitmap;
|
|
|
|
m_pProgressIndicator->Create( itemWizardPage36, ID_PROGRESSCTRL, itemBitmap41, wxDefaultPosition, wxSize(184, 48), 0 );
|
|
|
|
itemFlexGridSizer40->Add(m_pProgressIndicator, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
2005-09-26 11:29:28 +00:00
|
|
|
|
2006-01-27 00:34:53 +00:00
|
|
|
itemFlexGridSizer40->Add(5, 5, 0, wxGROW|wxGROW|wxALL, 5);
|
2005-09-26 11:29:28 +00:00
|
|
|
////@end CAccountManagerProcessingPage content construction
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* wxEVT_WIZARD_PAGE_CHANGED event handler for ID_ATTACHPROJECTPAGE
|
|
|
|
*/
|
|
|
|
|
|
|
|
void CAccountManagerProcessingPage::OnPageChanged( wxWizardExEvent& event )
|
|
|
|
{
|
|
|
|
if (event.GetDirection() == false) return;
|
2006-01-27 00:34:53 +00:00
|
|
|
|
2006-02-01 12:18:10 +00:00
|
|
|
CWizardAccountManager* pWAM = ((CWizardAccountManager*)GetParent());
|
|
|
|
|
2006-01-27 00:34:53 +00:00
|
|
|
wxASSERT(m_pTitleStaticCtrl);
|
2006-02-01 12:18:10 +00:00
|
|
|
wxASSERT(m_pPleaseWaitStaticCtrl);
|
2006-01-27 00:34:53 +00:00
|
|
|
wxASSERT(m_pProgressIndicator);
|
2006-02-01 12:18:10 +00:00
|
|
|
wxASSERT(pWAM);
|
|
|
|
|
|
|
|
if (!pWAM->m_strProjectName.IsEmpty()) {
|
|
|
|
wxString str;
|
2006-01-27 00:34:53 +00:00
|
|
|
|
2006-02-01 12:18:10 +00:00
|
|
|
// %s is the project name
|
|
|
|
// i.e. 'BOINC', 'GridRepublic'
|
|
|
|
str.Printf(_("Communicating with %s."), pWAM->m_strProjectName.c_str());
|
|
|
|
|
|
|
|
m_pTitleStaticCtrl->SetLabel(
|
|
|
|
str
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
m_pTitleStaticCtrl->SetLabel(
|
|
|
|
_("Communicating with server.")
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
m_pPleaseWaitStaticCtrl->SetLabel(
|
|
|
|
_("Please wait...")
|
2006-01-27 00:34:53 +00:00
|
|
|
);
|
2005-09-26 11:29:28 +00:00
|
|
|
|
|
|
|
SetProjectCommunitcationsSucceeded(false);
|
|
|
|
SetProjectUnavailable(false);
|
|
|
|
SetProjectAccountAlreadyExists(false);
|
|
|
|
SetNextState(ATTACHACCTMGR_INIT);
|
|
|
|
|
|
|
|
CAccountManagerProcessingPageEvent TransitionEvent(wxEVT_ACCOUNTMANAGERPROCESSING_STATECHANGE, this);
|
|
|
|
AddPendingEvent(TransitionEvent);
|
2006-01-27 00:34:53 +00:00
|
|
|
|
|
|
|
Fit();
|
2005-09-26 11:29:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* wxEVT_WIZARD_CANCEL event handler for ID_ATTACHPROJECTPAGE
|
|
|
|
*/
|
|
|
|
|
|
|
|
void CAccountManagerProcessingPage::OnCancel( wxWizardExEvent& event ) {
|
|
|
|
PROCESS_CANCELEVENT(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* wxEVT_ACCOUNTCREATION_STATECHANGE event handler for ID_ACCOUNTCREATIONPAGE
|
|
|
|
*/
|
|
|
|
|
2006-07-21 08:23:26 +00:00
|
|
|
void CAccountManagerProcessingPage::OnStateChange( CAccountManagerProcessingPageEvent& WXUNUSED(event) )
|
2005-09-26 11:29:28 +00:00
|
|
|
{
|
2006-02-23 08:24:19 +00:00
|
|
|
CMainDocument* pDoc = wxGetApp().GetDocument();
|
|
|
|
CWizardAccountManager* pWAM = ((CWizardAccountManager*)GetParent());
|
2005-09-26 11:29:28 +00:00
|
|
|
wxDateTime dtStartExecutionTime;
|
|
|
|
wxDateTime dtCurrentExecutionTime;
|
|
|
|
wxTimeSpan tsExecutionTime;
|
2005-09-29 00:50:19 +00:00
|
|
|
ACCT_MGR_RPC_REPLY reply;
|
2005-09-30 19:00:53 +00:00
|
|
|
wxString strBuffer = wxEmptyString;
|
2005-09-29 00:50:19 +00:00
|
|
|
std::string url = "";
|
|
|
|
std::string username = "";
|
|
|
|
std::string password = "";
|
2005-09-26 11:29:28 +00:00
|
|
|
bool bPostNewEvent = true;
|
|
|
|
int iReturnValue = 0;
|
2005-09-29 00:50:19 +00:00
|
|
|
unsigned int i;
|
2005-09-26 11:29:28 +00:00
|
|
|
|
|
|
|
wxASSERT(pDoc);
|
|
|
|
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
|
|
|
|
|
|
|
switch(GetCurrentState()) {
|
|
|
|
case ATTACHACCTMGR_INIT:
|
2006-02-23 08:24:19 +00:00
|
|
|
pWAM->DisableNextButton();
|
|
|
|
pWAM->DisableBackButton();
|
2005-09-26 11:29:28 +00:00
|
|
|
|
2006-01-27 00:34:53 +00:00
|
|
|
StartProgress(m_pProgressIndicator);
|
2005-09-26 11:29:28 +00:00
|
|
|
SetNextState(ATTACHACCTMGR_ATTACHACCTMGR_BEGIN);
|
|
|
|
break;
|
|
|
|
case ATTACHACCTMGR_ATTACHACCTMGR_BEGIN:
|
|
|
|
SetNextState(ATTACHACCTMGR_ATTACHACCTMGR_EXECUTE);
|
|
|
|
break;
|
|
|
|
case ATTACHACCTMGR_ATTACHACCTMGR_EXECUTE:
|
2005-09-29 00:50:19 +00:00
|
|
|
// Attempt to attach to the accout manager.
|
2006-03-23 01:17:07 +00:00
|
|
|
url = (const char*)pWAM->m_AccountManagerInfoPage->GetProjectURL().mb_str();
|
|
|
|
username = (const char*)pWAM->m_AccountInfoPage->GetAccountEmailAddress().mb_str();
|
|
|
|
password = (const char*)pWAM->m_AccountInfoPage->GetAccountPassword().mb_str();
|
2005-09-29 00:50:19 +00:00
|
|
|
pDoc->rpc.acct_mgr_rpc(
|
|
|
|
url.c_str(),
|
|
|
|
username.c_str(),
|
|
|
|
password.c_str(),
|
2006-02-23 08:24:19 +00:00
|
|
|
pWAM->m_bCredentialsCached
|
2005-09-29 00:50:19 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
// Wait until we are done processing the request.
|
|
|
|
dtStartExecutionTime = wxDateTime::Now();
|
|
|
|
dtCurrentExecutionTime = wxDateTime::Now();
|
|
|
|
tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime;
|
|
|
|
iReturnValue = 0;
|
|
|
|
reply.error_num = ERR_IN_PROGRESS;
|
|
|
|
while ((!iReturnValue && (ERR_IN_PROGRESS == reply.error_num)) &&
|
|
|
|
tsExecutionTime.GetSeconds() <= 60 &&
|
|
|
|
!CHECK_CLOSINGINPROGRESS()
|
|
|
|
)
|
|
|
|
{
|
2005-09-26 11:29:28 +00:00
|
|
|
dtCurrentExecutionTime = wxDateTime::Now();
|
|
|
|
tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime;
|
2005-09-29 00:50:19 +00:00
|
|
|
iReturnValue = pDoc->rpc.acct_mgr_rpc_poll(reply);
|
|
|
|
|
2006-01-27 00:34:53 +00:00
|
|
|
IncrementProgress(m_pProgressIndicator);
|
2005-09-29 00:50:19 +00:00
|
|
|
|
|
|
|
::wxMilliSleep(500);
|
|
|
|
::wxSafeYield(GetParent());
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!iReturnValue && !reply.error_num && !CHECK_DEBUG_FLAG(WIZDEBUG_ERRPROJECTATTACH)) {
|
|
|
|
SetProjectAttachSucceeded(true);
|
2005-09-26 11:29:28 +00:00
|
|
|
} else {
|
|
|
|
SetProjectAttachSucceeded(false);
|
2006-02-01 12:18:10 +00:00
|
|
|
|
|
|
|
if ((ERR_NOT_FOUND == reply.error_num) ||
|
2006-09-08 22:28:10 +00:00
|
|
|
(ERR_DB_NOT_FOUND == reply.error_num) ||
|
2006-02-01 12:18:10 +00:00
|
|
|
(ERR_BAD_EMAIL_ADDR == reply.error_num) ||
|
|
|
|
(ERR_BAD_PASSWD == reply.error_num) ||
|
|
|
|
CHECK_DEBUG_FLAG(WIZDEBUG_ERRACCOUNTNOTFOUND)) {
|
2006-05-16 20:43:11 +00:00
|
|
|
|
|
|
|
// For any logon error, make sure we do not attempt to use cached credentials
|
|
|
|
// on any follow-ups.
|
|
|
|
pWAM->m_bCredentialsCached = false;
|
2006-02-01 12:18:10 +00:00
|
|
|
SetProjectAccountNotFound(true);
|
|
|
|
} else {
|
|
|
|
SetProjectAccountNotFound(false);
|
|
|
|
}
|
|
|
|
|
2006-02-23 08:24:19 +00:00
|
|
|
strBuffer = pWAM->m_CompletionErrorPage->m_pServerMessagesCtrl->GetLabel();
|
2005-09-30 19:00:53 +00:00
|
|
|
if ((HTTP_STATUS_INTERNAL_SERVER_ERROR == reply.error_num) || CHECK_DEBUG_FLAG(WIZDEBUG_ERRPROJECTPROPERTIESURL)) {
|
2006-02-23 08:24:19 +00:00
|
|
|
strBuffer +=
|
|
|
|
_("An internal server error has occurred.\n");
|
2005-09-30 19:00:53 +00:00
|
|
|
} else {
|
|
|
|
for (i=0; i<reply.messages.size(); i++) {
|
2006-03-23 01:17:07 +00:00
|
|
|
strBuffer += wxString(reply.messages[i].c_str(), wxConvUTF8) + wxString(wxT("\n"));
|
2005-09-30 19:00:53 +00:00
|
|
|
}
|
2005-09-29 00:50:19 +00:00
|
|
|
}
|
2006-02-23 08:24:19 +00:00
|
|
|
pWAM->m_CompletionErrorPage->m_pServerMessagesCtrl->SetLabel(strBuffer);
|
2005-09-26 11:29:28 +00:00
|
|
|
}
|
|
|
|
SetNextState(ATTACHACCTMGR_CLEANUP);
|
|
|
|
break;
|
|
|
|
case ATTACHACCTMGR_CLEANUP:
|
2006-01-27 00:34:53 +00:00
|
|
|
FinishProgress(m_pProgressIndicator);
|
2005-09-26 11:29:28 +00:00
|
|
|
SetNextState(ATTACHACCTMGR_END);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
// Allow a glimps of what the result was before advancing to the next page.
|
|
|
|
wxSleep(1);
|
2006-02-23 08:24:19 +00:00
|
|
|
pWAM->EnableNextButton();
|
|
|
|
pWAM->EnableBackButton();
|
|
|
|
pWAM->SimulateNextButton();
|
2005-09-26 11:29:28 +00:00
|
|
|
bPostNewEvent = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
Update();
|
|
|
|
|
|
|
|
if (bPostNewEvent && !CHECK_CLOSINGINPROGRESS()) {
|
|
|
|
CAccountManagerProcessingPageEvent TransitionEvent(wxEVT_ACCOUNTMANAGERPROCESSING_STATECHANGE, this);
|
|
|
|
AddPendingEvent(TransitionEvent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Gets the previous page.
|
|
|
|
*/
|
|
|
|
|
|
|
|
wxWizardPageEx* CAccountManagerProcessingPage::GetPrev() const
|
|
|
|
{
|
|
|
|
return PAGE_TRANSITION_BACK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Gets the next page.
|
|
|
|
*/
|
|
|
|
|
|
|
|
wxWizardPageEx* CAccountManagerProcessingPage::GetNext() const
|
|
|
|
{
|
|
|
|
if (CHECK_CLOSINGINPROGRESS()) {
|
|
|
|
// Cancel Event Detected
|
|
|
|
return PAGE_TRANSITION_NEXT(ID_COMPLETIONERRORPAGE);
|
2006-01-27 00:34:53 +00:00
|
|
|
} else if (GetProjectAttachSucceeded()) {
|
|
|
|
// We were successful in creating or retrieving an account
|
|
|
|
return PAGE_TRANSITION_NEXT(ID_COMPLETIONPAGE);
|
2006-02-01 12:18:10 +00:00
|
|
|
} else if (!GetProjectCommunitcationsSucceeded() && GetProjectAccountNotFound()) {
|
|
|
|
// The requested account does not exist or the password is bad
|
|
|
|
return PAGE_TRANSITION_NEXT(ID_ERRNOTFOUNDPAGE);
|
2005-09-26 11:29:28 +00:00
|
|
|
} else {
|
|
|
|
// The project much be down for maintenance
|
2005-09-29 00:50:19 +00:00
|
|
|
return PAGE_TRANSITION_NEXT(ID_COMPLETIONERRORPAGE);
|
2005-09-26 11:29:28 +00:00
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Should we show tooltips?
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool CAccountManagerProcessingPage::ShowToolTips()
|
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAccountManagerProcessingPage::StartProgress(wxStaticBitmap* pBitmap) {
|
|
|
|
m_iBitmapIndex = 1;
|
|
|
|
pBitmap->SetBitmap(GetBitmapResource(wxT("res/wizprogress01.xpm")));
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAccountManagerProcessingPage::IncrementProgress(wxStaticBitmap* pBitmap) {
|
|
|
|
m_iBitmapIndex += 1;
|
|
|
|
if (12 < m_iBitmapIndex) m_iBitmapIndex = 1;
|
|
|
|
|
|
|
|
wxString str;
|
|
|
|
str.Printf(wxT("res/wizprogress%02d.xpm"), m_iBitmapIndex);
|
|
|
|
|
|
|
|
pBitmap->SetBitmap(GetBitmapResource(str));
|
|
|
|
Update();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAccountManagerProcessingPage::FinishProgress(wxStaticBitmap* pBitmap) {
|
|
|
|
m_iBitmapIndex = 12;
|
|
|
|
pBitmap->SetBitmap(GetBitmapResource(wxT("res/wizprogress12.xpm")));
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Get bitmap resources
|
|
|
|
*/
|
|
|
|
|
|
|
|
wxBitmap CAccountManagerProcessingPage::GetBitmapResource( const wxString& name )
|
|
|
|
{
|
|
|
|
// Bitmap retrieval
|
|
|
|
if (name == wxT("res/wizprogress01.xpm"))
|
|
|
|
{
|
|
|
|
wxBitmap bitmap(wizprogress01_xpm);
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
else if (name == wxT("res/wizprogress02.xpm"))
|
|
|
|
{
|
|
|
|
wxBitmap bitmap(wizprogress02_xpm);
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
else if (name == wxT("res/wizprogress03.xpm"))
|
|
|
|
{
|
|
|
|
wxBitmap bitmap(wizprogress03_xpm);
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
else if (name == wxT("res/wizprogress04.xpm"))
|
|
|
|
{
|
|
|
|
wxBitmap bitmap(wizprogress04_xpm);
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
else if (name == wxT("res/wizprogress05.xpm"))
|
|
|
|
{
|
|
|
|
wxBitmap bitmap(wizprogress05_xpm);
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
else if (name == wxT("res/wizprogress06.xpm"))
|
|
|
|
{
|
|
|
|
wxBitmap bitmap(wizprogress06_xpm);
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
else if (name == wxT("res/wizprogress07.xpm"))
|
|
|
|
{
|
|
|
|
wxBitmap bitmap(wizprogress07_xpm);
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
else if (name == wxT("res/wizprogress08.xpm"))
|
|
|
|
{
|
|
|
|
wxBitmap bitmap(wizprogress08_xpm);
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
else if (name == wxT("res/wizprogress09.xpm"))
|
|
|
|
{
|
|
|
|
wxBitmap bitmap(wizprogress09_xpm);
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
else if (name == wxT("res/wizprogress10.xpm"))
|
|
|
|
{
|
|
|
|
wxBitmap bitmap(wizprogress10_xpm);
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
else if (name == wxT("res/wizprogress11.xpm"))
|
|
|
|
{
|
|
|
|
wxBitmap bitmap(wizprogress11_xpm);
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
else if (name == wxT("res/wizprogress12.xpm"))
|
|
|
|
{
|
|
|
|
wxBitmap bitmap(wizprogress12_xpm);
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
return wxNullBitmap;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Get icon resources
|
|
|
|
*/
|
|
|
|
|
2006-07-21 08:23:26 +00:00
|
|
|
wxIcon CAccountManagerProcessingPage::GetIconResource( const wxString& WXUNUSED(name) )
|
2005-09-26 11:29:28 +00:00
|
|
|
{
|
|
|
|
// Icon retrieval
|
|
|
|
////@begin CAccountManagerProcessingPage icon retrieval
|
|
|
|
return wxNullIcon;
|
|
|
|
////@end CAccountManagerProcessingPage icon retrieval
|
|
|
|
}
|
|
|
|
|