diff --git a/checkin_notes b/checkin_notes
index d11c4a19c3..d02609a622 100755
--- a/checkin_notes
+++ b/checkin_notes
@@ -12715,3 +12715,14 @@ Rom 20 Nov 2006
NetworkTracker.cpp
lib/
network.C
+
+David 20 Nov 2006
+ - GUI RPC: return task and network mode delays in get_cc_status().
+ This tells the GUI how long the current snooze is going to last.
+
+ client/
+ client_types.C,h
+ gui_rpc_server_ops.C
+ lib/
+ gui_rpc_client.h
+ gui_rpc_client_ops.C
diff --git a/client/client_types.C b/client/client_types.C
index 15227c51e7..869833de78 100644
--- a/client/client_types.C
+++ b/client/client_types.C
@@ -1796,4 +1796,12 @@ int MODE::get_current() {
}
}
+double MODE::delay() {
+ if (temp_timeout > gstate.now) {
+ return temp_timeout - gstate.now;
+ } else {
+ return 0;
+ }
+}
+
const char *BOINC_RCSID_b81ff9a584 = "$Id$";
diff --git a/client/client_types.h b/client/client_types.h
index 0fd839dc71..1e803c5aa4 100644
--- a/client/client_types.h
+++ b/client/client_types.h
@@ -511,6 +511,7 @@ public:
void set(int mode, double duration);
int get_perm();
int get_current();
+ double delay();
};
#endif
diff --git a/client/gui_rpc_server_ops.C b/client/gui_rpc_server_ops.C
index d9c0766e88..1b470aa968 100644
--- a/client/gui_rpc_server_ops.C
+++ b/client/gui_rpc_server_ops.C
@@ -527,6 +527,8 @@ static void handle_get_cc_status(MIOFILE& fout) {
" %d\n"
" %d\n"
" %d\n"
+ " %f\n"
+ " %f\n"
"\n",
net_status.network_status(),
gstate.acct_mgr_info.password_error?1:0,
@@ -535,7 +537,9 @@ static void handle_get_cc_status(MIOFILE& fout) {
gstate.run_mode.get_current(),
gstate.network_mode.get_current(),
gstate.run_mode.get_perm(),
- gstate.network_mode.get_perm()
+ gstate.network_mode.get_perm(),
+ gstate.run_mode.delay(),
+ gstate.network_mode.delay()
);
}
diff --git a/lib/gui_rpc_client.h b/lib/gui_rpc_client.h
index 4b35814777..07c11d7cc0 100644
--- a/lib/gui_rpc_client.h
+++ b/lib/gui_rpc_client.h
@@ -469,8 +469,10 @@ struct CC_STATUS {
int network_suspend_reason;
int task_mode; // always/auto/never; see common_defs.h
int network_mode;
- int task_mode_perm;
+ int task_mode_perm; // same, but permanent version
int network_mode_perm;
+ double task_mode_delay; // time until perm becomes actual
+ double network_mode_delay;
CC_STATUS();
~CC_STATUS();
diff --git a/lib/gui_rpc_client_ops.C b/lib/gui_rpc_client_ops.C
index 040cf699d2..114c5a9778 100644
--- a/lib/gui_rpc_client_ops.C
+++ b/lib/gui_rpc_client_ops.C
@@ -964,6 +964,8 @@ int CC_STATUS::parse(MIOFILE& in) {
else if (parse_int(buf, "", network_mode)) continue;
else if (parse_int(buf, "", task_mode_perm)) continue;
else if (parse_int(buf, "", network_mode_perm)) continue;
+ else if (parse_double(buf, "", task_mode_delay)) continue;
+ else if (parse_double(buf, "", network_mode_delay)) continue;
}
return ERR_XML_PARSE;
}
@@ -977,6 +979,8 @@ void CC_STATUS::clear() {
network_mode = -1;
task_mode_perm = -1;
network_mode_perm = -1;
+ task_mode_delay = 0;
+ network_mode_delay = 0;
}
/////////// END OF PARSING FUNCTIONS. RPCS START HERE ////////////////