AccountNotificationService::AccountNotificationService(QObject *parent) : QObject{parent}, m_ignoreErrorsCallback{QStringLiteral("connection-ignore-errors"), tr("Ignore"), [this](const Notification ¬ification){ return ignoreErrors(notification); }}, m_connectionErrorEvent{QStringLiteral("ConnectionError"), QStringLiteral(QT_TRANSLATE_NOOP("@default", "Connection error"))} { }
void ConnectionErrorNotification::registerEvent() { Core::instance()->notificationEventRepository()->addNotificationEvent(NotificationEvent("ConnectionError", QT_TRANSLATE_NOOP("@default", "Connection error"))); Parser::registerObjectTag("error", getErrorMessage); Parser::registerObjectTag("errorServer", getErrorServer); auto connectionIgnoreErrorsDisconnect = NotificationCallback{ "connection-ignore-errors", tr("Ignore"), [](Notification *notification){ auto connectionErrorNotification = qobject_cast<ConnectionErrorNotification *>(notification); if (connectionErrorNotification) connectionErrorNotification->ignoreErrors(); } }; Core::instance()->notificationCallbackRepository()->addCallback(connectionIgnoreErrorsDisconnect); }