Merge branch 'master' of ssh://boinc.berkeley.edu/boinc

This commit is contained in:
Oliver Bock 2013-03-05 16:35:14 +01:00
commit 05eba7c951
7 changed files with 28 additions and 24 deletions

View File

@ -277,24 +277,12 @@ int CLIENT_STATE::check_suspend_processing() {
// on some devices, running jobs can drain the battery even
// while it's recharging.
// So use the following hysteresis policy:
// start computing when the batter is 95% charged.
// stop computing if it falls below 90%.
// Repeat.
// So compute only if 95% charged or more.
//
static bool hyst_state = true;
int cp = host_info.battery_charge_pct;
if (cp >= 0) {
if (cp < 90) {
hyst_state = true;
return SUSPEND_REASON_BATTERY_CHARGING;
}
if (cp >= 0)
if (cp < 95) {
if (hyst_state) {
return SUSPEND_REASON_BATTERY_CHARGING;
}
} else {
hyst_state = false;
return SUSPEND_REASON_BATTERY_CHARGING;
}
}
#endif

View File

@ -1315,6 +1315,9 @@ int HOST_INFO::get_virtualbox_version() {
if (boinc_file_exists(path)) {
#if LINUX_LIKE_SYSTEM
if (access(path, X_OK)) {
return 0;
}
safe_strcpy(cmd, path);
safe_strcat(cmd, " --version");
#elif defined( __APPLE__)

View File

@ -800,9 +800,9 @@ void CDlgAdvPreferences::OnAddExclusiveApp(wxCommandEvent&) {
wxT("C:/Program Files"), wxT(""), wxT("*.exe"),
wxFD_OPEN|wxFD_FILE_MUST_EXIST|wxFD_CHANGE_DIR|wxFD_MULTIPLE|wxFD_CHANGE_DIR);
#else
//TODO: fill in the default directory and wildcard for Linux
//TODO: fill in the default directory for Linux
wxFileDialog picker(this, _("Applications to add"),
wxT("/"), wxT(""), wxT("*.*"),
wxT("/"), wxT(""), wxT("*"),
wxFD_OPEN|wxFD_FILE_MUST_EXIST|wxFD_CHANGE_DIR|wxFD_MULTIPLE|wxFD_CHANGE_DIR);
#endif
if (picker.ShowModal() != wxID_OK) return;

View File

@ -233,7 +233,7 @@ CViewWork::CViewWork(wxNotebook* pNotebook) :
m_pListPane->InsertColumn(COLUMN_STATUS, _("Status"), wxLIST_FORMAT_LEFT, 135);
m_pListPane->InsertColumn(COLUMN_CPUTIME, _("Elapsed"), wxLIST_FORMAT_RIGHT, 80);
m_pListPane->InsertColumn(COLUMN_TOCOMPLETION, _("Remaining (estimated)"), wxLIST_FORMAT_RIGHT, 100);
m_pListPane->InsertColumn(COLUMN_REPORTDEADLINE, _("Deadline"), wxLIST_FORMAT_LEFT, 150);
m_pListPane->InsertColumn(COLUMN_REPORTDEADLINE, _("Deadline"), wxLIST_FORMAT_RIGHT, 150);
m_pListPane->InsertColumn(COLUMN_APPLICATION, _("Application"), wxLIST_FORMAT_LEFT, 95);
m_pListPane->InsertColumn(COLUMN_NAME, _("Name"), wxLIST_FORMAT_LEFT, 285);

View File

@ -596,10 +596,11 @@ function show_post(
echo tra("Credit: %1", number_format($user->total_credit)) ."<br>";
echo tra("RAC: %1", number_format($user->expavg_credit))."<br>";
}
// to use this feature:
// - get flags from http://www.famfamfam.com/lab/icons/flags/famfamfam_flag_icons.zip
// - put the .png's in html/user/flags/
// - put define(COUNTRY_FLAGS, 1) in your html/project/project.inc
// - put define("COUNTRY_FLAGS", 1); in your html/project/project.inc
//
if (defined("COUNTRY_FLAGS")) {
if (array_key_exists($user->country, $country_to_iso3166_2)) {

View File

@ -37,6 +37,7 @@ db_init();
$is_admin = true;
$Nbf = sizeof($special_user_bitfield);
$q = null;
// Delete a user (or at least try to)
//
@ -132,7 +133,9 @@ $id = get_int("userid", true);
if (!$id) {
$id = post_int("userid", true);
}
if (!$id) error_page("No ID given");
$user = lookup_user_id($id);
if (!$user) error_page("No such user: $id");
// but clear if page was reset (forcing search form)

View File

@ -229,14 +229,23 @@ int copy_element_contents(FILE* in, const char* end_tag, char* p, int len) {
}
int copy_element_contents(FILE* in, const char* end_tag, string& str) {
char buf[256];
int c;
size_t end_tag_len = strlen(end_tag);
size_t n = 0;
str = "";
while (fgets(buf, 256, in)) {
if (strstr(buf, end_tag)) {
return 0;
while (1) {
c = fgetc(in);
if (c == EOF) break;
if (n >= end_tag_len) {
const char* p = str.c_str() + n - end_tag_len;
if (!strcmp(p, end_tag)) {
str.erase(n-end_tag_len, end_tag_len);
return 0;
}
}
str += buf;
str += c;
n++;
}
return ERR_XML_PARSE;
}