本文整理汇总了C++中EventPtr::GetLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ EventPtr::GetLevel方法的具体用法?C++ EventPtr::GetLevel怎么用?C++ EventPtr::GetLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventPtr
的用法示例。
在下文中一共展示了EventPtr::GetLevel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddWithNotification
void CEventLog::AddWithNotification(const EventPtr& eventPtr,
unsigned int displayTime /* = NOTIFICATION_DISPLAY_TIME */,
unsigned int messageTime /* = NOTIFICATION_MESSAGE_TIME */,
bool withSound /* = true */)
{
if (eventPtr == nullptr)
return;
Add(eventPtr);
// queue the eventPtr as a kai toast notification
if (!eventPtr->GetIcon().empty())
CGUIDialogKaiToast::QueueNotification(eventPtr->GetIcon(), eventPtr->GetLabel(), eventPtr->GetDescription(), displayTime, withSound, messageTime);
else
{
CGUIDialogKaiToast::eMessageType type = CGUIDialogKaiToast::Info;
if (eventPtr->GetLevel() == EventLevel::Warning)
type = CGUIDialogKaiToast::Warning;
else if (eventPtr->GetLevel() == EventLevel::Error)
type = CGUIDialogKaiToast::Error;
CGUIDialogKaiToast::QueueNotification(type, eventPtr->GetLabel(), eventPtr->GetDescription(), displayTime, withSound, messageTime);
}
}
示例2: EventToFileItem
CFileItemPtr CEventsDirectory::EventToFileItem(const EventPtr& eventItem)
{
if (eventItem == NULL)
return CFileItemPtr();
CFileItemPtr item(new CFileItem(eventItem->GetLabel()));
item->m_dateTime = eventItem->GetDateTime();
if (!eventItem->GetIcon().empty())
item->SetIconImage(eventItem->GetIcon());
item->SetProperty(PROPERTY_EVENT_IDENTIFIER, eventItem->GetIdentifier());
item->SetProperty(PROPERTY_EVENT_LEVEL, EventLevelToString(eventItem->GetLevel()));
item->SetProperty(PROPERTY_EVENT_DESCRIPTION, eventItem->GetDescription());
return item;
}
示例3: Add
void CEventLog::Add(const EventPtr& eventPtr)
{
if (eventPtr == nullptr || eventPtr->GetIdentifier().empty() ||
!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_EVENTLOG_ENABLED) ||
(eventPtr->GetLevel() == EventLevel::Information && !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_EVENTLOG_ENABLED_NOTIFICATIONS)))
return;
CSingleLock lock(m_critical);
if (m_eventsMap.find(eventPtr->GetIdentifier()) != m_eventsMap.end())
return;
// store the event
m_events.push_back(eventPtr);
m_eventsMap.insert(std::make_pair(eventPtr->GetIdentifier(), eventPtr));
SendMessage(eventPtr, GUI_MSG_EVENT_ADDED);
}