*** empty log message ***

svn path=/trunk/boinc/; revision=7213
This commit is contained in:
Rom Walton 2005-08-09 09:55:45 +00:00
parent 8f66bece15
commit c60612875b
11 changed files with 1883 additions and 1587 deletions

View File

@ -10133,3 +10133,23 @@ Bruce August 8, 2005
sched/
file_deleter.C
Rom 8 Aug 2005
- Fix build breaks and reenable the lookup website code with
a changed prototype.
- Figured out how to automatically advance from one wizard page
to the next. Yes, I know it breaks convention.
- Remove extra text on the project properties page.
- Display the hourglass cursor while executing the project
properties page.
client/
acct_setup.C, .h
client_state.h
file_names.h
gui_rpc_server_ops.C
clientgui/
BOINCGUI.pjd
WizAttachProject.cpp, .h
lib/
gui_rpc_client.h
gui_rpc_client_ops.C

View File

@ -121,13 +121,10 @@ void CREATE_ACCOUNT_OP::handle_reply(int http_op_retval) {
}
}
#if 0
int LOOKUP_GOOGLE_OP::do_rpc() {
int LOOKUP_WEBSITE_OP::do_rpc(string& url) {
int retval;
string url;
url = "http://www.google.com/";
retval = gstate.gui_http.do_rpc(this, url, LOOKUP_GOOGLE_FILENAME);
retval = gstate.gui_http.do_rpc(this, url, LOOKUP_WEBSITE_FILENAME);
if (retval) {
error_num = retval;
} else {
@ -136,43 +133,6 @@ int LOOKUP_GOOGLE_OP::do_rpc() {
return retval;
}
void LOOKUP_GOOGLE_OP::handle_reply(int http_op_retval) {
if (http_op_retval) {
error_num = http_op_retval;
} else {
FILE* f = fopen(LOOKUP_GOOGLE_FILENAME, "r");
if (f) {
file_to_str(f, reply);
fclose(f);
}
error_num = BOINC_SUCCESS;
}
void LOOKUP_WEBSITE_OP::handle_reply(int http_op_retval) {
error_num = http_op_retval;
}
int LOOKUP_YAHOO_OP::do_rpc() {
int retval;
string url;
url = "http://www.yahoo.com/";
retval = gstate.gui_http.do_rpc(this, url, LOOKUP_YAHOO_FILENAME);
if (retval) {
error_num = retval;
} else {
error_num = ERR_IN_PROGRESS;
}
return retval;
}
void LOOKUP_YAHOO_OP::handle_reply(int http_op_retval) {
if (http_op_retval) {
error_num = http_op_retval;
} else {
FILE* f = fopen(LOOKUP_YAHOO_FILENAME, "r");
if (f) {
file_to_str(f, reply);
fclose(f);
}
error_num = BOINC_SUCCESS;
}
}
#endif

View File

@ -59,24 +59,12 @@ struct CREATE_ACCOUNT_OP: public GUI_HTTP_OP {
CREATE_ACCOUNT_OP(){error_num = BOINC_SUCCESS;}
};
#if 0
struct LOOKUP_GOOGLE_OP: public GUI_HTTP_OP {
std::string reply;
struct LOOKUP_WEBSITE_OP: public GUI_HTTP_OP {
int error_num;
int do_rpc();
int do_rpc(std::string&);
virtual void handle_reply(int http_op_retval);
LOOKUP_GOOGLE_OP(){error_num = BOINC_SUCCESS;}
LOOKUP_WEBSITE_OP(){error_num = BOINC_SUCCESS;}
};
struct LOOKUP_YAHOO_OP: public GUI_HTTP_OP {
std::string reply;
int error_num;
int do_rpc();
virtual void handle_reply(int http_op_retval);
LOOKUP_YAHOO_OP(){error_num = BOINC_SUCCESS;}
};
#endif
#endif

View File

@ -100,10 +100,7 @@ public:
GET_PROJECT_CONFIG_OP get_project_config_op;
LOOKUP_ACCOUNT_OP lookup_account_op;
CREATE_ACCOUNT_OP create_account_op;
#if 0
LOOKUP_GOOGLE_OP lookup_google_op;
LOOKUP_YAHOO_OP lookup_yahoo_op;
#endif
LOOKUP_WEBSITE_OP lookup_website_op;
int core_client_major_version;
int core_client_minor_version;

View File

@ -75,7 +75,6 @@ extern void get_master_filename(PROJECT&, char*);
#define GET_PROJECT_CONFIG_FILENAME "get_project_config.xml"
#define LOOKUP_ACCOUNT_FILENAME "lookup_account.xml"
#define CREATE_ACCOUNT_FILENAME "create_account.xml"
#define LOOKUP_GOOGLE_FILENAME "lookup_google.html"
#define LOOKUP_YAHOO_FILENAME "lookup_yahoo.html"
#define LOOKUP_WEBSITE_FILENAME "lookup_website.html"
#endif

View File

@ -560,28 +560,27 @@ static void handle_create_account_poll(char*, MIOFILE& fout) {
}
}
#if 0
static void handle_lookup_google(char*, MIOFILE&) {
gstate.lookup_google_op.do_rpc();
static void handle_lookup_website(char* buf, MIOFILE& fout) {
std::string url;
if (match_tag(buf, "<yahoo")) {
url = "http://www.yahoo.com/";
gstate.lookup_website_op.do_rpc(url);
} else if (match_tag(buf, "<google")) {
url = "http://www.google.com/";
gstate.lookup_website_op.do_rpc(url);
} else {
fout.printf("<error>Invalid website</error>\n");
return;
}
fout.printf("<success/>\n");
}
static void handle_lookup_google_poll(char*, MIOFILE& fout) {
static void handle_lookup_website_poll(char*, MIOFILE& fout) {
fout.printf("<lookup_website>\n");
fout.printf(" <error_num>%d</error_num>\n", gstate.lookup_google_op.error_num);
fout.printf(" <error_num>%d</error_num>\n", gstate.lookup_website_op.error_num);
fout.printf("</lookup_website>\n");
}
static void handle_lookup_yahoo(char*, MIOFILE&) {
gstate.lookup_yahoo_op.do_rpc();
}
static void handle_lookup_yahoo_poll(char*, MIOFILE& fout) {
fout.printf("<lookup_website>\n");
fout.printf(" <error_num>%d</error_num>\n", gstate.lookup_yahoo_op.error_num);
fout.printf("</lookup_website>\n");
}
#endif
int GUI_RPC_CONN::handle_rpc() {
char request_msg[4096];
int n;
@ -719,16 +718,10 @@ int GUI_RPC_CONN::handle_rpc() {
handle_create_account(request_msg, mf);
} else if (match_tag(request_msg, "<create_account_poll")) {
handle_create_account_poll(request_msg, mf);
#if 0
} else if (match_tag(request_msg, "<lookup_google_poll")) {
handle_lookup_google_poll(request_msg, mf);
} else if (match_tag(request_msg, "<lookup_google")) {
handle_lookup_google(request_msg, mf);
} else if (match_tag(request_msg, "<lookup_yahoo_poll")) {
handle_lookup_yahoo_poll(request_msg, mf);
} else if (match_tag(request_msg, "<lookup_yahoo")) {
handle_lookup_yahoo(request_msg, mf);
#endif
} else if (match_tag(request_msg, "<lookup_website_poll")) {
handle_lookup_website_poll(request_msg, mf);
} else if (match_tag(request_msg, "<lookup_website")) {
handle_lookup_website(request_msg, mf);
} else {
mf.printf("<error>unrecognized op</error>\n");
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -55,6 +55,7 @@ class CErrProxyInfoPage;
class CErrProxyHTTPPage;
class CErrProxySOCKSPage;
class CErrProxyComplationPage;
class CErrRefCountPage;
////@end forward declarations
/*!
@ -80,12 +81,6 @@ class CErrProxyComplationPage;
#define ID_PROJECTPROPERTIESPAGE 10017
#define ID_RETRPROJECTPROPERTIESIMAGECTRL 10018
#define ID_RETRPROJECTPROPERTIESCTRL 10019
#define ID_COMMYAHOOIMAGECTRL 10010
#define ID_COMMYAHOOCTRL 10011
#define ID_COMMGOOGLEIMAGECTRL 10012
#define ID_COMMGOOGLECTRL 10013
#define ID_DETERMINECONNECTIONSTATUSIMAGECTRL 10014
#define ID_DETERMINECONNECTIONSTATUSCTRL 10015
#define ID_FINALPROJECTPROPERTIESTATUSCTRL 10026
#define ID_ACCOUNTKEYPAGE 10054
#define ID_ACCOUNTKEYSTATICCTRL 10074
@ -131,6 +126,7 @@ class CErrProxyComplationPage;
#define ID_PROXYSOCKSPASSWORDSTATICCTRL 10069
#define ID_PROXYSOCKSPASSWORDCTRL 10005
#define ID_ERRPROXYCOMPLETIONPAGE 10063
#define ID_ERRREFCOUNTPAGE 10075
////@end control identifiers
/*!
@ -186,6 +182,11 @@ public:
////@end CWizAttachProject event handler declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_BACKWARD
void OnWizardBack( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_FORWARD
void OnWizardNext( wxCommandEvent& event );
////@begin CWizAttachProject member function declarations
/// Runs the wizard.
@ -202,6 +203,12 @@ public:
virtual bool HasNextPage( wxWizardPage* page );
virtual bool HasPrevPage( wxWizardPage* page );
wxButton* GetBackButton() const { return m_pbtnBack ; }
void SetBackButton(wxButton* value) { m_pbtnBack = value ; }
wxButton* GetNextButton() const { return m_pbtnNext ; }
void SetNextButton(wxButton* value) { m_pbtnNext = value ; }
/// Diagnostics functions
void SetDiagFlags( unsigned long ulFlags );
bool IsDiagFlagsSet( unsigned long ulFlags );
@ -229,8 +236,15 @@ public:
CErrProxyHTTPPage* m_ErrProxyHTTPPage;
CErrProxySOCKSPage* m_ErrProxySOCKSPage;
CErrProxyComplationPage* m_ErrProxyCompletionPage;
CErrRefCountPage* m_ErrRefCountPage;
////@end CWizAttachProject member variables
// Since the buttons are not publically exposed, we are going to cheat to get
// the pointers to them by trapping the click event and caching the button
// class pointers.
wxButton* m_pbtnBack; // the "<Back" button
wxButton* m_pbtnNext; // the "Next>" or "Finish" button
// Wizard support
unsigned long m_ulDiagFlags;
std::stack<wxWizardPage*> m_PageTransition;
@ -289,14 +303,30 @@ public:
static bool ShowToolTips();
////@begin CWelcomePage member variables
#if defined(__WXDEBUG__)
wxCheckBox* m_ErrProjectPropertiesCtrl;
#endif
#if defined(__WXDEBUG__)
wxCheckBox* m_ErrProjectCommCtrl;
#endif
#if defined(__WXDEBUG__)
wxCheckBox* m_ErrProjectPropertiesURLCtrl;
#endif
#if defined(__WXDEBUG__)
wxCheckBox* m_ErrAccountCreationDisabledCtrl;
#endif
#if defined(__WXDEBUG__)
wxCheckBox* m_ErrAccountAlreadyExistsCtrl;
#endif
#if defined(__WXDEBUG__)
wxCheckBox* m_ErrGoogleCommCtrl;
#endif
#if defined(__WXDEBUG__)
wxCheckBox* m_ErrYahooCommCtrl;
#endif
#if defined(__WXDEBUG__)
wxCheckBox* m_ErrNetDetectionCtrl;
#endif
////@end CWelcomePage member variables
};
@ -390,7 +420,8 @@ END_DECLARE_EVENT_TYPES()
#define PROJPROP_COMMUNICATEGOOGLE_EXECUTE 6
#define PROJPROP_DETERMINENETWORKSTATUS_BEGIN 7
#define PROJPROP_DETERMINENETWORKSTATUS_EXECUTE 8
#define PROJPROP_END 9
#define PROJPROP_CLEANUP 9
#define PROJPROP_END 10
/*!
* CProjectPropertiesPage class declaration
@ -464,12 +495,6 @@ public:
////@begin CProjectPropertiesPage member variables
wxStaticBitmap* m_RetrProjectPropertiesImageCtrl;
wxStaticText* m_RetrProjectPropertiesCtrl;
wxStaticBitmap* m_CommYahooImageCtrl;
wxStaticText* m_CommYahooCtrl;
wxStaticBitmap* m_CommGoogleImageCtrl;
wxStaticText* m_CommGoogleCtrl;
wxStaticBitmap* m_DetermineConnectionStatusImageCtrl;
wxStaticText* m_DetermineConnectionStatusCtrl;
wxStaticText* m_FinalProjectPropertiesStatusCtrl;
////@end CProjectPropertiesPage member variables
@ -1200,5 +1225,52 @@ public:
////@end CErrProxyComplationPage member variables
};
/*!
* CErrRefCountPage class declaration
*/
class CErrRefCountPage: public wxWizardPage
{
DECLARE_DYNAMIC_CLASS( CErrRefCountPage )
DECLARE_EVENT_TABLE()
public:
/// Constructors
CErrRefCountPage( );
CErrRefCountPage( wxWizard* parent );
/// Creation
bool Create( wxWizard* parent );
/// Creates the controls and sizers
void CreateControls();
////@begin CErrRefCountPage event handler declarations
////@end CErrRefCountPage event handler declarations
////@begin CErrRefCountPage member function declarations
/// Gets the previous page.
virtual wxWizardPage* GetPrev() const;
/// Gets the next page.
virtual wxWizardPage* GetNext() const;
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end CErrRefCountPage member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin CErrRefCountPage member variables
////@end CErrRefCountPage member variables
};
#endif
// _WIZATTACHPROJECT_H_

View File

@ -37,6 +37,18 @@
#define GUI_RPC_PORT 1043
#define GUI_RPC_PORT_ALT 31416
// official HTTP status codes
//
#define HTTP_STATUS_OK 200
#define HTTP_STATUS_PARTIAL_CONTENT 206
#define HTTP_STATUS_RANGE_REQUEST_ERROR 416
#define HTTP_STATUS_MOVED_PERM 301
#define HTTP_STATUS_MOVED_TEMP 302
#define HTTP_STATUS_NOT_FOUND 404
#define HTTP_STATUS_PROXY_AUTH_REQ 407
#define HTTP_STATUS_INTERNAL_SERVER_ERROR 500
#define HTTP_STATUS_SERVICE_UNAVAILABLE 503
#define RUN_MODE_ALWAYS 0
#define RUN_MODE_NEVER 1
#define RUN_MODE_AUTO 2
@ -63,18 +75,6 @@
#define SS_STATUS_QUIT 8
#define SS_STATUS_NOPROJECTSDETECTED 9
// official HTTP status codes
//
#define HTTP_STATUS_OK 200
#define HTTP_STATUS_PARTIAL_CONTENT 206
#define HTTP_STATUS_RANGE_REQUEST_ERROR 416
#define HTTP_STATUS_MOVED_PERM 301
#define HTTP_STATUS_MOVED_TEMP 302
#define HTTP_STATUS_NOT_FOUND 404
#define HTTP_STATUS_PROXY_AUTH_REQ 407
#define HTTP_STATUS_INTERNAL_SERVER_ERROR 500
#define HTTP_STATUS_SERVICE_UNAVAILABLE 503
// These MUST match the constants in client/client_msgs.h
//
#define MSG_PRIORITY_INFO 1
@ -86,6 +86,11 @@
#define MSG_PRIORITY_ALERT_ERROR 5
// show error message in a modal dialog
// Which websites can we lookup?
//
#define LOOKUP_GOOGLE 1
#define LOOKUP_YAHOO 2
struct GUI_URL {
std::string name;
std::string description;
@ -434,7 +439,7 @@ struct PROJECT_CONFIG {
int error_num;
std::string name;
int min_passwd_length;
bool uses_username_id;
bool uses_email_id;
bool account_creation_disabled;
PROJECT_CONFIG();
@ -442,6 +447,7 @@ struct PROJECT_CONFIG {
int parse(MIOFILE&);
void print();
void clear();
};
struct ACCOUNT_IN {
@ -465,9 +471,9 @@ struct ACCOUNT_OUT {
int parse(MIOFILE&);
void print();
void clear();
};
#if 0
struct LOOKUP_WEBSITE {
int error_num;
@ -477,7 +483,6 @@ struct LOOKUP_WEBSITE {
int parse(MIOFILE&);
void clear();
};
#endif
class RPC_CLIENT {
public:
@ -554,12 +559,8 @@ public:
int lookup_account_poll(ACCOUNT_OUT&);
int create_account(ACCOUNT_IN&);
int create_account_poll(ACCOUNT_OUT&);
#if 0
int lookup_google();
int lookup_google_poll();
int lookup_yahoo();
int lookup_yahoo_poll();
#endif
int lookup_website(int);
int lookup_website_poll();
};
struct RPC {

View File

@ -793,8 +793,8 @@ int PROJECT_CONFIG::parse(MIOFILE& in) {
else if (parse_int(buf, "<error_num>", error_num)) return error_num;
else if (parse_str(buf, "<name>", name)) continue;
else if (parse_int(buf, "<min_passwd_length>", min_passwd_length)) continue;
else if (match_tag(buf, "<uses_username_id/>")) {
uses_username_id = true;
else if (match_tag(buf, "<uses_email_id/>")) {
uses_email_id = true;
continue;
}
else if (match_tag(buf, "<account_creation_disabled/>")) {
@ -809,7 +809,7 @@ void PROJECT_CONFIG::clear() {
error_num = -1;
name.clear();
min_passwd_length = 6;
uses_username_id = false;
uses_email_id = true;
account_creation_disabled = false;
}
@ -839,7 +839,8 @@ ACCOUNT_OUT::~ACCOUNT_OUT() {
int ACCOUNT_OUT::parse(MIOFILE& in) {
char buf[256];
while (in.fgets(buf, 256)) {
if (parse_int(buf, "<error_num>", error_num)) continue;
if (match_tag(buf, "</account_out>")) return 0;
if (parse_int(buf, "<error_num>", error_num)) return error_num;
if (parse_str(buf, "<authenticator>", authenticator)) continue;
}
return 0;
@ -850,7 +851,6 @@ void ACCOUNT_OUT::clear() {
authenticator.clear();
}
#if 0
LOOKUP_WEBSITE::LOOKUP_WEBSITE() {
clear();
}
@ -862,18 +862,15 @@ LOOKUP_WEBSITE::~LOOKUP_WEBSITE() {
int LOOKUP_WEBSITE::parse(MIOFILE& in) {
char buf[256];
while (in.fgets(buf, 256)) {
if (match_tag(buf, "<in_progress")) return ERR_IN_PROGRESS;
if (parse_int(buf, "<uses_email_id>", uses_email_id)) continue;
if (parse_str(buf, "<name>", name)) continue;
if (parse_int(buf, "<min_passwd_length>", min_passwd_length)) continue;
if (match_tag(buf, "</lookup_website>")) return 0;
if (parse_int(buf, "<error_num>", error_num)) return error_num;
}
return 0;
return ERR_XML_PARSE;
}
void LOOKUP_WEBSITE::clear() {
error_num = 0;
}
#endif
/////////// END OF PARSING FUNCTIONS. RPCS START HERE ////////////////
@ -1562,34 +1559,27 @@ int RPC_CLIENT::create_account_poll(ACCOUNT_OUT& ao) {
return ao.parse(rpc.fin);
}
#if 0
int RPC_CLIENT::lookup_google() {
int RPC_CLIENT::lookup_website(int website_id) {
char buf[4096];
RPC rpc(this);
return rpc.do_rpc("<lookup_google/>\n");
if ((website_id < LOOKUP_GOOGLE) || (website_id > LOOKUP_YAHOO)) return ERR_INVALID_PARAM;
sprintf(buf,
"<lookup_website>\n"
" %s%s\n"
"</lookup_website>\n",
(LOOKUP_GOOGLE == website_id)?"<google/>":"",
(LOOKUP_YAHOO == website_id)?"<yahoo/>":""
);
return rpc.do_rpc(buf);
}
int RPC_CLIENT::lookup_google_poll() {
int RPC_CLIENT::lookup_website_poll() {
RPC rpc(this);
LOOKUP_WEBSITE lw;
int retval;
retval = rpc.do_rpc("<lookup_google_poll/>\n");
retval = rpc.do_rpc("<lookup_website_poll/>\n");
if (retval) return retval;
return lw.parse(rpc.fin);
}
int RPC_CLIENT::lookup_yahoo() {
RPC rpc(this);
return rpc.do_rpc("<lookup_yahoo/>\n");
}
int RPC_CLIENT::lookup_yahoo_poll() {
RPC rpc(this);
LOOKUP_WEBSITE lw;
int retval;
retval = rpc.do_rpc("<lookup_yahoo_poll/>\n");
if (retval) return retval;
return lw.parse(rpc.fin);
}
#endif