diff --git a/api/boinc_api.C b/api/boinc_api.C index 8dda0d27ee..5a952fee5c 100644 --- a/api/boinc_api.C +++ b/api/boinc_api.C @@ -499,12 +499,13 @@ int set_timer(double period) { } void setup_shared_mem(void) { + app_client_shm = new APP_CLIENT_SHM; #ifdef API_IGNORE_CLIENT + app_client_shm->shm = NULL; fprintf( stderr, "Ignoring client, so not attaching to shared memory.\n" ); return; #endif - app_client_shm = new APP_CLIENT_SHM; #ifdef _WIN32 char buf[256]; sprintf(buf, "%s%s", SHM_PREFIX, aid.comm_obj_name); diff --git a/api/gutil.cpp b/api/gutil.cpp index 483d766ae4..6a3fa80c18 100755 --- a/api/gutil.cpp +++ b/api/gutil.cpp @@ -33,7 +33,7 @@ #endif #include "gutil.h" -//GLfloat mat_diffuse[] = {0.7, 0.5, 1.0, 0.4}; +GLfloat mat_diffuse[] = {0.7, 0.5, 1.0, 0.4}; GLfloat mat_specular[] = {1.0, 1.0, 1.0, 1.0}; GLfloat mat_shininess[] = {40.0}; diff --git a/client/client_state.C b/client/client_state.C index 256a2a52f0..e8bb3b0e13 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -626,7 +626,7 @@ bool CLIENT_STATE::do_something() { if (x) {action=true; print_log("update_results\n"); } if (write_state_file_if_needed()) { - fprintf(stderr, "Couldn't write state file"); + show_message(NULL, "Couldn't write state file", MSG_ERROR); } } print_log("End poll\n"); @@ -639,7 +639,7 @@ bool CLIENT_STATE::do_something() { // Parse the client_state.xml file // int CLIENT_STATE::parse_state_file() { - char buf[256]; + char buf[256], ebuf[256]; FILE* f = fopen(STATE_FILE_NAME, "r"); PROJECT temp_project, *project; int retval=0; @@ -649,6 +649,11 @@ int CLIENT_STATE::parse_state_file() { if (log_flags.state_debug) { printf("No state file; will create one\n"); } + + // avoid warning messages about version + // + old_major_version = MAJOR_VERSION; + old_minor_version = MINOR_VERSION; return ERR_FOPEN; } fgets(buf, 256, f); @@ -666,10 +671,11 @@ int CLIENT_STATE::parse_state_file() { if (project) { project->copy_state_fields(temp_project); } else { - fprintf(stderr, + sprintf(ebuf, "Project %s found in state file but not prefs.\n", temp_project.master_url ); + show_message(NULL, ebuf, MSG_ERROR); } } else if (match_tag(buf, "")) { APP* app = new APP; @@ -725,7 +731,9 @@ int CLIENT_STATE::parse_state_file() { retval = link_result(project, rp); if (!retval) results.push_back(rp); } else { - fprintf(stderr, "error: link_result failed\n"); + show_message(NULL, + " found before any project\n", MSG_ERROR + ); delete rp; } } else if (match_tag(buf, "")) { @@ -757,7 +765,8 @@ int CLIENT_STATE::parse_state_file() { suspend_requested = true; } else if (parse_str(buf, "", host_venue, sizeof(host_venue))) { } else { - fprintf(stderr, "CLIENT_STATE::parse_state_file: unrecognized: %s\n", buf); + sprintf(buf, "CLIENT_STATE::parse_state_file: unrecognized: %s\n", buf); + show_message(NULL, buf, MSG_ERROR); } } done: @@ -770,6 +779,7 @@ done: // int CLIENT_STATE::write_state_file() { unsigned int i, j; + char buf[256]; FILE* f = fopen(STATE_FILE_TEMP, "w"); int retval; @@ -777,7 +787,8 @@ int CLIENT_STATE::write_state_file() { printf("Writing state file\n"); } if (!f) { - fprintf(stderr, "can't open temp state file: %s\n", STATE_FILE_TEMP); + sprintf(buf, "can't open temp state file: %s\n", STATE_FILE_TEMP); + show_message(0, buf, MSG_ERROR); return ERR_FOPEN; } fprintf(f, "\n"); @@ -954,13 +965,15 @@ int CLIENT_STATE::link_app_version(PROJECT* p, APP_VERSION* avp) { FILE_INFO* fip; FILE_REF file_ref; unsigned int i; + char buf[256]; avp->project = p; app = lookup_app(p, avp->app_name); if (!app) { - fprintf(stderr, + sprintf(buf, "app_version refers to nonexistent app: %s\n", avp->app_name ); + show_message(0, buf, MSG_ERROR); return 1; } avp->app = app; @@ -969,10 +982,11 @@ int CLIENT_STATE::link_app_version(PROJECT* p, APP_VERSION* avp) { file_ref = avp->app_files[i]; fip = lookup_file_info(p, file_ref.file_name); if (!fip) { - fprintf(stderr, + sprintf(buf, "app_version refers to nonexistent file: %s\n", file_ref.file_name ); + show_message(0, buf, MSG_ERROR); return 1; } @@ -988,12 +1002,14 @@ int CLIENT_STATE::link_app_version(PROJECT* p, APP_VERSION* avp) { int CLIENT_STATE::link_file_ref(PROJECT* p, FILE_REF* file_refp) { FILE_INFO* fip; + char buf[256]; fip = lookup_file_info(p, file_refp->file_name); if (!fip) { - fprintf(stderr, - "I/O desc links to nonexistent file: %s\n", file_refp->file_name + sprintf(buf, + "File ref refers to nonexistent file: %s\n", file_refp->file_name ); + show_message(0, buf, MSG_ERROR); return 1; } file_refp->file_info = fip; @@ -1005,20 +1021,23 @@ int CLIENT_STATE::link_workunit(PROJECT* p, WORKUNIT* wup) { APP_VERSION* avp; unsigned int i; int retval; + char buf[256]; app = lookup_app(p, wup->app_name); if (!app) { - fprintf(stderr, + sprintf(buf, "WU refers to nonexistent app: %s\n", wup->app_name ); + show_message(0, buf, MSG_ERROR); return 1; } avp = lookup_app_version(app, wup->version_num); if (!avp) { - fprintf(stderr, + sprintf(buf, "WU refers to nonexistent app_version: %s %d\n", wup->app_name, wup->version_num ); + show_message(0, buf, MSG_ERROR); return 1; } wup->project = p; @@ -1035,6 +1054,7 @@ int CLIENT_STATE::link_result(PROJECT* p, RESULT* rp) { WORKUNIT* wup; unsigned int i; int retval; + char buf[256]; wup = lookup_workunit(p, rp->wu_name); if (!wup) { @@ -1047,7 +1067,8 @@ int CLIENT_STATE::link_result(PROJECT* p, RESULT* rp) { for (i=0; ioutput_files.size(); i++) { retval = link_file_ref(p, &rp->output_files[i]); if (retval) { - fprintf(stderr, "error: link_result: link_file_ref failed\n"); + sprintf(buf, "link_result: link_file_ref failed\n"); + show_message(0, buf, MSG_ERROR); return retval; } } @@ -1058,6 +1079,7 @@ int CLIENT_STATE::latest_version_num(char* app_name) { unsigned int i; int best = -1; APP_VERSION* avp; + char buf[256]; for (i=0; iversion_num; } if (best < 0) { - fprintf(stderr, "CLIENT_STATE::latest_version_num: no version\n"); + sprintf(buf, "CLIENT_STATE::latest_version_num: no version\n"); + show_message(0, buf, MSG_ERROR); } return best; } @@ -1570,7 +1593,9 @@ int CLIENT_STATE::reset_project(PROJECT* project) { for (i=0; iserver_ack = true; + if (rp->project == project) { + rp->server_ack = true; + } } avp_iter = app_versions.begin(); diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 304a657eb9..0c30dfc4d7 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -324,6 +324,7 @@ int CLIENT_STATE::handle_scheduler_reply( int retval; unsigned int i; bool signature_valid; + char buf[256]; nresults = 0; contacted_sched_server = true; @@ -435,13 +436,9 @@ int CLIENT_STATE::handle_scheduler_reply( // copy new entities to client state // - for (i=0; iapp_files = sr.app_versions[i].app_files; + link_app_version(project, avp); } } for (i=0; istate = RESULT_NEW; nresults++; } else { - fprintf(stderr, "ERROR: already have result %s\n", sr.results[i].name); + sprintf(buf, "Already have result %s\n", sr.results[i].name); + show_message(project, buf, MSG_ERROR); } } @@ -499,10 +505,10 @@ int CLIENT_STATE::handle_scheduler_reply( if (rp) { rp->server_ack = true; } else { - fprintf(stderr, - "ERROR: got ack for result %s, can't find\n", + sprintf(buf, "Got ack for result %s, can't find\n", sr.result_acks[i].name ); + show_message(project, buf, MSG_ERROR); } } project->sched_rpc_pending = false; diff --git a/html/user/project_specific_prefs_ap.inc b/html/user/project_specific_prefs_ap.inc index e09c287797..72c514382d 100755 --- a/html/user/project_specific_prefs_ap.inc +++ b/html/user/project_specific_prefs_ap.inc @@ -17,6 +17,10 @@ // If present, draw 2-D graph // // transparency of graph (0..1) +// +// background +// ... +// function project_specific_prefs_default() { return "Tahiti Sunset\n"; @@ -65,6 +69,11 @@ function project_specific_prefs_edit($prefs) { "; } + echo " + URL of background (PPM format) + + + "; } // Return XML version of project-specific prefs from form vars @@ -77,40 +86,41 @@ function project_specific_prefs_parse_form() { $hold_time = $_GET["hold_time"]; $graph_alpha = $_GET["graph_alpa"]; $two_dim = $_GET["two_dim"]; + $background = $_GET["background"]; - switch( $color_scheme ) { - case "Tahiti Sunset": - $start_hue = 0.5; - $hue_change = 0.5; - $grow_time = 10; - $hold_time = 5; - $graph_alpha = 0.7; - $two_dim = "no"; - break; - case "Desert Sands": - $start_hue = 0.0; - $hue_change = 0.2; - $grow_time = 10; - $hold_time = 5; - $graph_alpha = 0.7; - $two_dim = "no"; - break; - case "Underwater": - $start_hue = 0.2; - $hue_change = 0.4; - $grow_time = 10; - $hold_time = 5; - $graph_alpha = 0.7; - $two_dim = "no"; - break; - case "Custom": - if ($start_hue == null) $start_hue = 0; - if ($hue_change == null) $hue_change = 1; - if ($grow_time == null) $grow_time = 10; - if ($hold_time == null) $hold_time = 5; - if ($graph_alpha == null) $graph_alpha = 0.7; - if ($two_dim == null) $two_dim = "no"; - break; + switch($color_scheme) { + case "Tahiti Sunset": + $start_hue = 0.5; + $hue_change = 0.5; + $grow_time = 10; + $hold_time = 5; + $graph_alpha = 0.7; + $two_dim = "no"; + break; + case "Desert Sands": + $start_hue = 0.0; + $hue_change = 0.2; + $grow_time = 10; + $hold_time = 5; + $graph_alpha = 0.7; + $two_dim = "no"; + break; + case "Underwater": + $start_hue = 0.2; + $hue_change = 0.4; + $grow_time = 10; + $hold_time = 5; + $graph_alpha = 0.7; + $two_dim = "no"; + break; + case "Custom": + if ($start_hue == null) $start_hue = 0; + if ($hue_change == null) $hue_change = 1; + if ($grow_time == null) $grow_time = 10; + if ($hold_time == null) $hold_time = 5; + if ($graph_alpha == null) $graph_alpha = 0.7; + if ($two_dim == null) $two_dim = "no"; + break; } $x = "$color_scheme $start_hue @@ -120,6 +130,13 @@ function project_specific_prefs_parse_form() { $graph_alpha "; if ($two_dim == "yes") $x = $x."\n"; + if (strlen($background)) { + $x = $x." + $background + background + + "; + } return $x; } @@ -136,6 +153,11 @@ function project_specific_prefs_show($prefs) { row2("Graph alpha", $prefs->graph_alpha); row2("Graph dimension", $dim); } + if (strlen($prefs->background)) { + row2("Background", $prefs->background); + } else { + row2("Background", "none"); + } } // parse XML, fill in struct @@ -148,5 +170,6 @@ function project_specific_prefs_parse($prefs_xml) { $prefs->hold_time = parse_element($prefs_xml, ""); $prefs->graph_alpha = parse_element($prefs_xml, ""); $prefs->two_dim = parse_element($prefs_xml, ""); + $prefs->background = parse_element($prefs_xml, ""); return $prefs; } diff --git a/win_build/boinc.dsw b/win_build/boinc.dsw index 73de702dde..e69de29bb2 100755 --- a/win_build/boinc.dsw +++ b/win_build/boinc.dsw @@ -1,89 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "RSAEuro"=.\RSAEuro\RSAEuro.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "boinc_cli"=.\boinc_cli\boinc_cli.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "boinc_dll"=.\boinc_dll\boinc_dll.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "boinc_gui"=.\boinc_gui\boinc_gui.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "boinc_ss"=.\boinc_ss\boinc_ss.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "upper_case"=.\upper_case\upper_case.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### -