mirror of https://github.com/BOINC/boinc.git
app version in window title
svn path=/trunk/boinc/; revision=8663
This commit is contained in:
parent
accb99ab64
commit
270c583dcf
|
@ -238,4 +238,18 @@ bool throttled_app_render(int x, int y, double t) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void get_window_title(APP_INIT_DATA& aid, char* buf, int len) {
|
||||
if (aid.app_version) {
|
||||
snprintf(buf, len,
|
||||
"%s version %d [workunit: %s]",
|
||||
aid.app_name, aid.app_version, aid.wu_name
|
||||
);
|
||||
} else {
|
||||
snprintf(buf, len,
|
||||
"%s [workunit: %s]",
|
||||
aid.app_name, aid.wu_name
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const char *BOINC_RCSID_6e92742852 = "$Id$";
|
||||
|
|
|
@ -56,3 +56,4 @@ extern "C" {
|
|||
}
|
||||
|
||||
extern BOINC_MAIN_STATE* g_bmsp;
|
||||
extern void get_window_title(APP_INIT_DATA& aid, char* buf, int len);
|
||||
|
|
|
@ -137,13 +137,7 @@ static void make_new_window() {
|
|||
boinc_get_init_data(aid);
|
||||
if (!strlen(aid.app_name)) strcpy(aid.app_name, "BOINC Application");
|
||||
char window_title[256];
|
||||
// keep following consistent with similar code in x_opengl.C
|
||||
// TODO: add app_version_num to window title. David or Rom, could
|
||||
// you add app_version_num to struct APP_INIT_DATA?
|
||||
//
|
||||
snprintf(window_title, 256,
|
||||
"%s [workunit: %s]", aid.app_name, aid.wu_name
|
||||
);
|
||||
get_window_title(aid, window_title, 256);
|
||||
hWnd = CreateWindowEx(dwExStyle, BOINC_WINDOW_CLASS_NAME, window_title,
|
||||
dwStyle|WS_CLIPSIBLINGS|WS_CLIPCHILDREN, WindowRect.left, WindowRect.top,
|
||||
WindowRect.right-WindowRect.left,WindowRect.bottom-WindowRect.top,
|
||||
|
|
|
@ -154,13 +154,7 @@ static void make_new_window(int mode) {
|
|||
|
||||
app_debug_msg("make_new_window(): now calling glutCreateWindow(%s)...\n", aid.app_name);
|
||||
char window_title[256];
|
||||
// keep following consistent with similar code in windows_opengl.C
|
||||
// TODO: add app_version_num to window title. David or Rom, could
|
||||
// you add app_version_num to struct APP_INIT_DATA?
|
||||
//
|
||||
snprintf(window_title, 256,
|
||||
"%s version [workunit: %s]", aid.app_name, aid.wu_name
|
||||
);
|
||||
get_window_title(aid, window_title, 256);
|
||||
win = glutCreateWindow(window_title);
|
||||
app_debug_msg("glutCreateWindow() succeeded. win = %d\n", win);
|
||||
|
||||
|
|
|
@ -13036,3 +13036,31 @@ Charlie 12 Oct 2005
|
|||
|
||||
mac_installer/
|
||||
ReadMe.rtf
|
||||
|
||||
David 12 Oct 2005
|
||||
- scripts: disable "add", add comments to "xadd"
|
||||
- Client: make "Communication deferred" message INFO rather than ERROR
|
||||
|
||||
client/
|
||||
cs_scheduler.C
|
||||
sched/
|
||||
server_types.C
|
||||
tools/
|
||||
add
|
||||
xadd
|
||||
|
||||
David 12 Oct 2005
|
||||
- Add app version # to window title:
|
||||
- add app_version to APP_INIT_DATA structure
|
||||
- initialize it in ACTIVE_TASK::write_app_init_data_file()
|
||||
- make new function get_window_title() so we don't have
|
||||
to worry about consistency of X/WIn code
|
||||
|
||||
api/
|
||||
graphics_impl.C,h
|
||||
windows_opengl.C
|
||||
x_opengl.C
|
||||
client/
|
||||
app_start.C
|
||||
lib/
|
||||
app_ipc.C,h
|
||||
|
|
|
@ -145,6 +145,7 @@ int ACTIVE_TASK::write_app_init_file() {
|
|||
aid.major_version = BOINC_MAJOR_VERSION;
|
||||
aid.minor_version = BOINC_MINOR_VERSION;
|
||||
aid.release = BOINC_RELEASE;
|
||||
aid.app_version = app_version->version_num;
|
||||
safe_strcpy(aid.app_name, wup->app->name);
|
||||
safe_strcpy(aid.user_name, wup->project->user_name);
|
||||
safe_strcpy(aid.team_name, wup->project->team_name);
|
||||
|
|
|
@ -97,7 +97,7 @@ bool PROJECT::waiting_until_min_rpc_time() {
|
|||
if (gstate.now >= min_report_min_rpc_time) {
|
||||
min_report_min_rpc_time = gstate.now + SECONDS_BEFORE_REPORTING_MIN_RPC_TIME_AGAIN;
|
||||
msg_printf(
|
||||
this, MSG_ERROR,
|
||||
this, MSG_INFO,
|
||||
"Deferring communication with project for %s\n",
|
||||
timediff_format(min_rpc_time - gstate.now).c_str()
|
||||
);
|
||||
|
@ -1030,7 +1030,8 @@ int CLIENT_STATE::handle_scheduler_reply(
|
|||
}
|
||||
|
||||
bool CLIENT_STATE::should_get_work() {
|
||||
// if there are fewer wus available then CPUS, then we need more work.
|
||||
// if there are fewer runnable results then CPUS, we need more work.
|
||||
//
|
||||
if (no_work_for_a_cpu()) return true;
|
||||
|
||||
double tot_cpu_time_remaining = 0;
|
||||
|
|
|
@ -24,8 +24,20 @@ The contents of <b>project.xml</b> should look like this:
|
|||
</app>
|
||||
...
|
||||
<platform>
|
||||
<name>windows_intel</name>
|
||||
<user_friendly_name>Windows 95, 98, NT 2000, and XP</user_friendly_name>
|
||||
<name>anonymous</name>
|
||||
<user_friendly_name>anonymous</user_friendly_name>
|
||||
</platform>
|
||||
<platform>
|
||||
<name>i686-pc-linux-gnu</name>
|
||||
<user_friendly_name>Linux/x86</user_friendly_name>
|
||||
</platform>
|
||||
<platform>
|
||||
<name>windows_intelx86</name>
|
||||
<user_friendly_name>Windows/x86</user_friendly_name>
|
||||
</platform>
|
||||
<platform>
|
||||
<name>powerpc-apple-darwin</name>
|
||||
<user_friendly_name>Mac OS X</user_friendly_name>
|
||||
</platform>
|
||||
...
|
||||
</boinc>
|
||||
|
|
|
@ -82,10 +82,12 @@ int write_init_data_file(FILE* f, APP_INIT_DATA& ai) {
|
|||
"<app_init_data>\n"
|
||||
"<major_version>%d</major_version>\n"
|
||||
"<minor_version>%d</minor_version>\n"
|
||||
"<release>%d</release>\n",
|
||||
"<release>%d</release>\n"
|
||||
"<app_version>%d</app_version>\n",
|
||||
ai.major_version,
|
||||
ai.minor_version,
|
||||
ai.release
|
||||
ai.release,
|
||||
ai.app_version
|
||||
);
|
||||
if (strlen(ai.app_name)) {
|
||||
fprintf(f, "<app_name>%s</app_name>\n", ai.app_name);
|
||||
|
@ -183,6 +185,7 @@ int parse_init_data_file(FILE* f, APP_INIT_DATA& ai) {
|
|||
else if (parse_int(buf, "<major_version>", ai.major_version)) continue;
|
||||
else if (parse_int(buf, "<minor_version>", ai.minor_version)) continue;
|
||||
else if (parse_int(buf, "<release>", ai.release)) continue;
|
||||
else if (parse_int(buf, "<app_version>", ai.app_version)) continue;
|
||||
else if (parse_str(buf, "<app_name>", ai.app_name, sizeof(ai.app_name))) continue;
|
||||
else if (parse_str(buf, "<user_name>", ai.user_name, sizeof(ai.user_name))) continue;
|
||||
else if (parse_str(buf, "<team_name>", ai.team_name, sizeof(ai.team_name))) continue;
|
||||
|
|
|
@ -159,6 +159,7 @@ struct APP_INIT_DATA {
|
|||
int major_version;
|
||||
int minor_version;
|
||||
int release;
|
||||
int app_version;
|
||||
char app_name[256];
|
||||
char* project_preferences;
|
||||
int userid;
|
||||
|
|
|
@ -404,9 +404,13 @@ int SCHEDULER_REPLY::write(FILE* fout) {
|
|||
// If this is less than one second bigger, bump up by one sec.
|
||||
//
|
||||
if (request_delay || config.min_sendwork_interval) {
|
||||
double min_delay_needed=1.01*config.min_sendwork_interval;
|
||||
if (min_delay_needed<config.min_sendwork_interval+1) min_delay_needed=config.min_sendwork_interval+1;
|
||||
if (request_delay<min_delay_needed) request_delay=min_delay_needed;
|
||||
double min_delay_needed = 1.01*config.min_sendwork_interval;
|
||||
if (min_delay_needed < config.min_sendwork_interval+1) {
|
||||
min_delay_needed = config.min_sendwork_interval+1;
|
||||
}
|
||||
if (request_delay<min_delay_needed) {
|
||||
request_delay=min_delay_needed;
|
||||
}
|
||||
fprintf(fout, "<request_delay>%f</request_delay>\n", request_delay);
|
||||
log_messages.printf(SCHED_MSG_LOG::MSG_NORMAL,
|
||||
"sending delay request %f\n", request_delay
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
print "add is deprecated. Use xadd instead.\n"
|
||||
raise SystemExit
|
||||
|
||||
# $Id$
|
||||
|
||||
|
||||
|
|
18
tools/xadd
18
tools/xadd
|
@ -2,6 +2,24 @@
|
|||
|
||||
# $Id$
|
||||
|
||||
'''
|
||||
Add platform and application records to the BOINC database.
|
||||
Reads info from "project.xml", e.g.:
|
||||
|
||||
<boinc>
|
||||
<platform>
|
||||
<name>i686-pc-linux-gnu</name>
|
||||
<user_friendly_name>Linux/x86</user_friendly_name>
|
||||
</platform>
|
||||
<app>
|
||||
<name>astropulse</name>
|
||||
<user_friendly_name>AstroPulse</user_friendly_name>
|
||||
</app>
|
||||
</boinc>
|
||||
|
||||
See http://boinc.berkeley.edu/tool_xadd.php
|
||||
'''
|
||||
|
||||
import database, db_mid, projectxml
|
||||
|
||||
database.connect()
|
||||
|
|
Loading…
Reference in New Issue