added an icon for when information is missing for an ID in forum distribution

This commit is contained in:
csoler 2016-12-27 17:17:23 +01:00
parent 5ed879c035
commit 64737827a1
2 changed files with 13 additions and 5 deletions

View File

@ -42,7 +42,8 @@ public:
REPUTATION_REMOTELY_NEGATIVE = 0x01, // local opinion is neutral and friends are positive in average REPUTATION_REMOTELY_NEGATIVE = 0x01, // local opinion is neutral and friends are positive in average
REPUTATION_NEUTRAL = 0x02, // no reputation information ; REPUTATION_NEUTRAL = 0x02, // no reputation information ;
REPUTATION_REMOTELY_POSITIVE = 0x03, // local opinion is neutral and friends are negative in average REPUTATION_REMOTELY_POSITIVE = 0x03, // local opinion is neutral and friends are negative in average
REPUTATION_LOCALLY_POSITIVE = 0x04 // local opinion is negative REPUTATION_LOCALLY_POSITIVE = 0x04, // local opinion is negative
REPUTATION_UNKNOWN = 0x05 // missing info
}; };
struct ReputationInfo struct ReputationInfo

View File

@ -64,6 +64,7 @@
#define IMAGE_BIOHAZARD ":/icons/yellow_biohazard64.png" #define IMAGE_BIOHAZARD ":/icons/yellow_biohazard64.png"
#define IMAGE_WARNING_YELLOW ":/icons/warning_yellow_128.png" #define IMAGE_WARNING_YELLOW ":/icons/warning_yellow_128.png"
#define IMAGE_WARNING_RED ":/icons/warning_red_128.png" #define IMAGE_WARNING_RED ":/icons/warning_red_128.png"
#define IMAGE_WARNING_UNKNOWN":/icons/bullet_grey_128.png"
#define IMAGE_VOID ":/icons/void_128.png" #define IMAGE_VOID ":/icons/void_128.png"
#define IMAGE_POSITIVE_OPINION ":/icons/png/thumbs-up.png" #define IMAGE_POSITIVE_OPINION ":/icons/png/thumbs-up.png"
#define IMAGE_NEUTRAL_OPINION ":/icons/png/thumbs-neutral.png" #define IMAGE_NEUTRAL_OPINION ":/icons/png/thumbs-neutral.png"
@ -125,6 +126,7 @@ public:
case 0: icon = QIcon(IMAGE_VOID); break; case 0: icon = QIcon(IMAGE_VOID); break;
case 1: icon = QIcon(IMAGE_WARNING_YELLOW); break; case 1: icon = QIcon(IMAGE_WARNING_YELLOW); break;
case 2: icon = QIcon(IMAGE_WARNING_RED); break; case 2: icon = QIcon(IMAGE_WARNING_RED); break;
case 3: icon = QIcon(IMAGE_WARNING_UNKNOWN); break;
} }
QPixmap pix = icon.pixmap(r.size()); QPixmap pix = icon.pixmap(r.size());
@ -1066,13 +1068,13 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum
RsReputations::ReputationLevel reputation_level = RsReputations::REPUTATION_NEUTRAL ; RsReputations::ReputationLevel reputation_level = RsReputations::REPUTATION_NEUTRAL ;
bool redacted = false ; bool redacted = false ;
if(!rsIdentity->getIdDetails(msg.mMeta.mAuthorId,iddetails)) if(rsIdentity->getIdDetails(msg.mMeta.mAuthorId,iddetails))
std::cerr << "(WW) Cannot grab identity details for " << msg.mMeta.mAuthorId.toStdString() << std::endl;
else
{ {
reputation_level = iddetails.mReputation.mOverallReputationLevel ; reputation_level = iddetails.mReputation.mOverallReputationLevel ;
redacted = (reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE) ; redacted = (reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE) ;
} }
else
reputation_level = RsReputations::REPUTATION_UNKNOWN ;
GxsIdRSTreeWidgetItem *item = new GxsIdRSTreeWidgetItem(mThreadCompareRole,GxsIdDetails::ICON_TYPE_AVATAR ); GxsIdRSTreeWidgetItem *item = new GxsIdRSTreeWidgetItem(mThreadCompareRole,GxsIdDetails::ICON_TYPE_AVATAR );
item->moveToThread(ui->threadTreeWidget->thread()); item->moveToThread(ui->threadTreeWidget->thread());
@ -1085,7 +1087,12 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum
QString rep_tooltip_str ; QString rep_tooltip_str ;
uint32_t rep_warning_level ; uint32_t rep_warning_level ;
if(reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE) if(reputation_level == RsReputations::REPUTATION_UNKNOWN)
{
rep_warning_level = 3 ;
rep_tooltip_str = tr("Information for this identity is currently missing.") ;
}
else if(reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE)
{ {
rep_warning_level = 2 ; rep_warning_level = 2 ;
rep_tooltip_str = tr("You have banned this ID. The message will not be\ndisplayed nor forwarded to your friends.") ; rep_tooltip_str = tr("You have banned this ID. The message will not be\ndisplayed nor forwarded to your friends.") ;