Mgr: If a slide show has only one slide, load it only once

svn path=/trunk/boinc/; revision=24578
This commit is contained in:
Charlie Fenton 2011-11-11 12:36:34 +00:00
parent 46157c721d
commit 14cf8873b0
2 changed files with 18 additions and 11 deletions

View File

@ -8380,6 +8380,7 @@ Charlie 11 Nov 2011
introduced on 9 November. Deleting an entry cvan create a gap in introduced on 9 November. Deleting an entry cvan create a gap in
the alphabetically sorted sequence, so we can't use my earlier the alphabetically sorted sequence, so we can't use my earlier
shortcut in checking for existing entries. shortcut in checking for existing entries.
- Mgr: If a slide show has only one slide, load it only once.
clientgui/ clientgui/
sg_TaskPanel.cpp sg_TaskPanel.cpp

View File

@ -99,24 +99,30 @@ void CSlideShowPanel::AdvanceSlideShow(bool changeSlide) {
} }
} else { } else {
// TODO: Should we allow slide show to advance if task is not running? // TODO: Should we allow slide show to advance if task is not running?
int newSlide = selData->lastSlideShown;
if (selData->dotColor == greenDot) { // Advance only if running if (selData->dotColor == greenDot) { // Advance only if running
if (changeSlide) { if (changeSlide) {
if (++(selData->lastSlideShown) >= numSlides) { if (++newSlide >= numSlides) {
selData->lastSlideShown = 0; newSlide = 0;
} }
} }
} }
if (selData->lastSlideShown < 0) { if (newSlide < 0) {
selData->lastSlideShown = 0; newSlide = 0;
} }
wxBitmap *bm = new wxBitmap(); if (selData->lastSlideShown != newSlide) { // Don't update if only one slide
bm->LoadFile(selData->slideShowFileNames[selData->lastSlideShown], wxBITMAP_TYPE_ANY);
m_SlideBitmap = *bm; selData->lastSlideShown = newSlide;
delete bm;
if (m_SlideBitmap.Ok()) { wxBitmap *bm = new wxBitmap();
m_bCurrentSlideIsDefault = false; bm->LoadFile(selData->slideShowFileNames[newSlide], wxBITMAP_TYPE_ANY);
if (bm->Ok()) {
m_SlideBitmap = *bm;
delete bm;
m_bCurrentSlideIsDefault = false;
}
} }
} }
if (m_SlideBitmap.Ok()) { if (m_SlideBitmap.Ok()) {