| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/gui/notifications/notificationseditor.cpp`/ |
| 2 | |
| 3 | #include "gui/notifications/notificationseditor.h"cxx . . $ `<file>/src/librssguard/gui/notifications/notificationseditor.h`/ |
| 4 | |
| 5 | #include "3rd-party/boolinq/boolinq.h"cxx . . $ `<file>/src/librssguard/3rd-party/boolinq/boolinq.h`/ |
| 6 | #include "definitions/definitions.h"cxx . . $ `<file>/src/librssguard/definitions/definitions.h`/ |
| 7 | #include "gui/notifications/singlenotificationeditor.h"cxx . . $ `<file>/src/librssguard/gui/notifications/singlenotificationeditor.h`/ |
| 8 | |
| 9 | #include <QVBoxLayout> |
| 10 | |
| 11 | NotificationsEditorcxx . . $ NotificationsEditor#::NotificationsEditorcxx . . $ NotificationsEditor#NotificationsEditor(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget#* parent) : QWidgetcxx . . $ QWidget#QWidget(872e7b0c281abd8d).(parent), m_layoutcxx . . $ NotificationsEditor#m_layout.(new QVBoxLayoutcxx . . $ QVBoxLayout#QVBoxLayout(108f35f7aa7f3cf9).(this)) { |
| 12 | m_uicxx . . $ NotificationsEditor#m_ui..setupUicxx . . $ Ui_NotificationsEditor#setupUi(108f35f7aa7f3cf9).(this); |
| 13 | setLayoutcxx . . $ QWidget#setLayout(23396b1058755fec).(m_layoutcxx . . $ NotificationsEditor#m_layout.); |
| 14 | } |
| 15 | |
| 16 | void NotificationsEditorcxx . . $ NotificationsEditor#::loadNotificationscxx . . $ NotificationsEditor#loadNotifications(68104e5ac0d198d).(const QListcxx . . $ QList#<Notificationcxx . . $ Notification#>& notifications) { |
| 17 | auto all_events = Notificationcxx . . $ Notification#::allEventscxx . . $ Notification#allEvents(7ddaa241c28a488e).(); |
| 18 | auto notif = boolinqcxx . . $ boolinq/::fromcxx . . $ boolinq/from(1a44d082b2747720).(notifications); |
| 19 | |
| 20 | for (auto ev : all_events) { |
| 21 | if (notif.anycxx . . $ boolinq/Linq#any(992a0234366b9b4f).([cxx . . $ std/function#function(bdc3712e480e4d04).ev](auto n) { |
| 22 | return n.event() == ev; |
| 23 | })) { |
| 24 | auto* notif_editor = new SingleNotificationEditorcxx . . $ SingleNotificationEditor#(notif.firstcxx . . $ boolinq/Linq#first(b3b4635b5093b302).([cxx . . $ std/function#function(bdc3712e480e4d04).ev](auto n) { |
| 25 | return n.event() == ev; |
| 26 | }), |
| 27 | this); |
| 28 | |
| 29 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(notif_editor, |
| 30 | &SingleNotificationEditorcxx . . $ SingleNotificationEditor#::notificationChangedcxx . . $ SingleNotificationEditor#notificationChanged(49f6e7a06ebc5aa8)., |
| 31 | this, |
| 32 | &NotificationsEditorcxx . . $ NotificationsEditor#::someNotificationChangedcxx . . $ NotificationsEditor#someNotificationChanged(49f6e7a06ebc5aa8).); |
| 33 | |
| 34 | m_layoutcxx . . $ NotificationsEditor#m_layout.->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(notif_editor); |
| 35 | } |
| 36 | else { |
| 37 | auto* notif_editor = new SingleNotificationEditorcxx . . $ SingleNotificationEditor#(Notificationcxx . . $ Notification#(ev), this); |
| 38 | |
| 39 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(notif_editor, |
| 40 | &SingleNotificationEditorcxx . . $ SingleNotificationEditor#::notificationChangedcxx . . $ SingleNotificationEditor#notificationChanged(49f6e7a06ebc5aa8)., |
| 41 | this, |
| 42 | &NotificationsEditorcxx . . $ NotificationsEditor#::someNotificationChangedcxx . . $ NotificationsEditor#someNotificationChanged(49f6e7a06ebc5aa8).); |
| 43 | |
| 44 | m_layoutcxx . . $ NotificationsEditor#m_layout.->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(notif_editor); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | m_layoutcxx . . $ NotificationsEditor#m_layout.->addSpacerItemcxx . . $ QBoxLayout#addSpacerItem(a5ccb5246ece79a7).(new QSpacerItemcxx . . $ QSpacerItem#QSpacerItem(bce5685a9a3bd999).(20, 40, QSizePolicycxx . . $ QSizePolicy#::Policycxx . . $ QSizePolicy#Policy#::Minimumcxx . . $ QSizePolicy#Minimum., QSizePolicycxx . . $ QSizePolicy#::Policycxx . . $ QSizePolicy#Policy#::Expandingcxx . . $ QSizePolicy#Expanding.)); |
| 49 | } |
| 50 | |
| 51 | QListcxx . . $ QList#<Notificationcxx . . $ Notification#> NotificationsEditorcxx . . $ NotificationsEditor#::allNotificationscxx . . $ NotificationsEditor#allNotifications(497a155dc12c5218).() const { |
| 52 | auto lst = boolinqcxx . . $ boolinq/::fromcxx . . $ boolinq/from(1a44d082b2747720).(findChildrencxx . . $ QObject#findChildren(7208eee5b53db771).<SingleNotificationEditorcxx . . $ SingleNotificationEditor#*>()) |
| 53 | .selectcxx . . $ boolinq/Linq#select(a3f5bd4cd382e0ee).([](const SingleNotificationEditorcxx . . $ SingleNotificationEditor#* ed) { |
| 54 | return ed->notificationcxx . . $ SingleNotificationEditor#notification(1421dd5d50d2fb71).(); |
| 55 | }) |
| 56 | .toStdListcxx . . $ boolinq/Linq#toStdList(2989115be80c3067).(); |
| 57 | |
| 58 | return FROM_STD_LISTcxx . . $ `src/librssguard/definitions/definitions.h:405:9`!(QList<Notification>, lst); |
| 59 | } |