Skip to content

Commit

Permalink
Gallery: Reset theme widgets correctly
Browse files Browse the repository at this point in the history
Some theme widgets aren't being reset correctly leading to theme issues (Steppes & Blue Abstract)
  • Loading branch information
dizygotheca committed May 4, 2016
1 parent 11a7be6 commit ed7473f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
24 changes: 13 additions & 11 deletions mythtv/programs/mythfrontend/galleryslideview.cpp
Expand Up @@ -30,6 +30,7 @@ GallerySlideView::GallerySlideView(MythScreenStack *parent, const char *name,
m_slides(),
m_infoList(*this),
m_slideShowTime(gCoreContext->GetNumSetting("GallerySlideShowTime", 3000)),
m_statusText(),
m_playing(false),
m_suspended(false),
m_showCaptions(gCoreContext->GetNumSetting("GalleryShowSlideCaptions", true)),
Expand Down Expand Up @@ -519,7 +520,7 @@ void GallerySlideView::HideInfo()
void GallerySlideView::ShowCaptions()
{
m_showCaptions = true;
m_uiHideCaptions->SetText("");
m_uiHideCaptions->Reset();
}


Expand Down Expand Up @@ -702,7 +703,7 @@ void GallerySlideView::ShowNextSlide(int inc, bool useTransition)
if (m_uiSlideCount)
m_uiSlideCount->SetText("0/0");
if (m_uiCaptionText)
m_uiCaptionText->SetText("");
m_uiCaptionText->Reset();
}
}

Expand All @@ -728,9 +729,9 @@ void GallerySlideView::PlayVideo()
*/
void GallerySlideView::SetStatus(QString msg, bool delay)
{
m_statusText = msg;
if (m_uiStatus)
{
m_uiStatus->SetText(msg);
if (delay)
m_delay.start();
else
Expand All @@ -742,21 +743,22 @@ void GallerySlideView::SetStatus(QString msg, bool delay)
void GallerySlideView::ShowStatus()
{
if (m_uiStatus)
m_uiStatus->SetVisible(true);
m_uiStatus->SetText(m_statusText);
}


void GallerySlideView::ClearStatus(Slide &slide)
{
if (m_uiStatus)
{
m_delay.stop();

if (!slide.FailedLoad())

m_uiStatus->SetVisible(false);

else if (ImagePtrK im = slide.GetImageData())

SetStatus(tr("Failed to load %1").arg(im->m_filePath));
if (slide.FailedLoad())
{
ImagePtrK im = slide.GetImageData();
SetStatus(tr("Failed to load %1").arg(im ? im->m_filePath : "?"));
}
else
m_uiStatus->Reset();
}
}
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/galleryslideview.h
Expand Up @@ -84,12 +84,12 @@ private slots:
int m_slideShowTime; //!< Time to display a slide in a slideshow
QTimer m_timer; //!< Slide duration timer
QTimer m_delay; //!< Status delay timer
QString m_statusText; //!< Text to display as status
bool m_playing; //!< True when slideshow is running
bool m_suspended; //!< True when transition is running or video playing
bool m_showCaptions; //!< If true, captions are shown
bool m_transitioning; //!< True when a transition is in progress
bool m_editsAllowed; //!< True when edits are enabled

};

#endif // GALLERYWIDGET_H
9 changes: 9 additions & 0 deletions mythtv/programs/mythfrontend/gallerythumbview.cpp
Expand Up @@ -615,7 +615,10 @@ void GalleryThumbView::LoadData(int parent)
{
m_imageList->SetVisible(true);
if (m_emptyText)
{
m_emptyText->SetVisible(false);
m_emptyText->Reset();
}

// Construct the buttonlist
BuildImageList();
Expand Down Expand Up @@ -858,9 +861,15 @@ void GalleryThumbView::UpdateScanProgress(const QString &scanner,
if (m_scanActive.isEmpty())
{
if (m_scanProgressText)
{
m_scanProgressText->SetVisible(false);
m_scanProgressText->Reset();
}
if (m_scanProgressBar)
{
m_scanProgressBar->SetVisible(false);
m_scanProgressBar->Reset();
}

m_scanProgress.clear();

Expand Down

0 comments on commit ed7473f

Please sign in to comment.