merged upstream/master

This commit is contained in:
csoler 2017-01-04 20:24:08 +01:00
commit f72399f2a8
20 changed files with 362 additions and 178 deletions

View file

@ -323,11 +323,13 @@ IdDialog::IdDialog(QWidget *parent) :
ui->idTreeWidget->setColumnWidth(RSID_COL_NICKNAME, 14 * fontWidth);
ui->idTreeWidget->setColumnWidth(RSID_COL_KEYID, 20 * fontWidth);
ui->idTreeWidget->setColumnWidth(RSID_COL_IDTYPE, 18 * fontWidth);
ui->idTreeWidget->setColumnWidth(RSID_COL_VOTES, 7 * fontWidth);
ui->idTreeWidget->setColumnWidth(RSID_COL_VOTES, 2 * fontWidth);
ui->idTreeWidget->setItemDelegateForColumn(RSID_COL_VOTES,new ReputationItemDelegate(RsReputations::ReputationLevel(0xff))) ;
//QHeaderView_setSectionResizeMode(ui->idTreeWidget->header(), QHeaderView::ResizeToContents);
/* Set header resize modes and initial section sizes */
QHeaderView * idheader = ui->idTreeWidget->header();
QHeaderView_setSectionResizeModeColumn(idheader, RSID_COL_VOTES, QHeaderView::ResizeToContents);
mIdQueue = new TokenQueue(rsIdentity->getTokenService(), this);
@ -1854,6 +1856,9 @@ void IdDialog::insertIdDetails(uint32_t token)
frep_string = tr("No votes from friends") ;
ui->neighborNodesOpinion_TF->setText(frep_string) ;
ui->label_positive->setText(QString::number(info.mFriendsPositiveVotes));
ui->label_negative->setText(QString::number(info.mFriendsNegativeVotes));
switch(info.mOverallReputationLevel)
{

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>1269</width>
<height>1040</height>
<height>792</height>
</rect>
</property>
<property name="sizePolicy">
@ -131,7 +131,7 @@
</layout>
</widget>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QSplitter" name="mainSplitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -243,11 +243,18 @@
</column>
<column>
<property name="text">
<string>Reputation</string>
<string/>
</property>
<property name="toolTip">
<string>Votes</string>
</property>
<property name="textAlignment">
<set>AlignLeading|AlignVCenter</set>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/flag-green.png</normaloff>:/icons/flag-green.png</iconset>
</property>
</column>
</widget>
</item>
@ -318,7 +325,7 @@
<property name="title">
<string>Identity info</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_Nickname">
<property name="text">
@ -336,9 +343,9 @@
</property>
</widget>
</item>
<item row="0" column="2" rowspan="10">
<layout class="QVBoxLayout" name="detailAvatarVLayout">
<item>
<item row="0" column="2" rowspan="11">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="avatarLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -375,22 +382,104 @@
</property>
</widget>
</item>
<item>
<item row="1" column="0">
<widget class="QPushButton" name="inviteButton">
<property name="text">
<string>Send Invite</string>
</property>
</widget>
</item>
<item>
<spacer name="avatarVSpacer">
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label_4">
<property name="maximumSize">
<size>
<width>34</width>
<height>34</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../icons.qrc">:/icons/png/thumbs-up.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_positive">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="toolTip">
<string>Positive votes</string>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="maximumSize">
<size>
<width>34</width>
<height>34</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../icons.qrc">:/icons/png/thumbs-down.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_negative">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="toolTip">
<string>Negative votes</string>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<spacer name="avatarVSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>2</height>
<width>118</width>
<height>17</height>
</size>
</property>
</spacer>
@ -475,57 +564,10 @@
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="banoption_label">
<item row="7" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Ban-option:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="autoBanIdentities_CB">
<property name="text">
<string>Auto-Ban all identities signed by the same node</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="neighborNodesOpinion_LB">
<property name="text">
<string>Friend votes:</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLineEdit" name="neighborNodesOpinion_TF">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Average opinion of neighbor nodes about this identity. Negative is bad,&lt;/p&gt;&lt;p&gt;positive is good. Zero is neutral.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="overallOpinion_LB">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Overall:</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QLineEdit" name="overallOpinion_TF">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Overall reputation score, accounting for yours and your friends'.&lt;/p&gt;&lt;p&gt;Negative is bad, positive is good. Zero is neutral. If the score is too low,&lt;/p&gt;&lt;p&gt;the identity is flagged as bad, and will be filtered out in forums, chat lobbies,&lt;/p&gt;&lt;p&gt;channels, etc.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="readOnly">
<bool>true</bool>
<string>Your opinion:</string>
</property>
</widget>
</item>
@ -585,10 +627,57 @@ p, li { white-space: pre-wrap; }
</item>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label">
<item row="8" column="0">
<widget class="QLabel" name="banoption_label">
<property name="text">
<string>Your opinion:</string>
<string>Ban-option:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="autoBanIdentities_CB">
<property name="text">
<string>Auto-Ban all identities signed by the same node</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="neighborNodesOpinion_LB">
<property name="text">
<string>Friend votes:</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLineEdit" name="neighborNodesOpinion_TF">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Average opinion of neighbor nodes about this identity. Negative is bad,&lt;/p&gt;&lt;p&gt;positive is good. Zero is neutral.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="overallOpinion_LB">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Overall:</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QLineEdit" name="overallOpinion_TF">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Overall reputation score, accounting for yours and your friends'.&lt;/p&gt;&lt;p&gt;Negative is bad, positive is good. Zero is neutral. If the score is too low,&lt;/p&gt;&lt;p&gt;the identity is flagged as bad, and will be filtered out in forums, chat lobbies,&lt;/p&gt;&lt;p&gt;channels, etc.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>

View file

@ -160,7 +160,7 @@ static void loadPrivateIdsCallback(GxsIdDetailsType type, const RsIdentityDetail
break;
case GXS_ID_DETAILS_TYPE_DONE:
GxsIdDetails::getIcons(details, icons);
GxsIdDetails::getIcons(details, icons, GxsIdDetails::ICON_TYPE_AVATAR);
break;
case GXS_ID_DETAILS_TYPE_BANNED:

View file

@ -51,8 +51,8 @@
#define REPUTATION_LOCALLY_POSITIVE_ICON ":/icons/bullet_green_yellow_star_128.png"
#define REPUTATION_REMOTELY_POSITIVE_ICON ":/icons/bullet_green_128.png"
#define REPUTATION_NEUTRAL_ICON ":/icons/bullet_grey_128.png"
#define REPUTATION_REMOTELY_NEGATIVE_ICON ":/icons/yellow_biohazard64.png"
#define REPUTATION_LOCALLY_NEGATIVE_ICON ":/icons/red_biohazard64.png"
#define REPUTATION_REMOTELY_NEGATIVE_ICON ":/icons/biohazard_yellow.png"
#define REPUTATION_LOCALLY_NEGATIVE_ICON ":/icons/biohazard_red.png"
#define REPUTATION_VOID ":/icons/void_128.png"
#define TIMER_INTERVAL 500
@ -996,18 +996,17 @@ QString nickname ;
QIcon GxsIdDetails::getReputationIcon(RsReputations::ReputationLevel icon_index,uint32_t min_reputation)
{
if(icon_index >= min_reputation)
return QIcon(REPUTATION_VOID);
if( icon_index >= min_reputation ) return QIcon(REPUTATION_VOID) ;
switch(icon_index)
{
case RsReputations::REPUTATION_LOCALLY_NEGATIVE: return QIcon(REPUTATION_LOCALLY_NEGATIVE_ICON) ; break ;
case RsReputations::REPUTATION_LOCALLY_POSITIVE: return QIcon(REPUTATION_LOCALLY_POSITIVE_ICON) ; break ;
case RsReputations::REPUTATION_REMOTELY_POSITIVE: return QIcon(REPUTATION_REMOTELY_POSITIVE_ICON) ; break ;
case RsReputations::REPUTATION_REMOTELY_NEGATIVE: return QIcon(REPUTATION_REMOTELY_NEGATIVE_ICON) ; break ;
case RsReputations::REPUTATION_NEUTRAL: return QIcon(REPUTATION_NEUTRAL_ICON) ; break ;
default:
std::cerr << "Asked for unidentified icon index " << icon_index << std::endl;
case RsReputations::REPUTATION_LOCALLY_NEGATIVE: return QIcon(REPUTATION_LOCALLY_NEGATIVE_ICON) ; break ;
case RsReputations::REPUTATION_LOCALLY_POSITIVE: return QIcon(REPUTATION_LOCALLY_POSITIVE_ICON) ; break ;
case RsReputations::REPUTATION_REMOTELY_POSITIVE: return QIcon(REPUTATION_REMOTELY_POSITIVE_ICON) ; break ;
case RsReputations::REPUTATION_REMOTELY_NEGATIVE: return QIcon(REPUTATION_REMOTELY_NEGATIVE_ICON) ; break ;
case RsReputations::REPUTATION_NEUTRAL: return QIcon(REPUTATION_NEUTRAL_ICON) ; break ;
default:
std::cerr << "Asked for unidentified icon index " << icon_index << std::endl;
return QIcon(); // dont draw anything
}
}

View file

@ -224,8 +224,11 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
/* Set header resize modes and initial section sizes */
QHeaderView * ttheader = ui->threadTreeWidget->header () ;
QHeaderView_setSectionResizeModeColumn(ttheader, COLUMN_THREAD_TITLE, QHeaderView::Interactive);
QHeaderView_setSectionResizeModeColumn(ttheader, COLUMN_THREAD_DISTRIBUTION, QHeaderView::ResizeToContents);
ttheader->resizeSection (COLUMN_THREAD_DATE, 140);
ttheader->resizeSection (COLUMN_THREAD_TITLE, 440);
ttheader->resizeSection (COLUMN_THREAD_DISTRIBUTION, 24);
ttheader->resizeSection (COLUMN_THREAD_AUTHOR, 150);
ui->threadTreeWidget->sortItems(COLUMN_THREAD_DATE, Qt::DescendingOrder);
@ -1072,18 +1075,18 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum
// Early check for a message that should be hidden because its author
// is flagged with a bad reputation
RsIdentityDetails iddetails ;
RsIdentityDetails iddetails;
RsReputations::ReputationLevel reputation_level = RsReputations::REPUTATION_NEUTRAL ;
bool redacted = false ;
RsReputations::ReputationLevel reputation_level = RsReputations::REPUTATION_NEUTRAL;
bool redacted = false;
if(rsIdentity->getIdDetails(msg.mMeta.mAuthorId,iddetails))
{
reputation_level = iddetails.mReputation.mOverallReputationLevel ;
redacted = (reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE) ;
}
else
reputation_level = RsReputations::REPUTATION_UNKNOWN ;
if( rsIdentity->getIdDetails(msg.mMeta.mAuthorId,iddetails) )
{
reputation_level = iddetails.mReputation.mOverallReputationLevel;
redacted = (reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE);
}
else
reputation_level = RsReputations::REPUTATION_UNKNOWN;
GxsIdRSTreeWidgetItem *item = new GxsIdRSTreeWidgetItem(mThreadCompareRole,GxsIdDetails::ICON_TYPE_AVATAR );
item->moveToThread(ui->threadTreeWidget->thread());

View file

@ -240,8 +240,15 @@
</column>
<column>
<property name="text">
<string/>
</property>
<property name="toolTip">
<string>Distribution</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/flag-green.png</normaloff>:/icons/flag-green.png</iconset>
</property>
</column>
<column>
<property name="text">
@ -556,6 +563,7 @@
</customwidgets>
<resources>
<include location="../images.qrc"/>
<include location="../icons.qrc"/>
</resources>
<connections/>
</ui>

View file

@ -6,6 +6,8 @@
<file>icons/aol.png</file>
<file>icons/avatar_128.png</file>
<file>icons/avatar_grey_128.png</file>
<file>icons/biohazard_red.png</file>
<file>icons/biohazard_yellow.png</file>
<file>icons/blank_blue_128.png</file>
<file>icons/blank_green_128.png</file>
<file>icons/blank_red_128.png</file>
@ -23,6 +25,7 @@
<file>icons/chat_red_128.png</file>
<file>icons/circles_128.png</file>
<file>icons/circles_new_128.png</file>
<file>icons/flag-green.png</file>
<file>icons/friends_128.png</file>
<file>icons/global_switch_off_128.png</file>
<file>icons/global_switch_on_128.png</file>
@ -106,7 +109,6 @@
<file>icons/posted_128.png</file>
<file>icons/posted_red_128.png</file>
<file>icons/quit_128.png</file>
<file>icons/red_biohazard64.png</file>
<file>icons/search_red_128.png</file>
<file>icons/security_high_128.png</file>
<file>icons/security_low_128.png</file>
@ -222,6 +224,5 @@
<file>icons/warning_yellow_128.png</file>
<file>icons/yahoo.png</file>
<file>icons/yandex.png</file>
<file>icons/yellow_biohazard64.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB