mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 22:21:09 -04:00
fixed notification display for msgs
This commit is contained in:
parent
1d4934b71e
commit
f404962b51
3 changed files with 13 additions and 4 deletions
|
@ -215,7 +215,7 @@ MessagesDialog::MessagesDialog(QWidget *parent)
|
||||||
ui.messageTreeWidget->setSortingEnabled(true);
|
ui.messageTreeWidget->setSortingEnabled(true);
|
||||||
|
|
||||||
/* Set header sizes for the fixed columns and resize modes, must be set after processSettings */
|
/* Set header sizes for the fixed columns and resize modes, must be set after processSettings */
|
||||||
msgwheader->setStretchLastSection(false);
|
msgwheader->setStretchLastSection(true);
|
||||||
|
|
||||||
|
|
||||||
// fill folder list
|
// fill folder list
|
||||||
|
|
|
@ -144,7 +144,13 @@ public:
|
||||||
float f = fm.height();
|
float f = fm.height();
|
||||||
|
|
||||||
QIcon icon ;
|
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)
|
if(mReloadPeriod > 3)
|
||||||
{
|
{
|
||||||
str = tr("[Unknown]");
|
str = tr("[Unknown]");
|
||||||
|
@ -193,7 +199,10 @@ public:
|
||||||
QList<QIcon> icons;
|
QList<QIcon> icons;
|
||||||
|
|
||||||
if(rsPeers->isFriend(RsPeerId(id))) // horrible trick because some widgets still use locations as IDs (e.g. messages)
|
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()) ;
|
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))
|
else if(!GxsIdDetails::MakeIdDesc(id, true, name, icons, comment,GxsIdDetails::ICON_TYPE_AVATAR))
|
||||||
return false;
|
return false;
|
||||||
else
|
else
|
||||||
|
|
|
@ -600,8 +600,8 @@ void MessageWidget::fill(const std::string &msgId)
|
||||||
link = RetroShareLink::createMessage(msgInfo.rspeerid_srcId, "");
|
link = RetroShareLink::createMessage(msgInfo.rspeerid_srcId, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((msgInfo.msgflags & RS_MSG_SYSTEM) && msgInfo.rspeerid_srcId == ownId) {
|
if (((msgInfo.msgflags & RS_MSG_SYSTEM) && msgInfo.rspeerid_srcId == ownId) || msgInfo.rspeerid_srcId.isNull()) {
|
||||||
ui.fromText->setText("RetroShare");
|
ui.fromText->setText("[Notification]");
|
||||||
if (toolButtonReply) toolButtonReply->setEnabled(false);
|
if (toolButtonReply) toolButtonReply->setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
ui.fromText->setText(link.toHtml());
|
ui.fromText->setText(link.toHtml());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue