5#include <bitcoin-build-config.h>
11#include <QImageWriter>
15#include <QSystemTrayIcon>
16#include <QTemporaryFile>
19#include <QDBusMetaType>
45 "/org/freedesktop/Notifications",
"org.freedesktop.Notifications");
96FreedesktopImage::FreedesktopImage(
const QImage &
img):
105 QImage tmp =
img.convertToFormat(QImage::Format_ARGB32);
111 for(
unsigned int ptr = 0; ptr <
num_pixels; ++ptr)
123 a << i.width << i.height << i.stride << i.hasAlpha << i.bitsPerSample << i.channels << i.image;
131 a >> i.width >> i.height >> i.stride >> i.hasAlpha >> i.bitsPerSample >> i.channels >> i.image;
164 args.append(actions);
173 QStyle::StandardPixmap
sicon = QStyle::SP_MessageBoxQuestion;
177 case Warning:
sicon = QStyle::SP_MessageBoxWarning;
break;
194 interface->callWithArgumentList(QDBus::NoBlock,
"Notify",
args);
200 QSystemTrayIcon::MessageIcon
sicon = QSystemTrayIcon::NoIcon;
211void Notificator::notifyMacUserNotificationCenter(
const QString &title,
const QString &text)
239 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 OutputStream & operator<<(OutputStream &os, const Array &array)
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.