2005-01-20 23:22:22 +00:00
|
|
|
// Berkeley Open Infrastructure for Network Computing
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2005 University of California
|
2002-11-04 18:57:47 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// This is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation;
|
|
|
|
// either version 2.1 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This software is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// To view the GNU Lesser General Public License visit
|
|
|
|
// http://www.gnu.org/copyleft/lesser.html
|
|
|
|
// or write to the Free Software Foundation, Inc.,
|
|
|
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2002-11-04 18:57:47 +00:00
|
|
|
|
2004-12-06 23:02:47 +00:00
|
|
|
#include "stdafx.h"
|
2002-08-12 23:57:49 +00:00
|
|
|
|
2004-04-08 08:25:19 +00:00
|
|
|
#include "client_msgs.h"
|
2002-08-12 00:51:42 +00:00
|
|
|
#include "wingui.h"
|
2002-12-18 20:24:56 +00:00
|
|
|
#include "wingui_mainwindow.h"
|
2002-11-04 18:57:47 +00:00
|
|
|
|
2003-05-21 17:59:10 +00:00
|
|
|
void show_message(PROJECT* p, char* msg, int priority) {
|
2003-05-13 18:55:07 +00:00
|
|
|
char* x;
|
2003-05-21 17:59:10 +00:00
|
|
|
char message[1024];
|
2004-06-19 05:09:46 +00:00
|
|
|
char* time_string = time_to_string(time(0));
|
2002-10-13 21:51:23 +00:00
|
|
|
|
2003-05-21 17:59:10 +00:00
|
|
|
strcpy(message, msg);
|
2004-04-20 02:47:51 +00:00
|
|
|
while (strlen(message)&&message[strlen(message)-1] == '\n') {
|
2003-05-21 17:59:10 +00:00
|
|
|
message[strlen(message)-1] = 0;
|
|
|
|
}
|
|
|
|
if (p) {
|
2003-05-13 18:55:07 +00:00
|
|
|
x = p->get_project_name();
|
2003-02-21 01:05:43 +00:00
|
|
|
} else {
|
2004-03-23 01:44:47 +00:00
|
|
|
x = "---";
|
2004-06-19 05:09:46 +00:00
|
|
|
}
|
2003-02-21 01:05:43 +00:00
|
|
|
|
|
|
|
if(g_myWnd) {
|
2003-05-13 18:55:07 +00:00
|
|
|
g_myWnd->MessageUser(x, message, priority);
|
2002-11-23 00:52:21 +00:00
|
|
|
}
|
2004-06-17 04:49:34 +00:00
|
|
|
if (priority == MSG_INFO) {
|
2004-06-19 05:09:46 +00:00
|
|
|
fprintf(stdout, "%s [%s] %s\n", time_string, x, message);
|
2004-06-17 04:49:34 +00:00
|
|
|
} else {
|
2004-06-19 05:09:46 +00:00
|
|
|
fprintf(stderr, "%s [%s] %s\n", time_string, x, message);
|
2004-06-17 04:49:34 +00:00
|
|
|
}
|
|
|
|
record_message(p, priority, time(0), message);
|
2002-12-06 19:45:38 +00:00
|
|
|
}
|
|
|
|
|
2002-12-19 22:43:38 +00:00
|
|
|
int add_new_project() {
|
2002-12-06 19:45:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2002-12-18 20:24:56 +00:00
|
|
|
BOOL RequestNetConnect()
|
2002-11-04 18:57:47 +00:00
|
|
|
{
|
2002-12-18 20:24:56 +00:00
|
|
|
if(g_myWnd) {
|
|
|
|
return g_myWnd->RequestNetConnect();
|
2002-12-09 23:53:37 +00:00
|
|
|
}
|
2002-12-18 20:24:56 +00:00
|
|
|
return FALSE;
|
2002-12-09 23:53:37 +00:00
|
|
|
}
|
2004-12-08 00:40:19 +00:00
|
|
|
|
2005-01-02 18:29:53 +00:00
|
|
|
const char *BOINC_RCSID_d2f8923348 = "$Id$";
|