From e5c78615183b814d6216d227ab241f1f95afdddd Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Thu, 18 Nov 2004 02:31:40 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4586 --- checkin_notes | 8 ++++++++ client/win/win_screensaver.cpp | 31 +++++++++++++++++++++++++------ client/win/win_screensaver.h | 5 ++++- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/checkin_notes b/checkin_notes index a51bec50e4..308332d378 100755 --- a/checkin_notes +++ b/checkin_notes @@ -19739,3 +19739,11 @@ Rom 17 Nov 2004 wingui_mainwindow.cpp lib/ gui_rpc_client.h + +Rom 17 Nov 2004 + - Bug Fix: Use the project name in the system status message instead of the + result name. + + client/win/ + win_screensaver.cpp, .h + diff --git a/client/win/win_screensaver.cpp b/client/win/win_screensaver.cpp index b74fc50ad7..db5aac5c9b 100755 --- a/client/win/win_screensaver.cpp +++ b/client/win/win_screensaver.cpp @@ -122,6 +122,7 @@ CScreensaver::CScreensaver() m_bPaintingInitialized = FALSE; m_bBOINCCoreNotified = FALSE; + m_bResetCoreState = TRUE; ZeroMemory( m_Monitors, sizeof(m_Monitors) ); m_dwNumMonitors = 0; @@ -779,6 +780,15 @@ LRESULT CScreensaver::PrimarySaverProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPA m_bErrorMode = FALSE; m_hrError = 0; + // Lets try and get the current state of the CC + if (m_bResetCoreState) + { + iReturnValue = rpc.get_state( state ); + BOINCTRACE(_T("CScreensaver::PrimarySaverProc - get_state iReturnValue = '%d'\n"), iReturnValue); + if ( 0 == iReturnValue ) + m_bResetCoreState = FALSE; + } + // Lets try and get the current status of the CC iReturnValue = rpc.get_screensaver_mode( iStatus ); BOINCTRACE(_T("CScreensaver::PrimarySaverProc - get_screensaver_mode iReturnValue = '%d'\n"), iReturnValue); @@ -1179,6 +1189,7 @@ VOID CScreensaver::UpdateErrorBox() FLOAT fTimeDelta; RESULTS results; + PROJECT* pProject; TCHAR szBuffer[256]; bool bIsActive = false; bool bIsExecuting = false; @@ -1209,13 +1220,21 @@ VOID CScreensaver::UpdateErrorBox() bIsExecuting = ( CPU_SCHED_SCHEDULED == results.results.at(iIndex)->scheduler_state ); if ( !( bIsActive ) || !( bIsDownloaded ) || !( bIsExecuting ) ) continue; - StringCbPrintf( szBuffer, sizeof(szBuffer) / sizeof(TCHAR), - _T("%s: %.2f%%\n"), - results.results.at(iIndex)->name.c_str(), - results.results.at(iIndex)->fraction_done * 100 - ); + pProject = state.lookup_project( results.results.at( iIndex )->project_url ); + if ( NULL != pProject ) + { + StringCbPrintf( szBuffer, sizeof(szBuffer) / sizeof(TCHAR), + _T("%s: %.2f%%\n"), + pProject->project_name.c_str(), + results.results.at(iIndex)->fraction_done * 100 + ); - StringCbCat( m_szError, sizeof(m_szError) / sizeof(TCHAR), szBuffer ); + StringCbCat( m_szError, sizeof(m_szError) / sizeof(TCHAR), szBuffer ); + } + else + { + m_bResetCoreState = TRUE; + } } m_szError[ sizeof(m_szError) -1 ] = '\0'; } diff --git a/client/win/win_screensaver.h b/client/win/win_screensaver.h index 12ef4d9af4..b55f1206c0 100644 --- a/client/win/win_screensaver.h +++ b/client/win/win_screensaver.h @@ -146,7 +146,8 @@ protected: static INT_PTR CALLBACK ConfigureDialogProcStub( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); protected: - RPC_CLIENT rpc; + RPC_CLIENT rpc; + CC_STATE state; SaverMode m_SaverMode; // sm_config, sm_full, sm_preview, etc. BOOL m_bAllScreensSame; // If TRUE, show same image on all screens @@ -175,6 +176,8 @@ protected: TCHAR m_strWindowTitle[200]; // Title for the app's window BOOL m_bBOINCCoreNotified; + BOOL m_bResetCoreState; + }; #endif