Mantid
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Private Attributes | List of all members
MantidQt::MantidWidgets::NotificationService Class Reference

This is a singleton providing a notification service for the Mantid Qt based applications. More...

#include <NotificationService.h>

Inheritance diagram for MantidQt::MantidWidgets::NotificationService:

Public Types

using MessageIcon = QSystemTrayIcon::MessageIcon
 

Public Member Functions

 NotificationService ()
 Default constructor. More...
 

Static Public Member Functions

static bool isEnabled ()
 Is the notification service enabled through the config service? More...
 
static bool isSupportedByOS ()
 Are notifications supported by this OS? More...
 
static void showMessage (const QString &title, const QString &message, MessageIcon icon=MessageIcon::Information, int millisecondsTimeoutHint=5000)
 Display a notification. More...
 

Static Public Attributes

static const float MIN_SECONDS_BETWEEN_IDENTICAL_NOTIFICATIONS = 5.0
 
static const std::string NOTIFICATIONS_ENABLED_KEY = "Notifications.Enabled"
 

Static Private Attributes

static QString g_lastMessage = ""
 
static QString g_lastTitle = ""
 
static Mantid::Kernel::Timer g_timer
 

Detailed Description

This is a singleton providing a notification service for the Mantid Qt based applications.

This is just a thin simplistic wrapper around QSystemTray

Definition at line 30 of file NotificationService.h.

Member Typedef Documentation

◆ MessageIcon

using MantidQt::MantidWidgets::NotificationService::MessageIcon = QSystemTrayIcon::MessageIcon

Definition at line 35 of file NotificationService.h.

Constructor & Destructor Documentation

◆ NotificationService()

MantidQt::MantidWidgets::NotificationService::NotificationService ( )
inline

Default constructor.

Definition at line 38 of file NotificationService.h.

Member Function Documentation

◆ isEnabled()

bool MantidQt::MantidWidgets::NotificationService::isEnabled ( )
static

Is the notification service enabled through the config service?

Definition at line 58 of file NotificationService.cpp.

References Mantid::Kernel::SingletonHolder< T >::Instance(), and NOTIFICATIONS_ENABLED_KEY.

Referenced by showMessage().

◆ isSupportedByOS()

bool MantidQt::MantidWidgets::NotificationService::isSupportedByOS ( )
static

Are notifications supported by this OS?

Definition at line 74 of file NotificationService.cpp.

Referenced by showMessage().

◆ showMessage()

void MantidQt::MantidWidgets::NotificationService::showMessage ( const QString &  title,
const QString &  message,
MessageIcon  icon = MessageIcon::Information,
int  millisecondsTimeoutHint = 5000 
)
static

Member Data Documentation

◆ g_lastMessage

QString MantidQt::MantidWidgets::NotificationService::g_lastMessage = ""
staticprivate

Definition at line 54 of file NotificationService.h.

Referenced by showMessage().

◆ g_lastTitle

QString MantidQt::MantidWidgets::NotificationService::g_lastTitle = ""
staticprivate

Definition at line 55 of file NotificationService.h.

Referenced by showMessage().

◆ g_timer

Mantid::Kernel::Timer MantidQt::MantidWidgets::NotificationService::g_timer
staticprivate

Definition at line 56 of file NotificationService.h.

Referenced by showMessage().

◆ MIN_SECONDS_BETWEEN_IDENTICAL_NOTIFICATIONS

const float MantidQt::MantidWidgets::NotificationService::MIN_SECONDS_BETWEEN_IDENTICAL_NOTIFICATIONS = 5.0
static

Definition at line 48 of file NotificationService.h.

Referenced by showMessage().

◆ NOTIFICATIONS_ENABLED_KEY

const std::string MantidQt::MantidWidgets::NotificationService::NOTIFICATIONS_ENABLED_KEY = "Notifications.Enabled"
static

Definition at line 47 of file NotificationService.h.

Referenced by isEnabled().


The documentation for this class was generated from the following files: