added new flag to allow peers auto-download recommended files from trusted neighbor nodes, which give the possibility to push data to other nodes

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7955 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-02-18 19:07:58 +00:00
parent d029dd0368
commit d2c4c3bb09
15 changed files with 69 additions and 52 deletions

View file

@ -140,7 +140,8 @@ void ConfCertDialog::setServiceFlags()
{
ServicePermissionFlags flags(0) ;
if( ui._direct_transfer_CB->isChecked()) flags = flags | RS_SERVICE_PERM_DIRECT_DL ;
if( ui._direct_transfer_CB->isChecked()) flags = flags | RS_NODE_PERM_DIRECT_DL ;
if( ui._allow_push_CB->isChecked()) flags = flags | RS_NODE_PERM_ALLOW_PUSH ;
rsPeers->setServicePermissionFlags(pgpId,flags) ;
}
@ -175,7 +176,8 @@ void ConfCertDialog::load()
ui.make_friend_button->setToolTip("") ;
}
ui._direct_transfer_CB->setChecked( detail.service_perm_flags & RS_SERVICE_PERM_DIRECT_DL ) ;
ui._direct_transfer_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_DIRECT_DL ) ;
ui._allow_push_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ;
ui.name->setText(QString::fromUtf8(detail.name.c_str()));
ui.peerid->setText(QString::fromStdString(detail.id.toStdString()));

View file

@ -813,7 +813,7 @@ p, li { white-space: pre-wrap; }
<string>Options</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0" colspan="2">
<item row="2" column="0" colspan="2">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -836,6 +836,13 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="_allow_push_CB">
<property name="text">
<string>Auto-download recommended files from this node</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>

View file

@ -256,7 +256,8 @@ void ConnectFriendWizard::initializePage(int id)
{
std::cerr << "Conclusion page id : " << peerDetails.id << "; gpg_id : " << peerDetails.gpg_id << std::endl;
ui->_direct_transfer_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_SERVICE_PERM_DIRECT_DL) ;
ui->_direct_transfer_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_NODE_PERM_DIRECT_DL) ;
ui->_allow_push_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ;
RsPeerDetails tmp_det ;
bool already_in_keyring = rsPeers->getGPGDetails(peerDetails.gpg_id, tmp_det) ;
@ -620,9 +621,11 @@ ServicePermissionFlags ConnectFriendWizard::serviceFlags() const
if (hasVisitedPage(Page_FriendRequest))
{
if( ui->_direct_transfer_CB->isChecked()) flags |= RS_SERVICE_PERM_DIRECT_DL ;
if( ui->_direct_transfer_CB->isChecked()) flags |= RS_NODE_PERM_DIRECT_DL ;
if( ui->_allow_push_CB->isChecked()) flags |= RS_NODE_PERM_ALLOW_PUSH ;
} else if (hasVisitedPage(Page_Conclusion)) {
if( ui->_direct_transfer_CB_2->isChecked()) flags |= RS_SERVICE_PERM_DIRECT_DL ;
if( ui->_direct_transfer_CB_2->isChecked()) flags |= RS_NODE_PERM_DIRECT_DL ;
if( ui->_allow_push_CB_2->isChecked()) flags |= RS_NODE_PERM_ALLOW_PUSH ;
}
return flags ;
}

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>662</width>
<height>623</height>
<height>650</height>
</rect>
</property>
<property name="windowTitle">
@ -687,6 +687,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_allow_push_CB">
<property name="text">
<string>Auto-download recommended files</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
@ -996,34 +1003,20 @@
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Service permissions</string>
<string>Options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<widget class="QCheckBox" name="_direct_transfer_CB_2">
<property name="text">
<string>Direct source</string>
<string>Can be used as direct source</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_discovery_CB_2">
<widget class="QCheckBox" name="_allow_push_CB_2">
<property name="text">
<string>Discovery</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_forums_channels_CB_2">
<property name="text">
<string>Forums/channels</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_anonymous_routing_CB_2">
<property name="text">
<string>Anonymous routing</string>
<string>Auto-download recommended files</string>
</property>
</widget>
</item>
@ -1093,17 +1086,17 @@
</widget>
</widget>
<customwidgets>
<customwidget>
<class>StyledLabel</class>
<extends>QLabel</extends>
<header>gui/common/StyledLabel.h</header>
</customwidget>
<customwidget>
<class>AvatarWidget</class>
<extends>QLabel</extends>
<header>gui/common/AvatarWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>StyledLabel</class>
<extends>QLabel</extends>
<header>gui/common/StyledLabel.h</header>
</customwidget>
<customwidget>
<class>FriendSelectionWidget</class>
<extends>QWidget</extends>