1
// This file is part of BOINC.
2
// http://boinc.berkeley.edu
3
// Copyright (C) 2008 University of California
5
// BOINC is free software; you can redistribute it and/or modify it
6
// under the terms of the GNU Lesser General Public License
7
// as published by the Free Software Foundation,
8
// either version 3 of the License, or (at your option) any later version.
10
// BOINC is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
// See the GNU Lesser General Public License for more details.
15
// You should have received a copy of the GNU Lesser General Public License
16
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
18
#if defined(__GNUG__) && !defined(__APPLE__)
19
#pragma implementation "WizardAttach.h"
23
#include "diagnostics.h"
28
#include "error_numbers.h"
30
#include "error_numbers.h"
32
#include "BOINCGUIApp.h"
33
#include "SkinManager.h"
34
#include "MainDocument.h"
35
#include "BOINCBaseWizard.h"
36
#include "BOINCBaseFrame.h"
37
#include "ProjectListCtrl.h"
38
#include "WizardAttach.h"
39
#include "WelcomePage.h"
40
#include "ProjectInfoPage.h"
41
#include "ProjectPropertiesPage.h"
42
#include "ProjectProcessingPage.h"
43
#include "AccountManagerInfoPage.h"
44
#include "AccountManagerPropertiesPage.h"
45
#include "AccountManagerProcessingPage.h"
46
#include "TermsOfUsePage.h"
47
#include "AccountInfoPage.h"
48
#include "CompletionPage.h"
49
#include "CompletionErrorPage.h"
50
#include "NotDetectedPage.h"
51
#include "UnavailablePage.h"
52
#include "NoInternetConnectionPage.h"
53
#include "NotFoundPage.h"
54
#include "AlreadyExistsPage.h"
55
#include "ProxyInfoPage.h"
56
#include "ProxyPage.h"
60
* CWizardAttach type definition
63
IMPLEMENT_DYNAMIC_CLASS( CWizardAttach, CBOINCBaseWizard )
66
* CWizardAttach event table definition
69
BEGIN_EVENT_TABLE( CWizardAttach, CBOINCBaseWizard )
70
////@begin CWizardAttach event table entries
71
EVT_WIZARDEX_FINISHED( ID_ATTACHWIZARD, CWizardAttach::OnFinished )
72
////@end CWizardAttach event table entries
76
* CWizardAttach constructors
79
CWizardAttach::CWizardAttach()
83
CWizardAttach::CWizardAttach( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, long style )
85
Create(parent, id, title, pos, style);
89
* CWizardAttach creator
92
bool CWizardAttach::Create( wxWindow* parent, wxWindowID id, const wxString& /* title */, const wxPoint& pos, long style )
95
////@begin CWizardAttach member initialisation
97
m_ProjectInfoPage = NULL;
98
m_ProjectPropertiesPage = NULL;
99
m_ProjectProcessingPage = NULL;
100
m_AccountManagerInfoPage = NULL;
101
m_AccountManagerPropertiesPage = NULL;
102
m_AccountManagerProcessingPage = NULL;
103
m_TermsOfUsePage = NULL;
104
m_AccountInfoPage = NULL;
105
m_CompletionPage = NULL;
106
m_CompletionErrorPage = NULL;
107
m_ErrNotDetectedPage = NULL;
108
m_ErrUnavailablePage = NULL;
109
m_ErrNoInternetConnectionPage = NULL;
110
m_ErrNotFoundPage = NULL;
111
m_ErrAlreadyExistsPage = NULL;
112
m_ErrProxyInfoPage = NULL;
113
m_ErrProxyPage = NULL;
114
////@end CWizardAttach member initialisation
117
m_bCancelInProgress = false;
120
IsAttachToProjectWizard = true;
121
IsAccountManagerWizard = false;
122
IsAccountManagerUpdateWizard = false;
124
// Global wizard status
125
project_config.clear();
128
account_created_successfully = false;
129
attached_to_project_successfully = false;
130
close_when_completed = false;
131
m_strProjectName.Empty();
132
m_strProjectUrl.Empty();
133
m_strProjectAuthenticator.Empty();
134
m_strTeamName.Empty();
135
m_strReturnURL.Empty();
136
m_bCredentialsCached = false;
137
m_bCredentialsDetected = false;
138
m_bCookieRequired = false;
139
m_strCookieFailureURL.Empty();
142
CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
143
CSkinWizardATP* pSkinWizardATP = wxGetApp().GetSkinManager()->GetWizards()->GetWizardATP();
145
wxASSERT(pSkinAdvanced);
146
wxASSERT(pSkinWizardATP);
147
wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));
148
wxASSERT(wxDynamicCast(pSkinWizardATP, CSkinWizardATP));
152
if (!pSkinWizardATP->GetWizardTitle().IsEmpty()) {
153
strTitle = pSkinWizardATP->GetWizardTitle();
155
strTitle = pSkinAdvanced->GetApplicationName();
158
////@begin CWizardAttach creation
159
CBOINCBaseWizard::Create( parent, id, strTitle, pos, style );
162
////@end CWizardAttach creation
168
* Control creation for CWizardAttach
171
void CWizardAttach::CreateControls()
173
wxLogTrace(wxT("Function Start/End"), wxT("CWizardAttach::CreateControls - Function Begin"));
175
////@begin CWizardAttach content construction
176
CWizardAttach* itemWizard1 = this;
178
m_WelcomePage = new CWelcomePage;
179
m_WelcomePage->Create( itemWizard1 );
180
GetPageAreaSizer()->Add(m_WelcomePage);
182
m_AccountManagerInfoPage = new CAccountManagerInfoPage;
183
m_AccountManagerInfoPage->Create( itemWizard1 );
184
GetPageAreaSizer()->Add(m_AccountManagerInfoPage);
186
m_AccountManagerPropertiesPage = new CAccountManagerPropertiesPage;
187
m_AccountManagerPropertiesPage->Create( itemWizard1 );
188
GetPageAreaSizer()->Add(m_AccountManagerPropertiesPage);
190
m_AccountManagerProcessingPage = new CAccountManagerProcessingPage;
191
m_AccountManagerProcessingPage->Create( itemWizard1 );
192
GetPageAreaSizer()->Add(m_AccountManagerProcessingPage);
194
m_ProjectInfoPage = new CProjectInfoPage;
195
m_ProjectInfoPage->Create( itemWizard1 );
196
GetPageAreaSizer()->Add(m_ProjectInfoPage);
198
m_ProjectPropertiesPage = new CProjectPropertiesPage;
199
m_ProjectPropertiesPage->Create( itemWizard1 );
200
GetPageAreaSizer()->Add(m_ProjectPropertiesPage);
202
m_ProjectProcessingPage = new CProjectProcessingPage;
203
m_ProjectProcessingPage->Create( itemWizard1 );
204
GetPageAreaSizer()->Add(m_ProjectProcessingPage);
206
m_AccountInfoPage = new CAccountInfoPage;
207
m_AccountInfoPage->Create( itemWizard1 );
208
GetPageAreaSizer()->Add(m_AccountInfoPage);
210
m_TermsOfUsePage = new CTermsOfUsePage;
211
m_TermsOfUsePage->Create( itemWizard1 );
212
GetPageAreaSizer()->Add(m_TermsOfUsePage);
214
m_CompletionPage = new CCompletionPage;
215
m_CompletionPage->Create( itemWizard1 );
216
GetPageAreaSizer()->Add(m_CompletionPage);
218
m_CompletionErrorPage = new CCompletionErrorPage;
219
m_CompletionErrorPage->Create( itemWizard1 );
220
GetPageAreaSizer()->Add(m_CompletionErrorPage);
222
m_ErrNotDetectedPage = new CErrNotDetectedPage;
223
m_ErrNotDetectedPage->Create( itemWizard1 );
224
GetPageAreaSizer()->Add(m_ErrNotDetectedPage);
226
m_ErrUnavailablePage = new CErrUnavailablePage;
227
m_ErrUnavailablePage->Create( itemWizard1 );
228
GetPageAreaSizer()->Add(m_ErrUnavailablePage);
230
m_ErrNoInternetConnectionPage = new CErrNoInternetConnectionPage;
231
m_ErrNoInternetConnectionPage->Create( itemWizard1 );
232
GetPageAreaSizer()->Add(m_ErrNoInternetConnectionPage);
234
m_ErrNotFoundPage = new CErrNotFoundPage;
235
m_ErrNotFoundPage->Create( itemWizard1 );
236
GetPageAreaSizer()->Add(m_ErrNotFoundPage);
238
m_ErrAlreadyExistsPage = new CErrAlreadyExistsPage;
239
m_ErrAlreadyExistsPage->Create( itemWizard1 );
240
GetPageAreaSizer()->Add(m_ErrAlreadyExistsPage);
242
m_ErrProxyInfoPage = new CErrProxyInfoPage;
243
m_ErrProxyInfoPage->Create( itemWizard1 );
244
GetPageAreaSizer()->Add(m_ErrProxyInfoPage);
246
m_ErrProxyPage = new CErrProxyPage;
247
m_ErrProxyPage->Create( itemWizard1 );
248
GetPageAreaSizer()->Add(m_ErrProxyPage);
250
////@end CWizardAttach content construction
252
wxLogTrace(wxT("Function Status"), wxT("CWizardAttach::CreateControls - Begin Page Map"));
255
wxT("Function Status"),
256
wxT("CWizardAttach::CreateControls - m_WelcomePage = id: '%d', location: '%p', height: '%d', width: '%d'"),
257
m_WelcomePage->GetId(), m_WelcomePage, m_WelcomePage->GetBestSize().GetHeight(), m_WelcomePage->GetBestSize().GetWidth()
260
wxT("Function Status"),
261
wxT("CWizardAttach::CreateControls - m_ProjectInfoPage = id: '%d', location: '%p', height: '%d', width: '%d'"),
262
m_ProjectInfoPage->GetId(), m_ProjectInfoPage, m_ProjectInfoPage->GetBestSize().GetHeight(), m_ProjectInfoPage->GetBestSize().GetWidth()
265
wxT("Function Status"),
266
wxT("CWizardAttach::CreateControls - m_ProjectPropertiesPage = id: '%d', location: '%p', height: '%d', width: '%d'"),
267
m_ProjectPropertiesPage->GetId(), m_ProjectPropertiesPage, m_ProjectPropertiesPage->GetBestSize().GetHeight(), m_ProjectPropertiesPage->GetBestSize().GetWidth()
270
wxT("Function Status"),
271
wxT("CWizardAttach::CreateControls - m_ProjectProcessingPage = id: '%d', location: '%p', height: '%d', width: '%d'"),
272
m_ProjectProcessingPage->GetId(), m_ProjectProcessingPage, m_ProjectProcessingPage->GetBestSize().GetHeight(), m_ProjectProcessingPage->GetBestSize().GetWidth()
275
wxT("Function Status"),
276
wxT("CWizardAttach::CreateControls - m_AccountManagerInfoPage = id: '%d', location: '%p', height: '%d', width: '%d'"),
277
m_AccountManagerInfoPage->GetId(), m_AccountManagerInfoPage, m_AccountManagerInfoPage->GetBestSize().GetHeight(), m_AccountManagerInfoPage->GetBestSize().GetWidth()
280
wxT("Function Status"),
281
wxT("CWizardAttach::CreateControls - m_AccountManagerPropertiesPage = id: '%d', location: '%p', height: '%d', width: '%d'"),
282
m_AccountManagerPropertiesPage->GetId(), m_AccountManagerPropertiesPage, m_AccountManagerPropertiesPage->GetBestSize().GetHeight(), m_AccountManagerPropertiesPage->GetBestSize().GetWidth()
285
wxT("Function Status"),
286
wxT("CWizardAttach::CreateControls - m_AccountManagerProcessingPage = id: '%d', location: '%p', height: '%d', width: '%d'"),
287
m_AccountManagerProcessingPage->GetId(), m_AccountManagerProcessingPage, m_AccountManagerProcessingPage->GetBestSize().GetHeight(), m_AccountManagerProcessingPage->GetBestSize().GetWidth()
290
wxT("Function Status"),
291
wxT("CWizardAttach::CreateControls - m_TermsOfUsePage = id: '%d', location: '%p', height: '%d', width: '%d'"),
292
m_TermsOfUsePage->GetId(), m_TermsOfUsePage, m_TermsOfUsePage->GetBestSize().GetHeight(), m_TermsOfUsePage->GetBestSize().GetWidth()
295
wxT("Function Status"),
296
wxT("CWizardAttach::CreateControls - m_AccountInfoPage = id: '%d', location: '%p', height: '%d', width: '%d'"),
297
m_AccountInfoPage->GetId(), m_AccountInfoPage, m_AccountInfoPage->GetBestSize().GetHeight(), m_AccountInfoPage->GetBestSize().GetWidth()
300
wxT("Function Status"),
301
wxT("CWizardAttach::CreateControls - m_CompletionPage = id: '%d', location: '%p', height: '%d', width: '%d'"),
302
m_CompletionPage->GetId(), m_CompletionPage, m_CompletionPage->GetBestSize().GetHeight(), m_CompletionPage->GetBestSize().GetWidth()
305
wxT("Function Status"),
306
wxT("CWizardAttach::CreateControls - m_CompletionErrorPage = id: '%d', location: '%p', height: '%d', width: '%d'"),
307
m_CompletionErrorPage->GetId(), m_CompletionErrorPage, m_CompletionErrorPage->GetBestSize().GetHeight(), m_CompletionErrorPage->GetBestSize().GetWidth()
310
wxT("Function Status"),
311
wxT("CWizardAttach::CreateControls - m_ErrNotDetectedPage = id: '%d', location: '%p', height: '%d', width: '%d'"),
312
m_ErrNotDetectedPage->GetId(), m_ErrNotDetectedPage, m_ErrNotDetectedPage->GetBestSize().GetHeight(), m_ErrNotDetectedPage->GetBestSize().GetWidth()
315
wxT("Function Status"),
316
wxT("CWizardAttach::CreateControls - m_ErrUnavailablePage = id: '%d', location: '%p', height: '%d', width: '%d'"),
317
m_ErrUnavailablePage->GetId(), m_ErrUnavailablePage, m_ErrUnavailablePage->GetBestSize().GetHeight(), m_ErrUnavailablePage->GetBestSize().GetWidth()
320
wxT("Function Status"),
321
wxT("CWizardAttach::CreateControls - m_ErrNoInternetConnectionPage = id: '%d', location: '%p', height: '%d', width: '%d'"),
322
m_ErrNoInternetConnectionPage->GetId(), m_ErrNoInternetConnectionPage, m_ErrNoInternetConnectionPage->GetBestSize().GetHeight(), m_ErrNoInternetConnectionPage->GetBestSize().GetWidth()
325
wxT("Function Status"),
326
wxT("CWizardAttach::CreateControls - m_ErrNotFoundPage = id: '%d', location: '%p', height: '%d', width: '%d'"),
327
m_ErrNotFoundPage->GetId(), m_ErrNotFoundPage, m_ErrNotFoundPage->GetBestSize().GetHeight(), m_ErrNotFoundPage->GetBestSize().GetWidth()
330
wxT("Function Status"),
331
wxT("CWizardAttach::CreateControls - m_ErrAlreadyExistsPage = id: '%d', location: '%p', height: '%d', width: '%d'"),
332
m_ErrAlreadyExistsPage->GetId(), m_ErrAlreadyExistsPage, m_ErrAlreadyExistsPage->GetBestSize().GetHeight(), m_ErrAlreadyExistsPage->GetBestSize().GetWidth()
335
wxT("Function Status"),
336
wxT("CWizardAttach::CreateControls - m_ErrProxyInfoPage = id: '%d', location: '%p', height: '%d', width: '%d'"),
337
m_ErrProxyInfoPage->GetId(), m_ErrProxyInfoPage, m_ErrProxyInfoPage->GetBestSize().GetHeight(), m_ErrProxyInfoPage->GetBestSize().GetWidth()
340
wxT("Function Status"),
341
wxT("CWizardAttach::CreateControls - m_ErrProxyPage = id: '%d', location: '%p', height: '%d', width: '%d'"),
342
m_ErrProxyPage->GetId(), m_ErrProxyPage, m_ErrProxyPage->GetBestSize().GetHeight(), m_ErrProxyPage->GetBestSize().GetWidth()
345
wxLogTrace(wxT("Function Status"), wxT("CWizardAttach::CreateControls - End Page Map"));
346
wxLogTrace(wxT("Function Start/End"), wxT("CWizardAttach::CreateControls - Function End"));
352
bool CWizardAttach::Run(
353
wxString& WXUNUSED(strName), wxString& strURL, wxString& strTeamName,
354
bool bCredentialsCached
356
m_strTeamName = strTeamName;
358
if (strURL.Length()) {
359
m_ProjectInfoPage->SetProjectURL( strURL );
360
m_bCredentialsCached = bCredentialsCached;
363
// If credentials are not cached, then we should try one last place to look up the
364
// authenticator. Some projects will set a "Setup" cookie off of their URL with a
365
// pretty short timeout. Lets take a crack at detecting it.
367
if (!strURL.IsEmpty() && !bCredentialsCached) {
368
std::string url = std::string(strURL.mb_str());
369
std::string authenticator;
371
if (detect_setup_authenticator(url, authenticator)) {
372
m_bCredentialsDetected = true;
373
close_when_completed = true;
374
SetProjectAuthenticator(wxString(authenticator.c_str(), wxConvUTF8));
378
if (strURL.Length() && m_ProjectPropertiesPage) {
379
return RunWizard(m_ProjectPropertiesPage);
380
} else if (m_WelcomePage) {
381
return RunWizard(m_WelcomePage);
388
bool CWizardAttach::SyncToAccountManager() {
390
CMainDocument* pDoc = wxGetApp().GetDocument();
393
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
395
IsAttachToProjectWizard = false;
396
IsAccountManagerWizard = true;
398
pDoc->rpc.acct_mgr_info(ami);
400
if (ami.acct_mgr_url.size()) {
401
m_AccountManagerInfoPage->SetProjectURL(
402
wxString(ami.acct_mgr_url.c_str(), wxConvUTF8)
404
m_bCredentialsCached = ami.have_credentials;
405
m_bCookieRequired = ami.cookie_required;
406
m_strCookieFailureURL = wxString(ami.cookie_failure_url.c_str(), wxConvUTF8);
408
if (m_bCredentialsCached) {
409
IsAccountManagerUpdateWizard = true;
413
if (ami.acct_mgr_url.size() && !m_bCredentialsCached) {
415
std::string password_hash;
416
std::string return_url;
418
if (detect_account_manager_credentials(ami.acct_mgr_url, login, password_hash, return_url)) {
420
wxString strPasswordHash;
421
wxString strReturnURL;
423
strLogin = wxURL::Unescape( wxString(login.c_str(), wxConvUTF8) );
424
strPasswordHash = wxURL::Unescape( wxString(password_hash.c_str(), wxConvUTF8) );
425
strReturnURL = wxURL::Unescape( wxString(return_url.c_str(), wxConvUTF8) );
427
m_AccountInfoPage->SetAccountEmailAddress( strLogin );
428
m_AccountInfoPage->SetAccountPassword(
429
wxString(_T("hash:")) +
432
m_strReturnURL = strReturnURL;
433
m_bCredentialsDetected = true;
437
if (m_AccountManagerPropertiesPage) {
438
return RunWizard(m_AccountManagerPropertiesPage);
445
* Should we show tooltips?
448
bool CWizardAttach::ShowToolTips()
454
* Get bitmap resources
457
wxBitmap CWizardAttach::GetBitmapResource( const wxString& WXUNUSED(name) )
460
////@begin CWizardAttach bitmap retrieval
462
////@end CWizardAttach bitmap retrieval
469
wxIcon CWizardAttach::GetIconResource( const wxString& WXUNUSED(name) )
472
////@begin CWizardAttach icon retrieval
474
////@end CWizardAttach icon retrieval
478
* Determine if the wizard page has a next page
481
bool CWizardAttach::HasNextPage( wxWizardPageEx* page )
483
bool bNoNextPageDetected = false;
485
bNoNextPageDetected |= (page == m_CompletionPage);
486
bNoNextPageDetected |= (page == m_CompletionErrorPage);
487
bNoNextPageDetected |= (page == m_ErrNotDetectedPage);
488
bNoNextPageDetected |= (page == m_ErrUnavailablePage);
489
bNoNextPageDetected |= (page == m_ErrNoInternetConnectionPage);
490
bNoNextPageDetected |= (page == m_ErrAlreadyExistsPage);
492
if (bNoNextPageDetected)
498
* Determine if the wizard page has a previous page
501
bool CWizardAttach::HasPrevPage( wxWizardPageEx* page )
503
if ((page == m_WelcomePage) || (page == m_CompletionPage) || (page == m_CompletionErrorPage))
509
* Remove the page transition from the stack.
511
wxWizardPageEx* CWizardAttach::_PopPageTransition() {
512
wxWizardPageEx* pPage = NULL;
513
if (GetCurrentPage()) {
514
if (m_PageTransition.size() > 0) {
515
pPage = m_PageTransition.top();
516
m_PageTransition.pop();
517
if ((pPage == m_ProjectPropertiesPage) || (pPage == m_ProjectProcessingPage) ||
518
(pPage == m_AccountManagerPropertiesPage) || (pPage == m_AccountManagerProcessingPage))
520
// We want to go back to the page before we attempted to communicate
522
pPage = m_PageTransition.top();
523
m_PageTransition.pop();
533
* Add the page transition to the stack.
535
wxWizardPageEx* CWizardAttach::_PushPageTransition( wxWizardPageEx* pCurrentPage, unsigned long ulPageID ) {
536
if (GetCurrentPage()) {
537
wxWizardPageEx* pPage = NULL;
539
if (ID_WELCOMEPAGE == ulPageID)
540
pPage = m_WelcomePage;
542
if (ID_PROJECTINFOPAGE == ulPageID)
543
pPage = m_ProjectInfoPage;
545
if (ID_PROJECTPROPERTIESPAGE == ulPageID)
546
pPage = m_ProjectPropertiesPage;
548
if (ID_PROJECTPROCESSINGPAGE == ulPageID)
549
pPage = m_ProjectProcessingPage;
551
if (ID_ACCOUNTMANAGERINFOPAGE == ulPageID)
552
pPage = m_AccountManagerInfoPage;
554
if (ID_ACCOUNTMANAGERPROPERTIESPAGE == ulPageID)
555
pPage = m_AccountManagerPropertiesPage;
557
if (ID_ACCOUNTMANAGERPROCESSINGPAGE == ulPageID)
558
pPage = m_AccountManagerProcessingPage;
560
if (ID_TERMSOFUSEPAGE == ulPageID)
561
pPage = m_TermsOfUsePage;
563
if (ID_ACCOUNTINFOPAGE == ulPageID)
564
pPage = m_AccountInfoPage;
566
if (ID_COMPLETIONPAGE == ulPageID)
567
pPage = m_CompletionPage;
569
if (ID_COMPLETIONERRORPAGE == ulPageID)
570
pPage = m_CompletionErrorPage;
572
if (ID_ERRNOTDETECTEDPAGE == ulPageID)
573
pPage = m_ErrNotDetectedPage;
575
if (ID_ERRUNAVAILABLEPAGE == ulPageID)
576
pPage = m_ErrUnavailablePage;
578
if (ID_ERRNOINTERNETCONNECTIONPAGE == ulPageID)
579
pPage = m_ErrNoInternetConnectionPage;
581
if (ID_ERRNOTFOUNDPAGE == ulPageID)
582
pPage = m_ErrNotFoundPage;
584
if (ID_ERRALREADYEXISTSPAGE == ulPageID)
585
pPage = m_ErrAlreadyExistsPage;
587
if (ID_ERRPROXYINFOPAGE == ulPageID)
588
pPage = m_ErrProxyInfoPage;
590
if (ID_ERRPROXYPAGE == ulPageID)
591
pPage = m_ErrProxyPage;
594
if (m_PageTransition.size() == 0) {
595
m_PageTransition.push(NULL);
597
if (m_PageTransition.top() != pCurrentPage) {
598
m_PageTransition.push(pCurrentPage);
606
void CWizardAttach::_ProcessCancelEvent( wxWizardExEvent& event ) {
608
bool bCancelWithoutNextPage = false;
609
wxWizardPageEx* page = GetCurrentPage();
611
int iRetVal = wxGetApp().SafeMessageBox(
612
_("Do you really want to cancel?"),
614
wxICON_QUESTION | wxYES_NO,
618
// Reenable the next and back buttons if they have been disabled
619
GetNextButton()->Enable();
620
GetBackButton()->Enable();
622
// Page specific rules - Disable the validator(s)
623
if (wxYES == iRetVal) {
624
if ((page == m_ProjectInfoPage) || (page == m_AccountManagerInfoPage)) {
625
m_ProjectInfoPage->m_pProjectUrlCtrl->SetValidator(wxDefaultValidator);
626
} else if (page == m_AccountInfoPage) {
627
m_AccountInfoPage->m_pAccountEmailAddressCtrl->SetValidator(wxDefaultValidator);
628
m_AccountInfoPage->m_pAccountPasswordCtrl->SetValidator(wxDefaultValidator);
629
if (IsAttachToProjectWizard) {
630
m_AccountInfoPage->m_pAccountConfirmPasswordCtrl->SetValidator(wxDefaultValidator);
632
} else if (page == m_ErrProxyPage) {
633
m_ErrProxyPage->m_pProxyHTTPServerCtrl->SetValidator(wxDefaultValidator);
634
m_ErrProxyPage->m_pProxyHTTPPortCtrl->SetValidator(wxDefaultValidator);
635
m_ErrProxyPage->m_pProxyHTTPUsernameCtrl->SetValidator(wxDefaultValidator);
636
m_ErrProxyPage->m_pProxyHTTPPasswordCtrl->SetValidator(wxDefaultValidator);
637
m_ErrProxyPage->m_pProxySOCKSServerCtrl->SetValidator(wxDefaultValidator);
638
m_ErrProxyPage->m_pProxySOCKSPortCtrl->SetValidator(wxDefaultValidator);
639
m_ErrProxyPage->m_pProxySOCKSUsernameCtrl->SetValidator(wxDefaultValidator);
640
m_ErrProxyPage->m_pProxySOCKSPasswordCtrl->SetValidator(wxDefaultValidator);
645
bCancelWithoutNextPage |= (page == m_ErrNotDetectedPage);
646
bCancelWithoutNextPage |= (page == m_ErrUnavailablePage);
647
bCancelWithoutNextPage |= (page == m_ErrNoInternetConnectionPage);
648
if (IsAttachToProjectWizard) {
649
bCancelWithoutNextPage |= (page == m_ErrAlreadyExistsPage);
651
bCancelWithoutNextPage |= (page == m_WelcomePage);
653
if (wxYES != iRetVal) {
659
* wxEVT_WIZARD_FINISHED event handler for ID_ATTACHPROJECTWIZARD
662
void CWizardAttach::OnFinished( wxWizardExEvent& event ) {
664
if (IsAccountManagerWizard) {
665
// Attached to an account manager
666
if (!m_strReturnURL.empty() && GetAttachedToProjectSuccessfully()) {
667
wxLaunchDefaultBrowser(m_strReturnURL);
670
// Attached to a project
671
if (GetAccountCreatedSuccessfully() && GetAttachedToProjectSuccessfully()) {
672
wxLaunchDefaultBrowser(GetProjectURL() + wxT("account_finish.php?auth=") + GetProjectAuthenticator());
676
// Let the framework clean things up.