diff --git a/checkin_notes b/checkin_notes index 3add06d4ac..d138fa9b7a 100644 --- a/checkin_notes +++ b/checkin_notes @@ -10682,3 +10682,9 @@ David 23 Dec 2009 lib/ notice.cpp,h parse.cpp + +David 23 Dec 2009 + - internal change: rename MSG_USER_ERROR to MSG_USER_ALERT + + client/, clientgui/, lib/ + various files diff --git a/client/acct_mgr.cpp b/client/acct_mgr.cpp index a91f79a3aa..789a266559 100644 --- a/client/acct_mgr.cpp +++ b/client/acct_mgr.cpp @@ -366,14 +366,14 @@ void ACCT_MGR_OP::handle_reply(int http_op_retval) { // email addresses // if (error_str.size()) { - msg_printf(NULL, MSG_USER_ERROR, + msg_printf(NULL, MSG_USER_ALERT, "Account manager error: %d %s", error_num, error_str.c_str() ); if (!error_num) { error_num = ERR_XML_PARSE; } } else if (error_num) { - msg_printf(NULL, MSG_USER_ERROR, + msg_printf(NULL, MSG_USER_ALERT, "Account manager error: %s", boincerror(error_num) ); } diff --git a/client/acct_setup.cpp b/client/acct_setup.cpp index ae1ca95a32..c03b3d71d5 100644 --- a/client/acct_setup.cpp +++ b/client/acct_setup.cpp @@ -249,13 +249,13 @@ void GET_CURRENT_VERSION_OP::handle_reply(int http_op_retval) { while (fgets(buf, 256, f)) { if (match_tag(buf, "")) { if (parse_version(f, new_version)) { - msg_printf(0, MSG_USER_ERROR, - "A new version of BOINC (%s) is available for your computer", + msg_printf(0, MSG_USER_ALERT, + "A new version of BOINC (%s) is available", new_version ); - msg_printf(0, MSG_USER_ERROR, - "Visit %s to get it.", + msg_printf(0, MSG_USER_ALERT, + "Visit %s to download it", config.client_download_url.c_str() ); gstate.newer_version = string(new_version); diff --git a/client/app.cpp b/client/app.cpp index 7f5882e449..cbe15ee119 100644 --- a/client/app.cpp +++ b/client/app.cpp @@ -850,7 +850,7 @@ void ACTIVE_TASK_SET::report_overdue() { atp = active_tasks[i]; double diff = (gstate.now - atp->result->report_deadline)/86400; if (diff > 0) { - msg_printf(atp->result->project, MSG_USER_ERROR, + msg_printf(atp->result->project, MSG_USER_ALERT, "Task %s is %.2f days overdue; you may not get credit for it. Consider aborting it.", atp->result->name, diff ); } diff --git a/client/boinc_cmd.cpp b/client/boinc_cmd.cpp index 4cc31b1fcf..a76ba9e0ae 100644 --- a/client/boinc_cmd.cpp +++ b/client/boinc_cmd.cpp @@ -128,7 +128,7 @@ char* next_arg(int argc, char** argv, int& i) { const char* prio_name(int prio) { switch (prio) { case MSG_INFO: return "low"; - case MSG_USER_ERROR: return "medium"; + case MSG_USER_ALERT: return "medium"; case MSG_INTERNAL_ERROR: return "high"; } return "unknown"; diff --git a/client/boinc_log.cpp b/client/boinc_log.cpp index 33ef989a8f..a34ee77ab9 100644 --- a/client/boinc_log.cpp +++ b/client/boinc_log.cpp @@ -90,7 +90,7 @@ void show_error(int retval) { const char* prio_name(int prio) { switch (prio) { case MSG_INFO: return "low"; - case MSG_USER_ERROR: return "medium"; + case MSG_USER_ALERT: return "medium"; case MSG_INTERNAL_ERROR: return "high"; } return "unknown"; diff --git a/client/client_state.cpp b/client/client_state.cpp index f077495729..89a008dc5c 100644 --- a/client/client_state.cpp +++ b/client/client_state.cpp @@ -212,7 +212,7 @@ int CLIENT_STATE::init() { ); if (core_client_version.prerelease) { - msg_printf(NULL, MSG_USER_ERROR, + msg_printf(NULL, MSG_USER_ALERT, "This a development version of BOINC and may not function properly" ); } @@ -327,9 +327,8 @@ int CLIENT_STATE::init() { // retval = write_state_file(); if (retval) { - msg_printf(NULL, MSG_USER_ERROR, "Couldn't write state file"); - msg_printf(NULL, MSG_USER_ERROR, - "Make sure directory permissions are set correctly" + msg_printf(NULL, MSG_USER_ALERT, + "Couldn't write state file; make sure directory permissions are set correctly" ); cant_write_state_file = true; } diff --git a/client/cs_account.cpp b/client/cs_account.cpp index cb10276684..d993cc5f4d 100644 --- a/client/cs_account.cpp +++ b/client/cs_account.cpp @@ -438,21 +438,21 @@ int CLIENT_STATE::add_project( strip_whitespace(canonical_master_url); canonicalize_master_url(canonical_master_url); if (!valid_master_url(canonical_master_url)) { - msg_printf(0, MSG_USER_ERROR, "Invalid URL: %s", canonical_master_url); + msg_printf(0, MSG_USER_ALERT, "Invalid URL: %s", canonical_master_url); return ERR_INVALID_URL; } safe_strcpy(auth, _auth); strip_whitespace(auth); if (!strlen(auth)) { - msg_printf(0, MSG_USER_ERROR, "Missing account key"); + msg_printf(0, MSG_USER_ALERT, "Missing account key"); return ERR_AUTHENTICATOR; } // check if we're already attached to this project // if (lookup_project(canonical_master_url)) { - msg_printf(0, MSG_USER_ERROR, "Already attached to %s", canonical_master_url); + msg_printf(0, MSG_USER_ALERT, "Already attached to %s", canonical_master_url); return ERR_ALREADY_ATTACHED; } diff --git a/client/cs_cmdline.cpp b/client/cs_cmdline.cpp index 5cf51e7fb6..8261a14489 100644 --- a/client/cs_cmdline.cpp +++ b/client/cs_cmdline.cpp @@ -265,7 +265,7 @@ void CLIENT_STATE::parse_env_vars() { env_var_proxy_info.http_server_port = purl.port; break; default: - msg_printf(0, MSG_USER_ERROR, + msg_printf(0, MSG_USER_ALERT, "The HTTP_PROXY environment variable must specify an HTTP proxy" ); } @@ -326,7 +326,7 @@ void CLIENT_STATE::do_cmdline_actions() { msg_printf(project, MSG_INFO, "detaching from %s\n", detach_project_url); detach_project(project); } else { - msg_printf(NULL, MSG_USER_ERROR, "project %s not found\n", detach_project_url); + msg_printf(NULL, MSG_USER_ALERT, "project %s not found\n", detach_project_url); } exit(0); } @@ -338,7 +338,7 @@ void CLIENT_STATE::do_cmdline_actions() { reset_project(project, false); msg_printf(project, MSG_INFO, "Project %s has been reset", reset_project_url); } else { - msg_printf(NULL, MSG_USER_ERROR, "project %s not found\n", reset_project_url); + msg_printf(NULL, MSG_USER_ALERT, "project %s not found\n", reset_project_url); } exit(0); } @@ -349,7 +349,7 @@ void CLIENT_STATE::do_cmdline_actions() { if (project) { project->sched_rpc_pending = RPC_REASON_USER_REQ; } else { - msg_printf(NULL, MSG_USER_ERROR, "project %s not found\n", update_prefs_url); + msg_printf(NULL, MSG_USER_ALERT, "project %s not found\n", update_prefs_url); } } diff --git a/client/cs_notice.h b/client/cs_notice.h index d470d7e574..eb4f67134f 100644 --- a/client/cs_notice.h +++ b/client/cs_notice.h @@ -21,7 +21,7 @@ // Code related to "notices", which come from // 1) RSS feeds specified by projects // 2) Scheduler replies (high-priority messages) -// 3) the client (MSG_USER_ERROR messages) +// 3) the client (MSG_USER_ALERT messages) // // Classes: // diff --git a/client/cs_scheduler.cpp b/client/cs_scheduler.cpp index ca9a93134d..7233eb4aee 100644 --- a/client/cs_scheduler.cpp +++ b/client/cs_scheduler.cpp @@ -480,11 +480,9 @@ int CLIENT_STATE::handle_scheduler_reply(PROJECT* project, char* scheduler_url) downcase_string(url1); downcase_string(url2); if (url1 != url2) { - msg_printf(project, MSG_USER_ERROR, - "You used the wrong URL for this project" - ); - msg_printf(project, MSG_USER_ERROR, - "The correct URL is %s", sr.master_url + msg_printf(project, MSG_USER_ALERT, + "You used the wrong URL for this project; the correct URL is %s", + sr.master_url ); p2 = lookup_project(sr.master_url); if (p2) { @@ -522,11 +520,11 @@ int CLIENT_STATE::handle_scheduler_reply(PROJECT* project, char* scheduler_url) } } if (dup_name) { - msg_printf(project, MSG_USER_ERROR, + msg_printf(project, MSG_USER_ALERT, "Already attached to a project named %s (possibly with wrong URL)", project->project_name ); - msg_printf(project, MSG_USER_ERROR, + msg_printf(project, MSG_USER_ALERT, "Consider detaching this project, then trying again" ); } @@ -536,7 +534,7 @@ int CLIENT_STATE::handle_scheduler_reply(PROJECT* project, char* scheduler_url) for (i=0; iproject_name ); } fclose(f); @@ -784,8 +785,9 @@ int CLIENT_STATE::parse_app_info(PROJECT* p, FILE* in) { continue; } if (fip->urls.size()) { - msg_printf(p, MSG_USER_ERROR, - "Can't specify URLs in app_info.xml" + msg_printf(p, MSG_USER_ALERT, + "Can't specify URLs in app_info.xml for %s", + p->project_name ); delete fip; continue; @@ -829,8 +831,9 @@ int CLIENT_STATE::parse_app_info(PROJECT* p, FILE* in) { continue; } if (log_flags.unparsed_xml) { - msg_printf(p, MSG_USER_ERROR, - "Unparsed line in app_info.xml: %s", buf + msg_printf(p, MSG_USER_ALERT, + "Unparsed line in app_info.xml for %s: %s", + p->project_name, buf ); } } diff --git a/client/gui_rpc_server.cpp b/client/gui_rpc_server.cpp index b31f1f3256..ffd9b9ef53 100644 --- a/client/gui_rpc_server.cpp +++ b/client/gui_rpc_server.cpp @@ -180,7 +180,7 @@ int GUI_RPC_CONN_SET::get_allowed_hosts() { if (!(buf[0] =='#' || buf[0] == ';') && strlen(buf) > 0 ) { retval = resolve_hostname(buf, ipaddr); if (retval) { - msg_printf(0, MSG_USER_ERROR, + msg_printf(0, MSG_USER_ALERT, "Can't resolve hostname %s in %s", buf, REMOTEHOST_FILE_NAME ); @@ -297,13 +297,13 @@ static void show_connect_error(in_addr ia) { last_time = gstate.now; } msg_printf( - NULL, MSG_USER_ERROR, + NULL, MSG_USER_ALERT, "GUI RPC request from non-allowed address %s", inet_ntoa(ia) ); if (count > 1) { msg_printf( - NULL, MSG_USER_ERROR, + NULL, MSG_USER_ALERT, "%d connections rejected in last 10 minutes", count ); diff --git a/client/gui_rpc_server_ops.cpp b/client/gui_rpc_server_ops.cpp index 3f8af03bdc..f942c481fb 100644 --- a/client/gui_rpc_server_ops.cpp +++ b/client/gui_rpc_server_ops.cpp @@ -263,7 +263,7 @@ static void handle_project_op(char* buf, MIOFILE& fout, const char* op) { gstate.request_work_fetch("project resumed by user"); } else if (!strcmp(op, "detach")) { if (p->attached_via_acct_mgr) { - msg_printf(p, MSG_USER_ERROR, + msg_printf(p, MSG_USER_ALERT, "This project must be detached using the account manager web site." ); fout.printf("must detach using account manager"); diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index 10bd60c24d..60dfdad181 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -371,8 +371,8 @@ static void parse_meminfo_linux(HOST_INFO& host) { double x; FILE* f = fopen("/proc/meminfo", "r"); if (!f) { - msg_printf(NULL, MSG_USER_ERROR, - "Can't open /proc/meminfo - defaulting to 1 GB." + msg_printf(NULL, MSG_USER_ALERT, + "Can't open /proc/meminfo to get memory size - defaulting to 1 GB." ); host.m_nbytes = GIGA; host.m_swap = GIGA; @@ -409,7 +409,9 @@ static void parse_cpuinfo_linux(HOST_INFO& host) { FILE* f = fopen("/proc/cpuinfo", "r"); if (!f) { - msg_printf(NULL, MSG_USER_ERROR, "Can't open /proc/cpuinfo."); + msg_printf(NULL, MSG_USER_ALERT, + "Can't open /proc/cpuinfo to get CPU info" + ); strcpy(host.p_model, "unknown"); strcpy(host.p_vendor, "unknown"); return; @@ -1281,7 +1283,7 @@ bool HOST_INFO::users_idle( gEventHandle = NXOpenEventStatus(); if (!gEventHandle) { if (TickCount() > (120*60)) { // If system has been up for more than 2 minutes - msg_printf(NULL, MSG_USER_ERROR, + msg_printf(NULL, MSG_USER_ALERT, "User idle detection is disabled: initialization failed." ); error_posted = true; @@ -1293,7 +1295,7 @@ bool HOST_INFO::users_idle( if (gEventHandle) { kernResult = IOHIDGetParameter( gEventHandle, CFSTR(EVSIOIDLE), sizeof(UInt64), ¶ms, &rcnt ); if ( kernResult != kIOReturnSuccess ) { - msg_printf(NULL, MSG_USER_ERROR, + msg_printf(NULL, MSG_USER_ALERT, "User idle time measurement failed because IOHIDGetParameter failed." ); error_posted = true; @@ -1308,7 +1310,7 @@ bool HOST_INFO::users_idle( if ( (!service) || (kernResult != KERN_SUCCESS) ) { // When the system first starts up, allow time for HIDSystem to be available if needed if (TickCount() > (120*60)) { // If system has been up for more than 2 minutes - msg_printf(NULL, MSG_USER_ERROR, + msg_printf(NULL, MSG_USER_ALERT, "Could not connect to HIDSystem: user idle detection is disabled." ); error_posted = true; diff --git a/client/log_flags.cpp b/client/log_flags.cpp index 943ff7af65..892e80b461 100644 --- a/client/log_flags.cpp +++ b/client/log_flags.cpp @@ -64,7 +64,7 @@ int LOG_FLAGS::parse(XML_PARSER& xp) { while (!xp.get(tag, sizeof(tag), is_tag)) { if (!is_tag) { - msg_printf(NULL, MSG_USER_ERROR, + msg_printf(NULL, MSG_USER_ALERT, "Unexpected text %s in %s", tag, CONFIG_FILE ); continue; @@ -105,7 +105,7 @@ int LOG_FLAGS::parse(XML_PARSER& xp) { if (xp.parse_bool(tag, "work_fetch_debug", work_fetch_debug)) continue; if (xp.parse_bool(tag, "notice_debug", notice_debug)) continue; - msg_printf(NULL, MSG_USER_ERROR, "Unrecognized tag in %s: <%s>\n", + msg_printf(NULL, MSG_USER_ALERT, "Unrecognized tag in %s: <%s>\n", CONFIG_FILE, tag ); xp.skip_unexpected(tag, true, "LOG_FLAGS::parse"); @@ -274,7 +274,7 @@ int CONFIG::parse_options(XML_PARSER& xp) { while (!xp.get(tag, sizeof(tag), is_tag)) { if (!is_tag) { - msg_printf(NULL, MSG_USER_ERROR, + msg_printf(NULL, MSG_USER_ALERT, "Unexpected text %s in %s", tag, CONFIG_FILE ); continue; @@ -373,7 +373,7 @@ int CONFIG::parse_options(XML_PARSER& xp) { continue; } - msg_printf(NULL, MSG_USER_ERROR, "Unrecognized tag in %s: <%s>\n", + msg_printf(NULL, MSG_USER_ALERT, "Unrecognized tag in %s: <%s>\n", CONFIG_FILE, tag ); xp.skip_unexpected(tag, true, "CONFIG::parse_options"); @@ -389,12 +389,12 @@ int CONFIG::parse(FILE* f) { mf.init_file(f); if (!xp.parse_start("cc_config")) { - msg_printf(NULL, MSG_USER_ERROR, "Missing start tag in %s", CONFIG_FILE); + msg_printf(NULL, MSG_USER_ALERT, "Missing start tag in %s", CONFIG_FILE); return ERR_XML_PARSE; } while (!xp.get(tag, sizeof(tag), is_tag)) { if (!is_tag) { - msg_printf(NULL, MSG_USER_ERROR, + msg_printf(NULL, MSG_USER_ALERT, "Unexpected text %s in %s", tag, CONFIG_FILE ); continue; @@ -408,12 +408,12 @@ int CONFIG::parse(FILE* f) { parse_options(xp); continue; } - msg_printf(NULL, MSG_USER_ERROR, "Unparsed tag in %s: <%s>\n", + msg_printf(NULL, MSG_USER_ALERT, "Unparsed tag in %s: <%s>\n", CONFIG_FILE, tag ); xp.skip_unexpected(tag, true, "CONFIG.parse"); } - msg_printf(NULL, MSG_USER_ERROR, "Missing end tag in %s", CONFIG_FILE); + msg_printf(NULL, MSG_USER_ALERT, "Missing end tag in %s", CONFIG_FILE); return ERR_XML_PARSE; } diff --git a/client/net_stats.cpp b/client/net_stats.cpp index 7ebd8e1525..c5eb40c136 100644 --- a/client/net_stats.cpp +++ b/client/net_stats.cpp @@ -222,7 +222,7 @@ int LOOKUP_WEBSITE_OP::do_rpc(string& url) { working_proxy_info.need_autodetect_proxy_settings = true; working_proxy_info.have_autodetect_proxy_settings = false; - msg_printf(0, MSG_USER_ERROR, + msg_printf(0, MSG_USER_ALERT, "BOINC can't access Internet - check network connection or proxy configuration." ); } else { @@ -242,7 +242,7 @@ void LOOKUP_WEBSITE_OP::handle_reply(int http_op_retval) { if (http_op_retval) { net_status.need_physical_connection = true; net_status.last_comm_time = 0; - msg_printf(0, MSG_USER_ERROR, + msg_printf(0, MSG_USER_ALERT, "BOINC can't access Internet - check network connection or proxy configuration." ); } else { diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index 4438f86446..c67fa13edc 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -646,7 +646,7 @@ wxListItemAttr* CDlgEventLog::OnListGetItemAttr(long item) const { if (message) { switch(message->priority) { - case MSG_USER_ERROR: + case MSG_USER_ALERT: pAttribute = m_pMessageErrorAttr; break; default: diff --git a/clientgui/ViewMessages.cpp b/clientgui/ViewMessages.cpp index cba069b1cd..d7fb0c8d63 100644 --- a/clientgui/ViewMessages.cpp +++ b/clientgui/ViewMessages.cpp @@ -445,7 +445,7 @@ wxListItemAttr* CViewMessages::OnListGetItemAttr(long item) const { if (message) { switch(message->priority) { - case MSG_USER_ERROR: + case MSG_USER_ALERT: pAttribute = item % 2 ? m_pMessageErrorGrayAttr : m_pMessageErrorAttr; break; default: diff --git a/clientgui/sg_DlgMessages.cpp b/clientgui/sg_DlgMessages.cpp index 07c7d6247f..d30b52680a 100644 --- a/clientgui/sg_DlgMessages.cpp +++ b/clientgui/sg_DlgMessages.cpp @@ -571,7 +571,7 @@ wxListItemAttr* CPanelMessages::OnListGetItemAttr(long item) const { if (message) { switch(message->priority) { - case MSG_USER_ERROR: + case MSG_USER_ALERT: pAttribute = m_pMessageErrorAttr; break; default: diff --git a/clientgui/sg_ProjectsComponent.cpp b/clientgui/sg_ProjectsComponent.cpp index 0d89bc57a9..4409702f6b 100644 --- a/clientgui/sg_ProjectsComponent.cpp +++ b/clientgui/sg_ProjectsComponent.cpp @@ -742,7 +742,7 @@ void CProjectsComponent::OnMessageCheck(wxTimerEvent& WXUNUSED(event)) { for(size_t i=lastMessageId; i < pDoc->messages.messages.size(); i++) { lastMessageId = i+1; message = pDoc->message((unsigned int) i); - if ( message != NULL && message->priority == MSG_USER_ERROR ) { + if ( message != NULL && message->priority == MSG_USER_ALERT ) { receivedErrorMessage = true; checkForMessagesTimer->Stop(); break; diff --git a/lib/common_defs.h b/lib/common_defs.h index c904710599..95775aa998 100644 --- a/lib/common_defs.h +++ b/lib/common_defs.h @@ -85,18 +85,17 @@ // #define MSG_INFO 1 // write to stdout - // GUI: write to msg window -#define MSG_USER_ERROR 2 - // Conditions that require user intervention; - // text should be user-friendly. + // GUI: show in event log +#define MSG_USER_ALERT 2 + // Conditions that require user intervention. + // Text should be user-friendly. // write to stdout - // GUI: write to msg window in bold or red + // GUI: show in event log in bold or red; show in notices tab #define MSG_INTERNAL_ERROR 3 // Conditions that indicate a problem or bug with BOINC itself, // or with a BOINC project or account manager. // treat same as MSG_INFO, but prepend with [error] - // bitmap defs for task_suspend_reason, network_suspend_reason // Note: doesn't need to be a bitmap, but keep for compatibility //