Changeset View
Changeset View
Standalone View
Standalone View
libchoqok/notifymanager.cpp
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | |||||
87 | 87 | | |||
88 | void NotifyManager::newPostArrived(const QString &message, const QString &title) | 88 | void NotifyManager::newPostArrived(const QString &message, const QString &title) | ||
89 | { | 89 | { | ||
90 | QString fullMsg = QStringLiteral("<b>%1:</b><br/>%2").arg(title).arg(message); | 90 | QString fullMsg = QStringLiteral("<b>%1:</b><br/>%2").arg(title).arg(message); | ||
91 | if (Choqok::UI::Global::mainWindow()->isActiveWindow()) { | 91 | if (Choqok::UI::Global::mainWindow()->isActiveWindow()) { | ||
92 | choqokMainWindow->showStatusMessage(message); | 92 | choqokMainWindow->showStatusMessage(message); | ||
93 | } else { | 93 | } else { | ||
94 | if (Choqok::BehaviorSettings::knotify()) { | 94 | if (Choqok::BehaviorSettings::knotify()) { | ||
95 | KNotification *n = new KNotification(QLatin1String("new-post-arrived"), choqokMainWindow); | 95 | KNotification *n = new KNotification(QLatin1String("new-post-arrived")); | ||
96 | n->setActions(QStringList(i18nc("Show Choqok MainWindow", "Show Choqok"))); | 96 | n->setActions(QStringList(i18nc("Show Choqok MainWindow", "Show Choqok"))); | ||
97 | n->setText(fullMsg); | 97 | n->setText(fullMsg); | ||
98 | QObject::connect(n, (void (KNotification::*)())&KNotification::activated, | 98 | QObject::connect(n, (void (KNotification::*)())&KNotification::activated, | ||
99 | choqokMainWindow, &Choqok::UI::MainWindow::activateChoqok); | 99 | choqokMainWindow, &Choqok::UI::MainWindow::activateChoqok); | ||
100 | n->sendEvent(); | 100 | n->sendEvent(); | ||
101 | } | 101 | } | ||
102 | } | 102 | } | ||
103 | } | 103 | } | ||
Show All 14 Lines |