X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.cpp;h=ab47a30ef611fb640ce99623f93e68cb9b251750;hp=abeeb4884534f098aeee521e281bb2534d9b4f45;hb=65d88a7f8c37e549a259aba85c52b7916b89a17d;hpb=85c2a2a853e4f4d4488344672d47c2aa77172f69 diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index abeeb488..ab47a30e 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -609,11 +609,13 @@ void MainWin::receiveMessage(const Message &msg) { UiSettings uiSettings; #ifndef SPUTDEV - if(uiSettings.value("DisplayPopupMessages", QVariant(true)).toBool()) { + bool displayBubble = uiSettings.value("NotificationBubble", QVariant(true)).toBool(); + bool displayDesktop = uiSettings.value("NotificationDesktop", QVariant(true)).toBool(); + if(displayBubble || displayDesktop) { // FIXME don't invoke style engine for this! QString text = QtUi::style()->styleString(Message::mircToInternal(msg.contents())).plainText; - displayTrayIconMessage(title, text); - sendDesktopNotification(title, text); + if (displayBubble) displayTrayIconMessage(title, text); + if (displayDesktop) sendDesktopNotification(title, text); } #endif if(uiSettings.value("AnimateTrayIcon", QVariant(true)).toBool()) { @@ -638,9 +640,10 @@ void MainWin::sendDesktopNotification(const QString &title, const QString &messa { QStringList actions; QMap hints; + UiSettings uiSettings; - hints["x"] = 100; // Standard hint: x location for the popup to show up - hints["y"] = 100; // Standard hint: y location for the popup to show up + hints["x"] = uiSettings.value("NotificationDesktopHintX", QVariant(0)).toInt(); // Standard hint: x location for the popup to show up + hints["y"] = uiSettings.value("NotificationDesktopHintY", QVariant(0)).toInt(); // Standard hint: y location for the popup to show up actions << "click" << "Click Me!"; @@ -652,7 +655,7 @@ void MainWin::sendDesktopNotification(const QString &title, const QString &messa QString("%1: %2:\n%2").arg(QTime::currentTime().toString()).arg(title).arg(message), // Body of the message to display actions, // Actions from which the user may choose hints, // Hints to the server displaying the message - 5000 // Timeout in milliseconds + uiSettings.value("NotificationDesktopTimeout", QVariant(5000)).toInt() // Timeout in milliseconds ); if (!reply.isValid())