From 5262096b043bd4fa653fbadea133c9827d8517f3 Mon Sep 17 00:00:00 2001 From: Kevin Flynn Date: Fri, 27 Jun 2014 07:16:38 -0700 Subject: [PATCH] Fixed segfault when removing friend, minor UI changes --- img/contact list icons/contact_dark.png | Bin 0 -> 549 bytes widget/form/addfriendform.cpp | 2 ++ widget/friendwidget.cpp | 2 ++ widget/widget.cpp | 9 +++++++-- 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 img/contact list icons/contact_dark.png diff --git a/img/contact list icons/contact_dark.png b/img/contact list icons/contact_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..be08811bce0b5b8fe650c629ad0ad21d9bf54a63 GIT binary patch literal 549 zcmV+=0^0qFP)C+pHK{K!{A;hUD3jTOJ003aISiokp`8XbrpD;!VAx?1| zBLFlij$;%;oCbxaX^Niby@l5DJP*?}#le!cfxf~ANv>I;n`+e&+tF^;ap6BTMz7gvCKIVBo92fwAbB;j}yoClqfSmKz(3$N4 z&gV1UZZ~*+2yC}oxL&U_n4-Q^jk0-?BuEHB##rkXGRBY)f=QCt-?fx-6^7xjJG@*j z#*NgPABACvQp!~;XqIJ2DQz4eU2^s9pD3l6Wf>ZizJu0sT^FM$LdF;}#xRN^bX`~L zp_J;A|84J(QhPTK(pb=1jRQvr86B(`)23}qy;11r{ZlBa^!l2WdmvMlc~ag}9x ncltbG`#gP}s;VXjS5*byDOSy--p3Y#00000NkvXXu0mjfP{!<{ literal 0 HcmV?d00001 diff --git a/widget/form/addfriendform.cpp b/widget/form/addfriendform.cpp index 2c83c4a31..0f4701f45 100644 --- a/widget/form/addfriendform.cpp +++ b/widget/form/addfriendform.cpp @@ -40,6 +40,8 @@ void AddFriendForm::onSendTriggered() QString id = toxId.text(), msg = message.toPlainText(); if (id.isEmpty()) return; + if (message.isEmpty()) + msg = "Tox me maybe?"; emit friendRequested(id, msg); } diff --git a/widget/friendwidget.cpp b/widget/friendwidget.cpp index cf4fd81f0..567d96e78 100644 --- a/widget/friendwidget.cpp +++ b/widget/friendwidget.cpp @@ -76,6 +76,7 @@ void FriendWidget::setAsActiveChatroom() QPalette pal3; pal3.setColor(QPalette::Background, Qt::white); this->setPalette(pal3); + avatar.setPixmap(QPixmap("img/contact list icons/contact_dark.png")); } void FriendWidget::setAsInactiveChatroom() @@ -92,4 +93,5 @@ void FriendWidget::setAsInactiveChatroom() QPalette pal3; pal3.setColor(QPalette::Background, QColor(63,63,63,255)); this->setPalette(pal3); + avatar.setPixmap(QPixmap("img/contact list icons/contact.png")); } diff --git a/widget/widget.cpp b/widget/widget.cpp index 21dbc1fcc..49b308f00 100644 --- a/widget/widget.cpp +++ b/widget/widget.cpp @@ -173,13 +173,18 @@ void Widget::hideMainForms() item->widget()->hide(); while ((item = ui->mainContent->layout()->takeAt(0)) != 0) item->widget()->hide(); + if (activeFriendWidget != nullptr) { - activeFriendWidget->setAsInactiveChatroom(); + Friend* f = FriendList::findFriend(activeFriendWidget->friendId); + if (f != nullptr) + activeFriendWidget->setAsInactiveChatroom(); } if (activeGroupWidget != nullptr) { - activeGroupWidget->setAsInactiveChatroom(); + Group* g = GroupList::findGroup(activeGroupWidget->groupId); + if (g != nullptr) + activeGroupWidget->setAsInactiveChatroom(); } }