Displays of current credit on cell phones and PDAs.
+
+
+Displays that use colors to distinguish BOINC projects should use
+these colors.
+
-BOINC provides a flexible architecture for distributing
-statistics data, with the goal of enabling new display applications.
+BOINC provides a flexible architecture for distributing statistics data,
+with the goal of enabling new display applications.
diff --git a/lib/boinc_cmd.C b/lib/boinc_cmd.C
index adfff137a3..3e11b7bbf9 100644
--- a/lib/boinc_cmd.C
+++ b/lib/boinc_cmd.C
@@ -64,6 +64,7 @@ Commands:\n\
--get_results show results\n\
--get_file_transfers show file transfers\n\
--get_project_status show status of all projects\n\
+ --get_simple_gui_info show status of projects and active results\n\
--get_disk_usage\n\
--result url result_name {suspend | resume | abort | graphics_window | graphics_fullscreen}\n\
--project url {reset | detach | update | suspend | resume | nomorework | allowmorework}\n\
@@ -228,6 +229,10 @@ int main(int argc, char** argv) {
PROJECTS ps;
retval = rpc.get_project_status(ps);
if (!retval) ps.print();
+ } else if (!strcmp(cmd, "--get_simple_gui_info")) {
+ SIMPLE_GUI_INFO sgi;
+ retval = rpc.get_simple_gui_info(sgi);
+ if (!retval) sgi.print();
} else if (!strcmp(cmd, "--get_disk_usage")) {
PROJECTS ps;
retval = rpc.get_disk_usage(ps);
diff --git a/lib/gui_rpc_client.h b/lib/gui_rpc_client.h
index 406effbbfd..63f486a2b8 100644
--- a/lib/gui_rpc_client.h
+++ b/lib/gui_rpc_client.h
@@ -508,6 +508,12 @@ struct CC_STATUS {
bool ams_password_error;
};
+struct SIMPLE_GUI_INFO {
+ std::vector projects;
+ std::vector results;
+ void print();
+};
+
class RPC_CLIENT {
public:
int sock;
@@ -541,6 +547,7 @@ public:
int get_state(CC_STATE&);
int get_results(RESULTS&);
int get_file_transfers(FILE_TRANSFERS&);
+ int get_simple_gui_info(SIMPLE_GUI_INFO&);
int get_project_status(CC_STATE&);
int get_project_status(PROJECTS&);
int get_disk_usage(PROJECTS&);
diff --git a/lib/gui_rpc_client_ops.C b/lib/gui_rpc_client_ops.C
index d82f6efe13..ab3b6dbe7f 100644
--- a/lib/gui_rpc_client_ops.C
+++ b/lib/gui_rpc_client_ops.C
@@ -1045,6 +1045,37 @@ int RPC_CLIENT::get_file_transfers(FILE_TRANSFERS& t) {
return retval;
}
+int RPC_CLIENT::get_simple_gui_info(SIMPLE_GUI_INFO& sgi) {
+ int retval;
+ SET_LOCALE sl;
+ char buf[256];
+ RPC rpc(this);
+
+ sgi.projects.clear();
+ sgi.results.clear();
+ retval = rpc.do_rpc("\n");
+ if (!retval) {
+ while (rpc.fin.fgets(buf, 256)) {
+ if (match_tag(buf, "")) break;
+ else if (match_tag(buf, "")) {
+ PROJECT* project = new PROJECT();
+ project->parse(rpc.fin);
+ sgi.projects.push_back(project);
+ continue;
+ }
+ else if (match_tag(buf, "")) {
+ RESULT* result = new RESULT();
+ result->parse(rpc.fin);
+ sgi.results.push_back(result);
+ continue;
+ }
+ }
+ }
+ return retval;
+}
+
+// creates new array of PROJECTs
+//
int RPC_CLIENT::get_project_status(PROJECTS& p) {
int retval;
SET_LOCALE sl;
@@ -1068,6 +1099,10 @@ int RPC_CLIENT::get_project_status(PROJECTS& p) {
return retval;
}
+// Updates the PROJECT array in the CC_STATE in place;
+// flags any projects that don't exist anymore.
+// KLUDGE - doesn't belong here
+//
int RPC_CLIENT::get_project_status(CC_STATE& state) {
int retval;
SET_LOCALE sl;
diff --git a/lib/gui_rpc_client_print.C b/lib/gui_rpc_client_print.C
index c41c8fedcc..6d6ba61266 100644
--- a/lib/gui_rpc_client_print.C
+++ b/lib/gui_rpc_client_print.C
@@ -167,6 +167,20 @@ void HOST_INFO::print() {
printf(" disk free: %f\n", d_free);
}
+void SIMPLE_GUI_INFO::print() {
+ unsigned int i;
+ printf("======== Projects ========\n");
+ for (i=0; iprint();
+ }
+ printf("\n======== Results ========\n");
+ for (i=0; iprint();
+ }
+}
+
void CC_STATE::print() {
unsigned int i;
printf("======== Projects ========\n");