From f404962b51823b7ce850c77822df15a730318f7b Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 26 Mar 2019 11:47:11 +0100 Subject: [PATCH] fixed notification display for msgs --- retroshare-gui/src/gui/MessagesDialog.cpp | 2 +- retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.h | 11 ++++++++++- retroshare-gui/src/gui/msgs/MessageWidget.cpp | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/MessagesDialog.cpp index 8b5b923ca..16f7b80b3 100644 --- a/retroshare-gui/src/gui/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/MessagesDialog.cpp @@ -215,7 +215,7 @@ MessagesDialog::MessagesDialog(QWidget *parent) ui.messageTreeWidget->setSortingEnabled(true); /* Set header sizes for the fixed columns and resize modes, must be set after processSettings */ - msgwheader->setStretchLastSection(false); + msgwheader->setStretchLastSection(true); // fill folder list diff --git a/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.h b/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.h index 02eff1d32..6e910b63b 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.h +++ b/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.h @@ -144,7 +144,13 @@ public: float f = fm.height(); QIcon icon ; - if(! computeNameIconAndComment(id,str,icon,comment)) + + if(id.isNull()) + { + str = tr("[Notification]"); + icon = QIcon(":/icons/logo_128.png"); + } + else if(! computeNameIconAndComment(id,str,icon,comment)) if(mReloadPeriod > 3) { str = tr("[Unknown]"); @@ -193,7 +199,10 @@ public: QList icons; if(rsPeers->isFriend(RsPeerId(id))) // horrible trick because some widgets still use locations as IDs (e.g. messages) + { name = QString::fromUtf8(rsPeers->getPeerName(RsPeerId(id)).c_str()) ; + icon = QIcon(":/icons/avatar_128.png"); + } else if(!GxsIdDetails::MakeIdDesc(id, true, name, icons, comment,GxsIdDetails::ICON_TYPE_AVATAR)) return false; else diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp index 5294c1d26..d0a59e14b 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp @@ -600,8 +600,8 @@ void MessageWidget::fill(const std::string &msgId) link = RetroShareLink::createMessage(msgInfo.rspeerid_srcId, ""); } - if ((msgInfo.msgflags & RS_MSG_SYSTEM) && msgInfo.rspeerid_srcId == ownId) { - ui.fromText->setText("RetroShare"); + if (((msgInfo.msgflags & RS_MSG_SYSTEM) && msgInfo.rspeerid_srcId == ownId) || msgInfo.rspeerid_srcId.isNull()) { + ui.fromText->setText("[Notification]"); if (toolButtonReply) toolButtonReply->setEnabled(false); } else { ui.fromText->setText(link.toHtml());