From b21be7c4d49df23e217cd9c12d1b75ae8665bd09 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 29 Jun 2008 20:57:21 +0000 Subject: [PATCH] - client: add "Suspending computation" messages for system idle and initial delay cases. Rom: please back-port svn path=/trunk/boinc/; revision=15513 --- checkin_notes | 8 ++++++++ client/cs_prefs.C | 6 ++++++ html/inc/bolt_db.inc | 13 ++++++++++--- html/inc/bolt_util.inc | 4 ++-- html/inc/bossa_db.inc | 13 ++++++++++--- html/user/bolt_compare.php | 6 +++--- 6 files changed, 39 insertions(+), 11 deletions(-) diff --git a/checkin_notes b/checkin_notes index da126f970a..9c46796375 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5238,3 +5238,11 @@ David 27 June 2008 tools/ make_project + +David 29 June 2008 + - client: add "Suspending computation" messages for + system idle and initial delay cases. + Rom: please back-port + + client/ + cs_prefs.C diff --git a/client/cs_prefs.C b/client/cs_prefs.C index 25e6a9436e..3445892641 100644 --- a/client/cs_prefs.C +++ b/client/cs_prefs.C @@ -180,6 +180,12 @@ static string reason_string(int reason) { if (reason & SUSPEND_REASON_DISK_SIZE) { s_reason += " - out of disk space - change global prefs"; } + if (reason & SUSPEND_REASON_NO_RECENT_INPUT) { + s_reason += " - no recent user activity"; + } + if (reason & SUSPEND_REASON_INITIAL_DELAY) { + s_reason += " - initial delay"; + } return s_reason; } diff --git a/html/inc/bolt_db.inc b/html/inc/bolt_db.inc index 7238518bb3..d561a7d43f 100644 --- a/html/inc/bolt_db.inc +++ b/html/inc/bolt_db.inc @@ -52,10 +52,17 @@ class BoltDb extends DbConn { } if (!isset($instance)) { $config = get_config(); - $user = parse_config($config, ''); - $passwd = parse_config($config, ''); - $host = parse_config($config, ''); $name = parse_config($config, ''); + if (!$name) { + $name = parse_config($config, ''); + $user = parse_config($config, ''); + $passwd = parse_config($config, ''); + $host = parse_config($config, ''); + } else { + $user = parse_config($config, ''); + $passwd = parse_config($config, ''); + $host = parse_config($config, ''); + } if ($host == null) { $host = "localhost"; } diff --git a/html/inc/bolt_util.inc b/html/inc/bolt_util.inc index 692011c59c..1aa3a47c1d 100644 --- a/html/inc/bolt_util.inc +++ b/html/inc/bolt_util.inc @@ -335,7 +335,7 @@ function test_stats() { //////////// graph drawing -function bar($title, $n, $width, $lo, $hi) { +function compare_bar($title, $n, $width, $lo, $hi) { $x1 = $width*$lo; $x2 = $width*($hi-$lo); $a1 = number_format($lo*100); @@ -354,7 +354,7 @@ function bar($title, $n, $width, $lo, $hi) { "; } -function bar_insuff($title, $width) { +function compare_bar_insuff($title, $width) { return " $title diff --git a/html/inc/bossa_db.inc b/html/inc/bossa_db.inc index 44e36d8230..57a17e35d7 100644 --- a/html/inc/bossa_db.inc +++ b/html/inc/bossa_db.inc @@ -13,10 +13,17 @@ class BossaDb extends DbConn { static function get() { if (!isset($instance)) { $config = get_config(); - $user = parse_config($config, ''); - $passwd = parse_config($config, ''); - $host = parse_config($config, ''); $name = parse_config($config, ''); + if (!$name) { + $name = parse_config($config, ''); + $user = parse_config($config, ''); + $passwd = parse_config($config, ''); + $host = parse_config($config, ''); + } else { + $user = parse_config($config, ''); + $passwd = parse_config($config, ''); + $host = parse_config($config, ''); + } if ($host == null) { $host = "localhost"; } diff --git a/html/user/bolt_compare.php b/html/user/bolt_compare.php index bb9412f561..323d3f3d87 100644 --- a/html/user/bolt_compare.php +++ b/html/user/bolt_compare.php @@ -48,14 +48,14 @@ function compare_case( $scores = $a[$child->name]; $n = count($scores); if ($n < 2) { - $x = bar_insuff($child->name, 600); + $x = compare_bar_insuff($child->name, 600); } else { conf_int_90($scores, $lo, $hi); //$x = "($lo, $hi) ($n results)"; - $x = bar($child->name, $n, 600, $lo, $hi); + $x = compare_bar($child->name, $n, 600, $lo, $hi); } } else { - $x = bar_insuff($child->name, 600); + $x = compare_bar_insuff($child->name, 600); } echo $x; }