From ea6365dda41aac162d6bd78189317a429667726b Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Sun, 7 Jul 2013 20:09:34 +1000 Subject: [PATCH] Add convenience methods to display notifications --- .../libs/libmythui/mythuinotificationcenter.cpp | 16 ++++++++++++++++ mythtv/libs/libmythui/mythuinotificationcenter.h | 11 +++++++++++ 2 files changed, 27 insertions(+) diff --git a/mythtv/libs/libmythui/mythuinotificationcenter.cpp b/mythtv/libs/libmythui/mythuinotificationcenter.cpp index 1cf8c4f0002..905bdb9703b 100644 --- a/mythtv/libs/libmythui/mythuinotificationcenter.cpp +++ b/mythtv/libs/libmythui/mythuinotificationcenter.cpp @@ -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); +} diff --git a/mythtv/libs/libmythui/mythuinotificationcenter.h b/mythtv/libs/libmythui/mythuinotificationcenter.h index 32133c87746..79ffda9d7e1 100644 --- a/mythtv/libs/libmythui/mythuinotificationcenter.h +++ b/mythtv/libs/libmythui/mythuinotificationcenter.h @@ -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__) */