Permalink
Browse files

Add MythBusyNotification type

  • Loading branch information...
jyavenard committed Aug 14, 2013
1 parent c9e8dcc commit e04aba490a52172db5ce93603b03a908407dd829
@@ -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;
@@ -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__) */
@@ -232,7 +232,8 @@ void MythNotificationScreen::SetNotification(MythNotification &notification)
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;
@@ -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

0 comments on commit e04aba4

Please sign in to comment.