mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Add configuration option to send desktop notification on buddy presence (#3886)
This commit is contained in:
parent
63b4f9b2f0
commit
91dc8b3b08
8 changed files with 83 additions and 15 deletions
|
|
@ -158,11 +158,16 @@ void TabRoom::focusTab()
|
|||
}
|
||||
|
||||
void TabRoom::actShowMentionPopup(QString &sender)
|
||||
{
|
||||
this->actShowPopup(sender + tr(" mentioned you."));
|
||||
}
|
||||
|
||||
void TabRoom::actShowPopup(const QString &message)
|
||||
{
|
||||
if (trayIcon && (tabSupervisor->currentIndex() != tabSupervisor->indexOf(this) ||
|
||||
QApplication::activeWindow() == 0 || QApplication::focusWidget() == 0)) {
|
||||
disconnect(trayIcon, SIGNAL(messageClicked()), 0, 0);
|
||||
trayIcon->showMessage(sender + tr(" mentioned you."), tr("Click to view"));
|
||||
QApplication::activeWindow() == nullptr || QApplication::focusWidget() == nullptr)) {
|
||||
disconnect(trayIcon, SIGNAL(messageClicked()), nullptr, nullptr);
|
||||
trayIcon->showMessage(message, tr("Click to view"));
|
||||
connect(trayIcon, SIGNAL(messageClicked()), chatView, SLOT(actMessageClicked()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue