mirror of https://github.com/BOINC/boinc.git
parent
b6c5c35b02
commit
9988164edc
|
@ -50,6 +50,9 @@ bool CLIENT_STATE::start_new_file_xfer() {
|
|||
void CLIENT_STATE::trunc_stderr_stdout() {
|
||||
double f_size;
|
||||
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
|
||||
// If the stderr.txt or stdout.txt files are too big, reset them
|
||||
// TODO: should we tell the user we're resetting these?
|
||||
file_size(STDERR_FILE_NAME, f_size);
|
||||
|
|
|
@ -1578,6 +1578,23 @@ LRESULT CMainWindow::OnStatusIcon(WPARAM wParam, LPARAM lParam)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
//////////
|
||||
// CMainWindow::CheckIdle
|
||||
// arguments: void
|
||||
// returns: void
|
||||
// function: check user's idle time for suspension of apps
|
||||
void CMainWindow::CheckIdle() {
|
||||
if (gstate.global_prefs.idle_time_to_run > 0) {
|
||||
if (GetUserIdleTime() > 1000 * gstate.global_prefs.idle_time_to_run) {
|
||||
gstate.user_idle = true;
|
||||
} else {
|
||||
gstate.user_idle = false;
|
||||
}
|
||||
} else {
|
||||
gstate.user_idle = true;
|
||||
}
|
||||
}
|
||||
|
||||
//////////
|
||||
// CMainWindow::OnTimer
|
||||
// arguments: uEventID: timer's id
|
||||
|
@ -1592,26 +1609,13 @@ void CMainWindow::OnTimer(UINT uEventID)
|
|||
|
||||
// update state and gui
|
||||
while(gstate.do_something());
|
||||
NetCheck(); // need to check if network connection can be terminated
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
NetCheck(); // check if network connection can be terminated
|
||||
if(!IsSuspended()) {
|
||||
// check user's idle time for suspension of apps
|
||||
if (gstate.global_prefs.idle_time_to_run > 0) {
|
||||
if (GetUserIdleTime() > 1000 * gstate.global_prefs.idle_time_to_run) {
|
||||
gstate.user_idle = true;
|
||||
} else {
|
||||
gstate.user_idle = false;
|
||||
}
|
||||
} else {
|
||||
gstate.user_idle = true;
|
||||
}
|
||||
|
||||
CheckIdle();
|
||||
UpdateGUI(&gstate);
|
||||
gstate.trunc_stderr_stdout();
|
||||
}
|
||||
|
||||
gstate.trunc_stderr_stdout();
|
||||
|
||||
// Start the timer again
|
||||
m_nGuiTimerID = SetTimer(GUI_TIMER, GUI_WAIT, (TIMERPROC) NULL);
|
||||
}
|
||||
|
@ -1626,4 +1630,5 @@ void delete_curtain() {
|
|||
}
|
||||
|
||||
void project_add_failed(PROJECT* project) {
|
||||
// TODO: To be filled in
|
||||
}
|
||||
|
|
|
@ -114,6 +114,7 @@ protected:
|
|||
UINT m_uEndSSMsg; // ID of end screensaver request message
|
||||
|
||||
COLORREF GetPieColor(int);
|
||||
void CheckIdle();
|
||||
void ShowTab(int);
|
||||
void SetStatusIcon(DWORD);
|
||||
void SaveListControls();
|
||||
|
|
Loading…
Reference in New Issue