- MGR: Make the error message processing work for the

get_project_config rpc, use the same scheme as
        the ACCOUNT_OUT structure.
    
    clientgui/
        ProjectProcessingPage.cpp
        ProjectPropertiesPage.cpp, .h
    lib/
        gui_rpc_client.h
        gui_rpc_client_ops.cpp

svn path=/trunk/boinc/; revision=16557
This commit is contained in:
Rom Walton 2008-11-25 17:34:29 +00:00
parent ee7a4d5a88
commit 269e8db2e7
6 changed files with 46 additions and 7 deletions

View File

@ -9589,3 +9589,15 @@ David 24 Nov 2008
html/ops/
bossa_admin.php
Rom 25 Nov 2008
- MGR: Make the error message processing work for the
get_project_config rpc, use the same scheme as
the ACCOUNT_OUT structure.
clientgui/
ProjectProcessingPage.cpp
ProjectPropertiesPage.cpp, .h
lib/
gui_rpc_client.h
gui_rpc_client_ops.cpp

View File

@ -192,7 +192,7 @@ wxWizardPageEx* CProjectProcessingPage::GetNext() const
// The requested account does not exist or the password is bad
return PAGE_TRANSITION_NEXT(ID_ERRNOTFOUNDPAGE);
} else {
// Ann error must have occurred
// An error must have occurred
return PAGE_TRANSITION_NEXT(ID_COMPLETIONERRORPAGE);
}
return NULL;

View File

@ -37,6 +37,7 @@
#include "WizardAttachProject.h"
#include "ProjectPropertiesPage.h"
#include "ProjectInfoPage.h"
#include "CompletionErrorPage.h"
////@begin XPM images
@ -111,6 +112,7 @@ bool CProjectPropertiesPage::Create( CBOINCBaseWizard* parent )
m_bProjectAccountCreationDisabled = false;
m_bProjectClientAccountCreationDisabled = false;
m_bNetworkConnectionDetected = false;
m_bServerReportedError = false;
m_iBitmapIndex = 0;
m_iCurrentState = PROJPROP_INIT;
@ -192,6 +194,9 @@ wxWizardPageEx* CProjectPropertiesPage::GetNext() const
} else if (GetProjectPropertiesURLFailure()) {
// Not a BOINC based project
return PAGE_TRANSITION_NEXT(ID_ERRNOTDETECTEDPAGE);
} else if (GetServerReportedError()) {
// Server reported an error, display the error
return PAGE_TRANSITION_NEXT(ID_COMPLETIONERRORPAGE);
} else {
// The project must be down for maintenance
return PAGE_TRANSITION_NEXT(ID_ERRUNAVAILABLEPAGE);
@ -359,6 +364,7 @@ void CProjectPropertiesPage::OnStateChange( CProjectPropertiesPageEvent& WXUNUSE
wxDateTime dtStartExecutionTime;
wxDateTime dtCurrentExecutionTime;
wxTimeSpan tsExecutionTime;
wxString strBuffer = wxEmptyString;
bool bPostNewEvent = true;
bool bSuccessfulCondition = false;
int iReturnValue = 0;
@ -442,6 +448,7 @@ void CProjectPropertiesPage::OnStateChange( CProjectPropertiesPageEvent& WXUNUSE
SetNextState(PROJPROP_CLEANUP);
} else {
SetProjectPropertiesSucceeded(false);
bSuccessfulCondition =
(!iReturnValue) && (ERR_FILE_NOT_FOUND == pc->error_num) ||
(!iReturnValue) && (ERR_GETHOSTBYNAME == pc->error_num) ||
@ -451,6 +458,25 @@ void CProjectPropertiesPage::OnStateChange( CProjectPropertiesPageEvent& WXUNUSE
} else {
SetProjectPropertiesURLFailure(false);
}
bSuccessfulCondition =
((!iReturnValue) && (ERR_FILE_NOT_FOUND != pc->error_num)) &&
((!iReturnValue) && (ERR_GETHOSTBYNAME != pc->error_num)) &&
((!iReturnValue) && (ERR_XML_PARSE != pc->error_num)) &&
(!iReturnValue);
if (bSuccessfulCondition || CHECK_DEBUG_FLAG(WIZDEBUG_ERRPROJECTPROPERTIESURL)) {
SetServerReportedError(true);
strBuffer = pWAP->m_CompletionErrorPage->m_pServerMessagesCtrl->GetLabel();
if (pc->error_msg.size()) {
strBuffer += wxString(pc->error_msg.c_str(), wxConvUTF8) + wxString(wxT("\n"));
}
pWAP->m_CompletionErrorPage->m_pServerMessagesCtrl->SetLabel(strBuffer);
} else {
SetServerReportedError(false);
}
SetNextState(PROJPROP_DETERMINENETWORKSTATUS_BEGIN);
}
break;

View File

@ -124,6 +124,9 @@ public:
bool GetNetworkConnectionDetected() const { return m_bNetworkConnectionDetected ; }
void SetNetworkConnectionDetected(bool value) { m_bNetworkConnectionDetected = value ; }
bool GetServerReportedError() const { return m_bServerReportedError ; }
void SetServerReportedError(bool value) { m_bServerReportedError = value ; }
wxInt32 GetCurrentState() const { return m_iCurrentState ; }
void SetNextState(wxInt32 value) { m_iCurrentState = value ; }
@ -145,6 +148,7 @@ public:
bool m_bProjectClientAccountCreationDisabled;
bool m_bProjectAlreadyAttached;
bool m_bNetworkConnectionDetected;
bool m_bServerReportedError;
int m_iBitmapIndex;
int m_iCurrentState;
};

View File

@ -461,7 +461,7 @@ struct PROJECT_CONFIG {
bool uses_username;
bool account_creation_disabled;
bool client_account_creation_disabled;
std::vector<std::string> messages;
std::string error_msg;
std::string terms_of_use;
// if present, show this text in an "accept terms of use?" dialog
// before allowing attachment to continue.

View File

@ -911,10 +911,7 @@ int PROJECT_CONFIG::parse(MIOFILE& in) {
if (parse_bool(buf, "uses_username", uses_username)) continue;
if (parse_bool(buf, "account_creation_disabled", account_creation_disabled)) continue;
if (parse_bool(buf, "client_account_creation_disabled", client_account_creation_disabled)) continue;
if (parse_str(buf, "<message>", msg)) {
messages.push_back(msg);
continue;
}
if (parse_str(buf, "<error_msg>", error_msg)) continue;
if (parse_str(buf, "<terms_of_use>", msg)) {
while (in.fgets(buf, 256)) {
if (match_tag(buf, "</terms_of_use>")) break;
@ -929,7 +926,7 @@ int PROJECT_CONFIG::parse(MIOFILE& in) {
void PROJECT_CONFIG::clear() {
error_num = 0;
name.clear();
messages.clear();
error_msg.clear();
terms_of_use.clear();
min_passwd_length = 6;
account_manager = false;