Skip to content

Commit

Permalink
Add notification for client connection/disconnection
Browse files Browse the repository at this point in the history
  • Loading branch information
jyavenard committed Jul 1, 2013
1 parent 626cde5 commit 41a721b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mythtv/libs/libmythtv/AirPlay/mythairplayserver.cpp
Expand Up @@ -18,6 +18,7 @@
#include "mythuistatetracker.h"
#include "plist.h"
#include "tv_play.h"
#include "mythuinotificationcenter.h"

#include "bonjourregister.h"
#include "mythairplayserver.h"
Expand Down Expand Up @@ -491,6 +492,10 @@ void MythAirplayServer::newConnection(QTcpSocket *client)
LOG(VB_GENERAL, LOG_INFO, LOC + QString("New connection from %1:%2")
.arg(client->peerAddress().toString()).arg(client->peerPort()));

MythNotification n(tr("New Connection"), tr("AirPlay"),
tr("from %1:%2").arg(client->peerAddress().toString()).arg(client->peerPort()));
MythUINotificationCenter::GetInstance()->Queue(n);

m_sockets.append(client);
connect(client, SIGNAL(disconnected()), this, SLOT(deleteConnection()));
connect(client, SIGNAL(readyRead()), this, SLOT(read()));
Expand All @@ -506,6 +511,9 @@ void MythAirplayServer::deleteConnection(void)
if (!m_sockets.contains(socket))
return;

MythNotification n(tr("Client disconnected"), tr("AirPlay"));
MythUINotificationCenter::GetInstance()->Queue(n);

deleteConnection(socket);
}

Expand Down

0 comments on commit 41a721b

Please sign in to comment.