Skip to content

Commit

Permalink
Allow dismissing notification during video playback
Browse files Browse the repository at this point in the history
Fixes #11657
  • Loading branch information
jyavenard committed Jul 10, 2013
1 parent 00bd90d commit 68951ea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
10 changes: 9 additions & 1 deletion mythtv/libs/libmythtv/osd.cpp
Expand Up @@ -269,6 +269,9 @@ bool OSD::Reinit(const QRect &rect, float font_aspect)

bool OSD::IsVisible(void)
{
if (MythUINotificationCenter::GetInstance()->DisplayedNotifications() > 0)
return true;

foreach(MythScreenType* child, m_Children)
{
if (child->IsVisible() &&
Expand All @@ -282,8 +285,13 @@ bool OSD::IsVisible(void)
return false;
}

void OSD::HideAll(bool keepsubs, MythScreenType* except)
void OSD::HideAll(bool keepsubs, MythScreenType* except, bool dropnotification)
{
if (dropnotification)
{
if (MythUINotificationCenter::GetInstance()->RemoveFirst())
return; // we've removed the top window, don't process any further
}
QMutableMapIterator<QString, MythScreenType*> it(m_Children);
while (it.hasNext())
{
Expand Down
3 changes: 2 additions & 1 deletion mythtv/libs/libmythtv/osd.h
Expand Up @@ -139,7 +139,8 @@ class OSD
void SetTimeouts(int _short, int _medium, int _long);

bool IsVisible(void);
void HideAll(bool keepsubs = true, MythScreenType *except = NULL);
void HideAll(bool keepsubs = true, MythScreenType *except = NULL,
bool dropnotification = false);

MythScreenType *GetWindow(const QString &window);
void SetExpiry(const QString &window, enum OSDTimeout timeout,
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -7765,7 +7765,7 @@ bool TV::ClearOSD(const PlayerContext *ctx)
if (osd)
{
osd->DialogQuit();
osd->HideAll();
osd->HideAll(true, NULL, true); // pop OSD screen
res = true;
}
ReturnOSDLock(ctx, osd);
Expand Down

0 comments on commit 68951ea

Please sign in to comment.