diff options
| author | Anton <anton@picapica> | 2019-03-06 18:07:59 +0400 |
|---|---|---|
| committer | Anton <anton@picapica> | 2019-03-06 18:07:59 +0400 |
| commit | 73c06c18c5c6401ee08748ebed08c8896f63e344 (patch) | |
| tree | b832d62390181848e8d0b0efc7c5b9954c50e2b6 /pica-client/msguirouter.cpp | |
| parent | 032eb1f23992568e3ddd7946f94cd69a464167ba (diff) | |
| download | pica-pica-73c06c18c5c6401ee08748ebed08c8896f63e344.tar.gz pica-pica-73c06c18c5c6401ee08748ebed08c8896f63e344.zip | |
pica-client: display connection status, ciphersuite in chat window
Diffstat (limited to 'pica-client/msguirouter.cpp')
| -rw-r--r-- | pica-client/msguirouter.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/pica-client/msguirouter.cpp b/pica-client/msguirouter.cpp index f3d0916..4736006 100644 --- a/pica-client/msguirouter.cpp +++ b/pica-client/msguirouter.cpp @@ -42,6 +42,7 @@ MsgUIRouter::MsgUIRouter(QObject *parent) : connect(skynet, SIGNAL(CertificateForged(QByteArray, QString, QString)), this, SLOT(scary_cert_message(QByteArray, QString, QString))); connect(skynet, SIGNAL(StatusMsg(QString, bool)), this, SLOT(notification(QString, bool))); connect(systray, SIGNAL(doubleclicked()), this, SLOT(trayicon_dclick())); + connect(skynet, SIGNAL(ConnectionStatusUpdated(QByteArray,QString)), this, SLOT(update_status(QByteArray,QString))); } @@ -80,11 +81,22 @@ void MsgUIRouter::trayicon_dclick() } } +void MsgUIRouter::update_status(QByteArray peer_id, QString status) +{ + connstatus[peer_id] = status; + + if (chatwindows.contains(peer_id)) + chatwindows[peer_id]->update_status(status); +} + void MsgUIRouter::create_chatwindow(QByteArray peer_id) { ChatWindow *cw; - cw = new ChatWindow(peer_id); + if (!connstatus.contains(peer_id)) + connstatus[peer_id] = QString(tr("Disconnected")); + + cw = new ChatWindow(peer_id, connstatus[peer_id]); chatwindows[peer_id] = cw; |
