Mantid
|
This is a singleton providing a notification service for the Mantid Qt based applications. More...
#include <NotificationService.h>
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 |
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.
using MantidQt::MantidWidgets::NotificationService::MessageIcon = QSystemTrayIcon::MessageIcon |
Definition at line 35 of file NotificationService.h.
|
inline |
Default constructor.
Definition at line 38 of file NotificationService.h.
|
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().
|
static |
Are notifications supported by this OS?
Definition at line 74 of file NotificationService.cpp.
Referenced by showMessage().
|
static |
Display a notification.
Definition at line 25 of file NotificationService.cpp.
References Mantid::Kernel::Timer::elapsed_no_reset(), g_lastMessage, g_lastTitle, g_timer, isEnabled(), isSupportedByOS(), MIN_SECONDS_BETWEEN_IDENTICAL_NOTIFICATIONS, and Mantid::Kernel::Timer::reset().
Referenced by MantidQt::MantidWidgets::MessageDisplay::append().
|
staticprivate |
Definition at line 54 of file NotificationService.h.
Referenced by showMessage().
|
staticprivate |
Definition at line 55 of file NotificationService.h.
Referenced by showMessage().
|
staticprivate |
Definition at line 56 of file NotificationService.h.
Referenced by showMessage().
|
static |
Definition at line 48 of file NotificationService.h.
Referenced by showMessage().
|
static |
Definition at line 47 of file NotificationService.h.
Referenced by isEnabled().