diff --git a/checkin_notes b/checkin_notes index 4f8de7f67e..6a00bbc869 100644 --- a/checkin_notes +++ b/checkin_notes @@ -4816,3 +4816,12 @@ Charlie 28 May 2009 mac_build/ boinc.xcodeproj/ project.pbxproj + +Charlie 28 May 2009 + SS: Add new optional boolean xml tag ; if true, then launch + default screensaver graphics app first, else run science graphics first. + + clientscr/ + screensaver.cpp, .h + Mac_Saver_Module.h + screensaver_win.h diff --git a/clientscr/Mac_Saver_Module.h b/clientscr/Mac_Saver_Module.h index 8f360ab2a5..4d41470111 100644 --- a/clientscr/Mac_Saver_Module.h +++ b/clientscr/Mac_Saver_Module.h @@ -85,6 +85,7 @@ protected: double m_fGFXDefaultPeriod; double m_fGFxSciencePeriod; double m_fGFXChangePeriod; + bool m_bShow_default_ss_first; bool m_bScience_gfx_running; bool m_bDefault_gfx_running; bool m_bConnected; diff --git a/clientscr/screensaver.cpp b/clientscr/screensaver.cpp index be328500b0..4051f960e7 100644 --- a/clientscr/screensaver.cpp +++ b/clientscr/screensaver.cpp @@ -374,6 +374,8 @@ int CScreensaver::launch_default_screensaver(char *dir_path, int& graphics_appli 0, graphics_application ); + + BOINCTRACE(_T("launch_default_screensaver returned %d\n"), retval); #else // For unknown reasons, the graphics application exits with @@ -407,8 +409,9 @@ int CScreensaver::launch_default_screensaver(char *dir_path, int& graphics_appli 0, graphics_application ); - + BOINCTRACE(_T("launch_default_screensaver %s returned %d\n"), full_path, retval); + #endif return retval; } @@ -485,6 +488,7 @@ void *CScreensaver::DataManagementProc() m_bDefault_ss_exists = false; m_bScience_gfx_running = false; m_bDefault_gfx_running = false; + m_bShow_default_ss_first = false; m_fGFXDefaultPeriod = GFX_DEFAULT_PERIOD; m_fGFxSciencePeriod = GFX_SCIENCE_PERIOD; m_fGFXChangePeriod = GFX_CHANGE_PERIOD; @@ -501,8 +505,15 @@ void *CScreensaver::DataManagementProc() strlcat(full_path, PATH_SEPARATOR, sizeof(full_path)); strlcat(full_path, THE_DEFAULT_SS_EXECUTABLE, sizeof(full_path)); + GetDisplayPeriods(default_data_dir_path); + if (boinc_file_exists(full_path)) { m_bDefault_ss_exists = true; + } else { + SetError(TRUE, SCRAPPERR_CANTLAUNCHDEFAULTGFXAPP); // No GFX App is running: show moving BOINC logo + } + + if (m_bDefault_ss_exists && m_bShow_default_ss_first) { ss_phase = DEFAULT_SS_PHASE; default_phase_start_time = dtime(); science_phase_start_time = 0; @@ -511,10 +522,7 @@ void *CScreensaver::DataManagementProc() ss_phase = SCIENCE_SS_PHASE; default_phase_start_time = 0; science_phase_start_time = dtime(); - SetError(TRUE, SCRAPPERR_CANTLAUNCHDEFAULTGFXAPP); // No GFX App is running: show moving BOINC logo } - - GetDisplayPeriods(default_data_dir_path); while (true) { @@ -877,12 +885,14 @@ void CScreensaver::GetDisplayPeriods(char *dir_path) { XML_PARSER xp(&mf); while (mf.fgets(buf, sizeof(buf))) { + if (parse_bool(buf, "default_ss_first", m_bShow_default_ss_first)) continue; if (parse_double(buf, "", m_fGFXDefaultPeriod)) continue; if (parse_double(buf, "", m_fGFxSciencePeriod)) continue; if (parse_double(buf, "", m_fGFXChangePeriod)) continue; + } fclose(f); - - BOINCTRACE(_T("CScreensaver::GetDisplayPeriods: m_fGFXDefaultPeriod=%f, m_fGFxSciencePeriod=%f, m_fGFXChangePeriod=%f\n"), - m_fGFXDefaultPeriod, m_fGFxSciencePeriod, m_fGFXChangePeriod); + + BOINCTRACE(_T("CScreensaver::GetDisplayPeriods: m_bShow_default_ss_first=%d, m_fGFXDefaultPeriod=%f, m_fGFxSciencePeriod=%f, m_fGFXChangePeriod=%f\n"), + (int)m_bShow_default_ss_first, m_fGFXDefaultPeriod, m_fGFxSciencePeriod, m_fGFXChangePeriod); } diff --git a/clientscr/screensaver_win.h b/clientscr/screensaver_win.h index 062aa625ad..f44aa559dc 100644 --- a/clientscr/screensaver_win.h +++ b/clientscr/screensaver_win.h @@ -218,6 +218,7 @@ protected: double m_fGFXDefaultPeriod; double m_fGFxSciencePeriod; double m_fGFXChangePeriod; + bool m_bShow_default_ss_first; bool m_bScience_gfx_running; bool m_bDefault_gfx_running;