From 9988164edcf61df07d5529148c4d469f4d4861cc Mon Sep 17 00:00:00 2001 From: Dan Werthimer Date: Wed, 14 May 2003 18:18:33 +0000 Subject: [PATCH] no message svn path=/trunk/boinc/; revision=1194 --- client/cs_files.C | 3 +++ client/win/wingui_mainwindow.cpp | 37 ++++++++++++++++++-------------- client/win/wingui_mainwindow.h | 1 + 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/client/cs_files.C b/client/cs_files.C index ab6e48025b..56a0dbc64e 100644 --- a/client/cs_files.C +++ b/client/cs_files.C @@ -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); diff --git a/client/win/wingui_mainwindow.cpp b/client/win/wingui_mainwindow.cpp index 563061d2a7..79ad8c8bc1 100755 --- a/client/win/wingui_mainwindow.cpp +++ b/client/win/wingui_mainwindow.cpp @@ -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 } diff --git a/client/win/wingui_mainwindow.h b/client/win/wingui_mainwindow.h index c4c1b8becd..0c45b666e3 100755 --- a/client/win/wingui_mainwindow.h +++ b/client/win/wingui_mainwindow.h @@ -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();