| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/gui/notifications/toastnotification.cpp`/ |
| 2 | |
| 3 | #include "gui/notifications/toastnotification.h"cxx . . $ `<file>/src/librssguard/gui/notifications/toastnotification.h`/ |
| 4 | |
| 5 | #include "miscellaneous/iconfactory.h"cxx . . $ `<file>/src/librssguard/miscellaneous/iconfactory.h`/ |
| 6 | |
| 7 | #ifdef Q_OS_MAC |
| 8 | #include <Carbon/Carbon.h> |
| 9 | #endif |
| 10 | |
| 11 | ToastNotificationcxx . . $ ToastNotification#::ToastNotificationcxx . . $ ToastNotification#ToastNotification(4f7b9e7a38e48cf0).(Notificationcxx . . $ Notification#::Eventcxx . . $ Notification#Event# event, |
| 12 | const GuiMessagecxx . . $ GuiMessage#& msg, |
| 13 | const GuiActioncxx . . $ GuiAction#& action, |
| 14 | QWidgetcxx . . $ QWidget#* parent) |
| 15 | : BaseToastNotificationcxx . . $ BaseToastNotification#(parent) { |
| 16 | m_uicxx . . $ ToastNotification#m_ui..setupUicxx . . $ Ui_ToastNotification#setupUi(d194de0c0f68c28b).(this); |
| 17 | |
| 18 | setupHeadingcxx . . $ BaseToastNotification#setupHeading(d3201a35e6c48b56).(m_uicxx . . $ ToastNotification#m_ui..m_lblTitlecxx . . $ Ui_ToastNotification#m_lblTitle.); |
| 19 | setupCloseButtoncxx . . $ BaseToastNotification#setupCloseButton(6f406f547f7da55f).(m_uicxx . . $ ToastNotification#m_ui..m_btnClosecxx . . $ Ui_ToastNotification#m_btnClose.); |
| 20 | setupTimedClosingcxx . . $ BaseToastNotification#setupTimedClosing(b45ddcbc8423892c).(false); |
| 21 | |
| 22 | loadNotificationcxx . . $ ToastNotification#loadNotification(db35c252f9762c99).(event, msg, action); |
| 23 | } |
| 24 | |
| 25 | void ToastNotificationcxx . . $ ToastNotification#::loadNotificationcxx . . $ ToastNotification#loadNotification(db35c252f9762c99).(Notificationcxx . . $ Notification#::Eventcxx . . $ Notification#Event# event, const GuiMessagecxx . . $ GuiMessage#& msg, const GuiActioncxx . . $ GuiAction#& action) { |
| 26 | m_uicxx . . $ ToastNotification#m_ui..m_lblTitlecxx . . $ Ui_ToastNotification#m_lblTitle.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(msg.m_titlecxx . . $ GuiMessage#m_title.); |
| 27 | m_uicxx . . $ ToastNotification#m_ui..m_lblTitlecxx . . $ Ui_ToastNotification#m_lblTitle.->setToolTipcxx . . $ QWidget#setToolTip(3520e46b33348bf6).(msg.m_titlecxx . . $ GuiMessage#m_title.); |
| 28 | m_uicxx . . $ ToastNotification#m_ui..m_lblBodycxx . . $ Ui_ToastNotification#m_lblBody.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(msg.m_messagecxx . . $ GuiMessage#m_message.); |
| 29 | m_uicxx . . $ ToastNotification#m_ui..m_lblBodycxx . . $ Ui_ToastNotification#m_lblBody.->setToolTipcxx . . $ QWidget#setToolTip(3520e46b33348bf6).(msg.m_messagecxx . . $ GuiMessage#m_message.); |
| 30 | |
| 31 | m_uicxx . . $ ToastNotification#m_ui..m_lblIconcxx . . $ Ui_ToastNotification#m_lblIcon.->setPixmapcxx . . $ QLabel#setPixmap(8887f7d25b86c3f4).(iconForTypecxx . . $ ToastNotification#iconForType(3e8cffed53e64317).(msg.m_typecxx . . $ GuiMessage#m_type.) |
| 32 | .pixmapcxx . . $ QIcon#pixmap(bdedaf553c804fc0).({cxx . . $ QSize#QSize(c0d38f4800714fae). |
| 33 | 32, |
| 34 | 32, |
| 35 | })); |
| 36 | |
| 37 | if (action.m_actioncxx . . $ GuiAction#m_action.) { |
| 38 | m_uicxx . . $ ToastNotification#m_ui..m_btnActioncxx . . $ Ui_ToastNotification#m_btnAction.->setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).(action.m_titlecxx . . $ GuiAction#m_title..isEmptycxx . . $ QString#isEmpty(3482b152b9333168).() ? trcxx . . $ ToastNotification#tr(75d9f1c324b4579d).("Do it!") : actioncxx . . $ QString#QString(132dd6869045752b)..m_titlecxx . . $ GuiAction#m_title.); |
| 39 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ ToastNotification#m_ui..m_btnActioncxx . . $ Ui_ToastNotification#m_btnAction., &QPushButtoncxx . . $ QPushButton#::clickedcxx . . $ QAbstractButton#clicked(b45ddcbc8423892c)., this, [this, action]() { |
| 40 | action.m_actioncxx . . $ GuiAction#m_action.(cxx . . $ std/function#`operator()`(39e0826ffb540481).); |
| 41 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! closeRequestedcxx . . $ BaseToastNotification#closeRequested(8310c1ebbd6d7163).(this); |
| 42 | }); |
| 43 | } |
| 44 | else { |
| 45 | m_uicxx . . $ ToastNotification#m_ui..m_mainLayoutcxx . . $ Ui_ToastNotification#m_mainLayout.->removeItemcxx . . $ QLayout#removeItem(6d8c77b6908f2a).(m_uicxx . . $ ToastNotification#m_ui..m_actionLayoutcxx . . $ Ui_ToastNotification#m_actionLayout.); |
| 46 | m_uicxx . . $ ToastNotification#m_ui..m_mainLayoutcxx . . $ Ui_ToastNotification#m_mainLayout.->updatecxx . . $ QLayout#update(49f6e7a06ebc5aa8).(); |
| 47 | m_uicxx . . $ ToastNotification#m_ui..m_btnActioncxx . . $ Ui_ToastNotification#m_btnAction.->deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | QIconcxx . . $ QIcon# ToastNotificationcxx . . $ ToastNotification#::iconForTypecxx . . $ ToastNotification#iconForType(3e8cffed53e64317).(QSystemTrayIconcxx . . $ QSystemTrayIcon#::MessageIconcxx . . $ QSystemTrayIcon#MessageIcon# icon) const { |
| 52 | switch (icon) { |
| 53 | case QSystemTrayIconcxx . . $ QSystemTrayIcon#::Warningcxx . . $ QSystemTrayIcon#Warning.: |
| 54 | return qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("dialog-warning")); |
| 55 | |
| 56 | case QSystemTrayIconcxx . . $ QSystemTrayIcon#::Criticalcxx . . $ QSystemTrayIcon#Critical.: |
| 57 | return qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("dialog-error")); |
| 58 | |
| 59 | case QSystemTrayIconcxx . . $ QSystemTrayIcon#::Informationcxx . . $ QSystemTrayIcon#Information.: |
| 60 | case QSystemTrayIconcxx . . $ QSystemTrayIcon#::NoIconcxx . . $ QSystemTrayIcon#NoIcon.: |
| 61 | default: |
| 62 | return qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("dialog-information")); |
| 63 | } |
| 64 | } |