Skip to content

Commit

Permalink
Add convenience methods to display notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
jyavenard committed Jul 7, 2013
1 parent 45460b5 commit ea6365d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
16 changes: 16 additions & 0 deletions mythtv/libs/libmythui/mythuinotificationcenter.cpp
Expand Up @@ -987,3 +987,19 @@ void MythUINotificationCenter::UpdateScreen(MythScreenType *screen)
s->doInit();
}
}

void ShowNotificationError(const QString &msg,
const QString &from,
const QString &detail)
{
MythErrorNotification n(msg, from, detail);
MythUINotificationCenter::GetInstance()->Queue(n);
}

void ShowNotification(const QString &msg,
const QString &from,
const QString &detail)
{
MythNotification n(msg, from, detail);
MythUINotificationCenter::GetInstance()->Queue(n);
}
11 changes: 11 additions & 0 deletions mythtv/libs/libmythui/mythuinotificationcenter.h
Expand Up @@ -140,4 +140,15 @@ private slots:
static MythUINotificationCenter *g_singleton;
};

/**
* convenience utility to display error message as notification
*/
MUI_PUBLIC void ShowNotificationError(const QString &msg,
const QString &from = "",
const QString &detail = "");

MUI_PUBLIC void ShowNotification(const QString &msg,
const QString &from = "",
const QString &detail = "");

#endif /* defined(__MythTV__mythnotifications__) */

0 comments on commit ea6365d

Please sign in to comment.