Bitcoin Core  27.99.0
P2P Digital Currency
Public Types | Public Slots | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Notificator Class Reference

Cross-platform desktop notification client. More...

#include <notificator.h>

Inheritance diagram for Notificator:
Collaboration diagram for Notificator:

Public Types

enum  Class { Information , Warning , Critical }

Public Slots

void notify (Class cls, const QString &title, const QString &text, const QIcon &icon=QIcon(), int millisTimeout=10000)
 Show notification message. More...

Public Member Functions

 Notificator (const QString &programName, QSystemTrayIcon *trayIcon, QWidget *parent)
 Create a new notificator. More...
 ~Notificator ()

Private Types

enum  Mode { None , Freedesktop , QSystemTray , UserNotificationCenter }

Private Member Functions

void notifySystray (Class cls, const QString &title, const QString &text, int millisTimeout)

Private Attributes

QWidget * parent
QString programName
Mode mode {None}
QSystemTrayIcon * trayIcon

Detailed Description

Cross-platform desktop notification client.

Definition at line 22 of file notificator.h.

Member Enumeration Documentation

◆ Class


Informational message.


Notify user of potential problem.


An error occurred.

Definition at line 34 of file notificator.h.

◆ Mode

enum Notificator::Mode

Ignore informational notifications, and show a modal pop-up dialog for Critical notifications.


Use DBus org.freedesktop.Notifications.


Use QSystemTrayIcon::showMessage()


Use the 10.8+ User Notification Center (Mac only)

Definition at line 55 of file notificator.h.

Constructor & Destructor Documentation

◆ Notificator()

Notificator::Notificator ( const QString &  programName,
QSystemTrayIcon *  trayIcon,
QWidget *  parent 

Create a new notificator.

Ownership of trayIcon is not transferred to this object.

Definition at line 33 of file notificator.cpp.

Here is the call graph for this function:

◆ ~Notificator()

Notificator::~Notificator ( )

Definition at line 59 of file notificator.cpp.

Member Function Documentation

◆ notify

void Notificator::notify ( Class  cls,
const QString &  title,
const QString &  text,
const QIcon &  icon = QIcon(),
int  millisTimeout = 10000 

Show notification message.

[in]clsgeneral message class
[in]titletitle shown with message
[in]textmessage content
[in]iconoptional icon to show with message
[in]millisTimeoutnotification timeout in milliseconds (defaults to 10 seconds)
Platform implementations are free to ignore any of the provided fields except for text.

Definition at line 219 of file notificator.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ notifySystray()

void Notificator::notifySystray ( Class  cls,
const QString &  title,
const QString &  text,
int  millisTimeout 

Definition at line 199 of file notificator.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ mode

Mode Notificator::mode {None}

Definition at line 62 of file notificator.h.

◆ parent

QWidget* Notificator::parent

Definition at line 54 of file notificator.h.

◆ programName

QString Notificator::programName

Definition at line 61 of file notificator.h.

◆ trayIcon

QSystemTrayIcon* Notificator::trayIcon

Definition at line 63 of file notificator.h.

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