diff --git a/mythtv/libs/libmythui/mythnotification.cpp b/mythtv/libs/libmythui/mythnotification.cpp index b96a64e9bfe..c08948fdd7e 100644 --- a/mythtv/libs/libmythui/mythnotification.cpp +++ b/mythtv/libs/libmythui/mythnotification.cpp @@ -22,6 +22,8 @@ QEvent::Type MythNotification::Warning = (QEvent::Type) QEvent::registerEventType(); QEvent::Type MythNotification::Check = (QEvent::Type) QEvent::registerEventType(); +QEvent::Type MythNotification::Busy = + (QEvent::Type) QEvent::registerEventType(); void MythNotification::SetId(int id) { @@ -78,6 +80,10 @@ MythNotification::Type MythNotification::TypeFromString(const QString &type) { return MythNotification::Check; } + else if (type == "busy") + { + return MythNotification::Busy; + } else { return MythNotification::New; diff --git a/mythtv/libs/libmythui/mythnotification.h b/mythtv/libs/libmythui/mythnotification.h index f364f279216..11fdf2562f4 100644 --- a/mythtv/libs/libmythui/mythnotification.h +++ b/mythtv/libs/libmythui/mythnotification.h @@ -29,6 +29,7 @@ class MUI_PUBLIC MythNotification : public MythEvent static Type Error; static Type Warning; static Type Check; + static Type Busy; MythNotification(Type t, void *parent = NULL) : MythEvent(t), m_id(-1), m_parent(parent), m_fullScreen(false), @@ -382,4 +383,12 @@ class MUI_PUBLIC MythCheckNotification : public MythNotification } }; +class MUI_PUBLIC MythBusyNotification : public MythNotification +{ +public: + MythBusyNotification(const QString &title, const QString &author, + const QString &details = QString()) + : MythNotification(Busy, title, author, details) { } +}; + #endif /* defined(__MythTV__mythnotification__) */ diff --git a/mythtv/libs/libmythui/mythnotificationcenter.cpp b/mythtv/libs/libmythui/mythnotificationcenter.cpp index 06b82706aca..07d70db29bb 100644 --- a/mythtv/libs/libmythui/mythnotificationcenter.cpp +++ b/mythtv/libs/libmythui/mythnotificationcenter.cpp @@ -232,7 +232,8 @@ void MythNotificationScreen::SetNotification(MythNotification ¬ification) if (m_type == MythNotification::Error || m_type == MythNotification::Warning || - m_type == MythNotification::Check) + m_type == MythNotification::Check || + m_type == MythNotification::Busy) { m_update |= kImage; update = false; @@ -533,6 +534,10 @@ void MythNotificationScreen::SetErrorState(void) { state = "check"; } + else if (m_type == MythNotification::Busy) + { + state = "busy"; + } else { state = "ok"; @@ -1503,10 +1508,13 @@ void ShowNotification(MythNotification::Type type, if (type == MythNotification::Error || type == MythNotification::Warning || - type == MythNotification::Check) + type == MythNotification::Check || + type == MythNotification::Busy) { n = new MythNotification(type, data); - if (!duration && type != MythNotification::Check) + if (!duration && + type != MythNotification::Check && + type != MythNotification::Busy) { // default duration for those type of notifications is 10s duration = 10; diff --git a/mythtv/programs/mythutil/commandlineparser.cpp b/mythtv/programs/mythutil/commandlineparser.cpp index 4ffa672c56b..141235d53f9 100644 --- a/mythtv/programs/mythutil/commandlineparser.cpp +++ b/mythtv/programs/mythutil/commandlineparser.cpp @@ -180,7 +180,7 @@ void MythUtilCommandLineParser::LoadArguments(void) ->SetChildOf("notification"); add("--visibility", "visibility", 0, "(optional) bitmask indicating where to show the notification", "") ->SetChildOf("notification"); - add("--type", "type", "type", "(optional) type of notification (normal, error, warning, check", "") + add("--type", "type", "type", "(optional) type of notification (normal, error, warning, check, busy", "") ->SetChildOf("notification"); // Generic Options used by more than one utility