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
the alphabetically sorted sequence, so we can't use my earlier
shortcut in checking for existing entries.
- Mgr: If a slide show has only one slide, load it only once.
clientgui/
sg_TaskPanel.cpp

View File

@ -99,24 +99,30 @@ void CSlideShowPanel::AdvanceSlideShow(bool changeSlide) {
}
} else {
// 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 (changeSlide) {
if (++(selData->lastSlideShown) >= numSlides) {
selData->lastSlideShown = 0;
if (++newSlide >= numSlides) {
newSlide = 0;
}
}
}
if (selData->lastSlideShown < 0) {
selData->lastSlideShown = 0;
if (newSlide < 0) {
newSlide = 0;
}
wxBitmap *bm = new wxBitmap();
bm->LoadFile(selData->slideShowFileNames[selData->lastSlideShown], wxBITMAP_TYPE_ANY);
m_SlideBitmap = *bm;
delete bm;
if (selData->lastSlideShown != newSlide) { // Don't update if only one slide
selData->lastSlideShown = newSlide;
if (m_SlideBitmap.Ok()) {
m_bCurrentSlideIsDefault = false;
wxBitmap *bm = new wxBitmap();
bm->LoadFile(selData->slideShowFileNames[newSlide], wxBITMAP_TYPE_ANY);
if (bm->Ok()) {
m_SlideBitmap = *bm;
delete bm;
m_bCurrentSlideIsDefault = false;
}
}
}
if (m_SlideBitmap.Ok()) {