bool ComThread::checkNotify(struct anoubis_msg *notifyMsg) { int type; pid_t pid; NotifyAnswer *answer; if (notifyMsg->u.general == NULL) return false; type = get_value((notifyMsg->u.general)->type); if (type == ANOUBIS_N_ASK) { pid = get_value((notifyMsg->u.notify)->pid); if (ProcCtrl::instance()->findPid(pid)) { EscalationNotify *notify; notify = new EscalationNotify(notifyMsg); answer = new NotifyAnswer(NOTIFY_ANSWER_ONCE, true); notify->setAnswer(answer); notify->setNeedFree(); pushNotification(notify); return true; } } return false; }
void BlockDataViewer::flagRefresh(BDV_refresh refresh, const BinaryData& refreshID) { auto notif = make_unique<BDV_Notification_Refresh>(refresh, refreshID); pushNotification(move(notif)); }
void Plugin::Handle (LeechCraft::Entity e) { Priority prio = static_cast<Priority> (e.Additional_ ["Priority"].toInt ()); if (prio == PLog_) return; QString header = e.Entity_.toString (); QString text = e.Additional_ ["Text"].toString (); int timeout = Proxy_->GetSettingsManager ()-> property ("FinishedDownloadMessageTimeout").toInt () * 1000; KinotifyWidget *notificationWidget = new KinotifyWidget (timeout, Proxy_->GetMainWindow ()); connect (notificationWidget, SIGNAL (checkNotificationQueue ()), this, SLOT (pushNotification ())); QString mi = "information"; switch (prio) { case PWarning_: mi = "warning"; break; case PCritical_: mi = "error"; default: break; } QString path; QMap<int, QString> sizes = Proxy_->GetIconPath (mi); if (sizes.size ()) { int size = 0; if (!sizes.contains (size)) size = sizes.keys ().last (); path = sizes [size]; } notificationWidget->SetContent (header, text, path); if (!ActiveNotifications_.size ()) notificationWidget->PrepareNotification (); ActiveNotifications_ << notificationWidget; }
void BadgeNotifications::handleMessage(const IncomingRadioMessage& aIncomingRadioMessage) { // parse the radio message content into mBadgeNotification // <3 bytes rgb1> <3 bytes rgb2> <1 byte sound> <text> mReader.setBuffer((unsigned char*)aIncomingRadioMessage.content(), aIncomingRadioMessage.length()); RGBColor rgb1 = getRGBColor(mReader); RGBColor rgb2 = getRGBColor(mReader); boolean sound = Utils::getBoolean(mReader); uint8_t type = static_cast<uint8_t>(Utils::getInteger(mReader)); char* textChars = Utils::getString(mReader); String text(textChars); delete[] textChars; debug::log("BADGER NOTIFICATION"); debug::log(text); pushNotification(text, rgb1, rgb2, sound, type); }
void MainWindow::initConnects() { // Notification Stacker connect(this->ui->tokenPage, SIGNAL(sendNotification(QString)), &m_NotificationStacker, SLOT(pushNotification(QString))); }