added two fields in settings/people to setup the thresholds to decide between neutral and remotely positive/negative reputation

This commit is contained in:
csoler 2016-12-28 18:58:49 +01:00
parent da881e1f5b
commit fb733916ef
5 changed files with 86 additions and 21 deletions

View file

@ -42,7 +42,8 @@ bool PeoplePage::save(QString &/*errmsg*/)
else
rsReputations->setNodeAutoPositiveOpinionForContacts(false) ;
rsReputations->setNodeAutoBanIdentitiesLimit(ui.autoBanIdentitiesLimit_SB->value());
rsReputations->setThresholdForRemotelyPositiveReputation(ui.thresholdForPositive_SB->value());
rsReputations->setThresholdForRemotelyNegativeReputation(ui.thresholdForNegative_SB->value());
return true;
}
@ -51,8 +52,10 @@ bool PeoplePage::save(QString &/*errmsg*/)
void PeoplePage::load()
{
bool auto_positive_contacts = rsReputations->nodeAutoPositiveOpinionForContacts() ;
float node_auto_ban_identities_limit = rsReputations->nodeAutoBanIdentitiesLimit();
uint32_t threshold_for_positive = rsReputations->thresholdForRemotelyPositiveReputation();
uint32_t threshold_for_negative = rsReputations->thresholdForRemotelyNegativeReputation();
ui.autoPositiveOpinion_CB->setChecked(auto_positive_contacts);
ui.autoBanIdentitiesLimit_SB->setValue(node_auto_ban_identities_limit);
ui.thresholdForPositive_SB->setValue(threshold_for_positive);
ui.thresholdForNegative_SB->setValue(threshold_for_negative);
}

View file

@ -10,13 +10,13 @@
<height>441</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="generalGroupBox">
<property name="title">
<string>Identities handling</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="autoPositiveOpinion_CB">
<property name="toolTip">
@ -31,30 +31,44 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Friend average opinion below which identities are banned:</string>
<string>Difference in votes to make friends globally negative:</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="autoBanIdentitiesLimit_SB">
<item row="1" column="2">
<widget class="QSpinBox" name="thresholdForNegative_SB">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The default value of -0.6 needs 3 to 4 friends to set a negative opinion in order for that identity to be banned at your own node. This is a pretty conservative value. If you want to more easily get rid of banned identities, set the value to e.g. -0.2&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<double>-1.000000000000000</double>
<number>1</number>
</property>
<property name="maximum">
<double>-0.010000000000000</double>
<number>100</number>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</widget>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="thresholdForPositive_SB">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The default value of -0.6 needs 3 to 4 friends to set a negative opinion in order for that identity to be banned at your own node. This is a pretty conservative value. If you want to more easily get rid of banned identities, set the value to e.g. -0.2&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="value">
<double>-0.600000000000000</double>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Difference in votes to make friends globally positive:</string>
</property>
</widget>
</item>