From 38606bdb87028bd81e56eb88719d172652deac95 Mon Sep 17 00:00:00 2001 From: Derek Chiang Date: Sun, 29 Nov 2020 18:11:35 -0800 Subject: [PATCH] Display a system tray notification when a player joins your game (#4194) * Display a system tray notification when a player joins your game * Display game ID in join message --- cockatrice/src/tab_game.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cockatrice/src/tab_game.cpp b/cockatrice/src/tab_game.cpp index c9660240..cbcc3ac1 100644 --- a/cockatrice/src/tab_game.cpp +++ b/cockatrice/src/tab_game.cpp @@ -53,6 +53,7 @@ #include "replay_timeline_widget.h" #include "settingscache.h" #include "tab_supervisor.h" +#include "window_main.h" #include "zoneviewwidget.h" #include "zoneviewzone.h" @@ -1192,6 +1193,11 @@ void TabGame::eventJoin(const Event_Join &event, int /*eventPlayerId*/, const Ga } else { Player *newPlayer = addPlayer(playerId, playerInfo.user_info()); messageLog->logJoin(newPlayer); + if (trayIcon) { + QString gameId(QString::number(gameInfo.game_id())); + trayIcon->showMessage(tr("A player has joined game #%1").arg(gameId), + tr("%1 has joined the game").arg(newPlayer->getName())); + } } playerListWidget->addPlayer(playerInfo); emitUserEvent();