mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-09-27 03:41:07 -04:00
fixed author tooltip in ForumModel
This commit is contained in:
parent
114a11af75
commit
65f2d26651
2 changed files with 36 additions and 12 deletions
|
@ -4,7 +4,9 @@
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
#include "util/qtthreadsutils.h"
|
#include "util/qtthreadsutils.h"
|
||||||
|
#include "util/HandleRichText.h"
|
||||||
#include "util/DateTime.h"
|
#include "util/DateTime.h"
|
||||||
|
#include "gui/gxs/GxsIdDetails.h"
|
||||||
#include "GxsForumModel.h"
|
#include "GxsForumModel.h"
|
||||||
#include "retroshare/rsgxsflags.h"
|
#include "retroshare/rsgxsflags.h"
|
||||||
#include "retroshare/rsgxsforums.h"
|
#include "retroshare/rsgxsforums.h"
|
||||||
|
@ -333,18 +335,36 @@ QVariant RsGxsForumModel::missingRole(const ForumModelPostEntry& fmpe,int column
|
||||||
|
|
||||||
QVariant RsGxsForumModel::toolTipRole(const ForumModelPostEntry& fmpe,int column) const
|
QVariant RsGxsForumModel::toolTipRole(const ForumModelPostEntry& fmpe,int column) const
|
||||||
{
|
{
|
||||||
if(column != COLUMN_THREAD_DISTRIBUTION)
|
if(column == COLUMN_THREAD_DISTRIBUTION)
|
||||||
return QVariant();
|
switch(fmpe.mReputationWarningLevel)
|
||||||
|
{
|
||||||
|
case 3: return QVariant(tr("Information for this identity is currently missing.")) ;
|
||||||
|
case 2: return QVariant(tr("You have banned this ID. The message will not be\ndisplayed nor forwarded to your friends.")) ;
|
||||||
|
case 1: return QVariant(tr("You have not set an opinion for this person,\n and your friends do not vote positively: Spam regulation \nprevents the message to be forwarded to your friends.")) ;
|
||||||
|
case 0: return QVariant(tr("Message will be forwarded to your friends.")) ;
|
||||||
|
default:
|
||||||
|
return QVariant("[ERROR: missing reputation level information - contact the developers]");
|
||||||
|
}
|
||||||
|
|
||||||
switch(fmpe.mReputationWarningLevel)
|
if(column == COLUMN_THREAD_AUTHOR)
|
||||||
{
|
{
|
||||||
case 3: return QVariant(tr("Information for this identity is currently missing.")) ;
|
QString str,comment ;
|
||||||
case 2: return QVariant(tr("You have banned this ID. The message will not be\ndisplayed nor forwarded to your friends.")) ;
|
QList<QIcon> icons;
|
||||||
case 1: return QVariant(tr("You have not set an opinion for this person,\n and your friends do not vote positively: Spam regulation \nprevents the message to be forwarded to your friends.")) ;
|
|
||||||
case 0: return QVariant(tr("Message will be forwarded to your friends.")) ;
|
if(!GxsIdDetails::MakeIdDesc(fmpe.mAuthorId, true, str, icons, comment,GxsIdDetails::ICON_TYPE_AVATAR))
|
||||||
default:
|
return QVariant();
|
||||||
return QVariant("[ERROR: missing reputation level information - contact the developers]");
|
|
||||||
}
|
int S = QFontMetricsF(QApplication::font()).height();
|
||||||
|
QImage pix( (*icons.begin()).pixmap(QSize(4*S,4*S)).toImage());
|
||||||
|
|
||||||
|
QString embeddedImage;
|
||||||
|
if(RsHtml::makeEmbeddedImage(pix.scaled(QSize(4*S,4*S), Qt::KeepAspectRatio, Qt::SmoothTransformation), embeddedImage, 8*S * 8*S))
|
||||||
|
comment = "<table><tr><td>" + embeddedImage + "</td><td>" + comment + "</td></table>";
|
||||||
|
|
||||||
|
return comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant RsGxsForumModel::pinnedRole(const ForumModelPostEntry& fmpe,int column) const
|
QVariant RsGxsForumModel::pinnedRole(const ForumModelPostEntry& fmpe,int column) const
|
||||||
|
@ -474,8 +494,9 @@ void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector<F
|
||||||
|
|
||||||
bool has_unread_below,has_read_below ;
|
bool has_unread_below,has_read_below ;
|
||||||
recursUpdateReadStatus(0,has_unread_below,has_read_below) ;
|
recursUpdateReadStatus(0,has_unread_below,has_read_below) ;
|
||||||
|
#ifdef DEBUG_FORUMMODEL
|
||||||
debug_dump();
|
debug_dump();
|
||||||
|
#endif
|
||||||
|
|
||||||
emit layoutChanged();
|
emit layoutChanged();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2469,7 +2469,10 @@ void GxsForumThreadWidget::async_msg_action(const MsgMethod &action)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(msgs.size() != 1)
|
if(msgs.size() != 1)
|
||||||
|
{
|
||||||
|
std::cerr << __PRETTY_FUNCTION__ << " more than 1 or no msgs selected in forum " << groupId() << std::endl;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 2 - sort the messages into a proper hierarchy
|
// 2 - sort the messages into a proper hierarchy
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue