5#include <bitcoin-build-config.h>
11#include <QApplication>
13#include <QImageWriter>
17#include <QSystemTrayIcon>
18#include <QTemporaryFile>
21#include <QDBusMetaType>
47 "/org/freedesktop/Notifications",
"org.freedesktop.Notifications");
98FreedesktopImage::FreedesktopImage(
const QImage &
img):
100 height(
img.height()),
107 QImage tmp =
img.convertToFormat(QImage::Format_ARGB32);
113 for(
unsigned int ptr = 0; ptr <
num_pixels; ++ptr)
125 a << i.width << i.height << i.stride << i.hasAlpha << i.bitsPerSample << i.channels << i.image;
133 a >> i.width >> i.height >> i.stride >> i.hasAlpha >> i.bitsPerSample >> i.channels >> i.image;
166 args.append(actions);
175 QStyle::StandardPixmap
sicon = QStyle::SP_MessageBoxQuestion;
179 case Warning:
sicon = QStyle::SP_MessageBoxWarning;
break;
195 interface->callWithArgumentList(QDBus::NoBlock,
"Notify",
args);
201 QSystemTrayIcon::MessageIcon
sicon = QSystemTrayIcon::NoIcon;
212void Notificator::notifyMacUserNotificationCenter(
const QString &title,
const QString &text)
240 QMessageBox::critical(
parent, title, text, QMessageBox::Ok, QMessageBox::Ok);
QDataStream & operator>>(QDataStream &in, BitcoinUnit &unit)
static MacNotificationHandler * instance()
void showNotification(const QString &title, const QString &text)
shows a macOS 10.8+ UserNotification in the UserNotificationCenter
@ Information
Informational message.
@ Critical
An error occurred.
@ Warning
Notify user of potential problem.
@ UserNotificationCenter
Use the 10.8+ User Notification Center (Mac only)
@ QSystemTray
Use QSystemTrayIcon::showMessage()
@ Freedesktop
Use DBus org.freedesktop.Notifications.
void notifySystray(Class cls, const QString &title, const QString &text, int millisTimeout)
Notificator(const QString &programName, QSystemTrayIcon *trayIcon, QWidget *parent)
Create a new notificator.
QSystemTrayIcon * trayIcon
void notify(Class cls, const QString &title, const QString &text, const QIcon &icon=QIcon(), int millisTimeout=10000)
Show notification message.
static const PrecomputedData data
Precomputed COutPoint and CCoins values.
static OutputStream & operator<<(OutputStream &os, const Array &array)
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.