summaryrefslogtreecommitdiffstats
path: root/pica-client/chatwindow.cpp
diff options
context:
space:
mode:
authorAnton <anton@picapica>2019-03-06 18:07:59 +0400
committerAnton <anton@picapica>2019-03-06 18:07:59 +0400
commit73c06c18c5c6401ee08748ebed08c8896f63e344 (patch)
treeb832d62390181848e8d0b0efc7c5b9954c50e2b6 /pica-client/chatwindow.cpp
parent032eb1f23992568e3ddd7946f94cd69a464167ba (diff)
downloadpica-pica-73c06c18c5c6401ee08748ebed08c8896f63e344.tar.gz
pica-pica-73c06c18c5c6401ee08748ebed08c8896f63e344.zip
pica-client: display connection status, ciphersuite in chat window
Diffstat (limited to 'pica-client/chatwindow.cpp')
-rw-r--r--pica-client/chatwindow.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/pica-client/chatwindow.cpp b/pica-client/chatwindow.cpp
index f1835d7..f50d489 100644
--- a/pica-client/chatwindow.cpp
+++ b/pica-client/chatwindow.cpp
@@ -28,7 +28,7 @@
#include <QMessageBox>
-ChatWindow::ChatWindow(QByteArray peer_id) :
+ChatWindow::ChatWindow(QByteArray peer_id, QString status) :
QWidget(0), peer_id_(peer_id), hist(config_dbname, Accounts::GetCurrentAccount().id)
{
QVBoxLayout *layout;
@@ -58,6 +58,7 @@ ChatWindow::ChatWindow(QByteArray peer_id) :
layout = new QVBoxLayout;
+ lbConnStatus = new QLabel(status);
chatw = new QTextEdit(this);
sendtextw = new TextSend(this);
@@ -67,8 +68,17 @@ ChatWindow::ChatWindow(QByteArray peer_id) :
sendtextw->setMinimumWidth(240);
sendtextw->setAcceptRichText(false);
+ {
+ QFont f = lbConnStatus->font();
+ f.setBold(true);
+ //f.setItalic(true);
+ f.setStyleHint(QFont::Monospace);
+ lbConnStatus->setFont(f);
+ }
+
chatw->setReadOnly(true);
+ layout->addWidget(lbConnStatus, 0);
layout->addWidget(chatw, 3);
layout->addWidget(sendtextw, 1, Qt::AlignBottom);
@@ -122,6 +132,11 @@ ChatWindow::ChatWindow(QByteArray peer_id) :
}
+void ChatWindow::update_status(QString status)
+{
+ lbConnStatus->setText(status);
+}
+
void ChatWindow::put_message(QString msg, QByteArray id, bool is_me)
{
QString color, name;