mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-07 22:02:32 -04:00
removed all permission system. Kept the use-as-direct-source option.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7904 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a018f17af7
commit
64f8b4c539
8 changed files with 55 additions and 221 deletions
|
@ -95,7 +95,7 @@ ConfCertDialog::ConfCertDialog(const RsPeerId& id, const RsPgpId &pgp_id, QWidge
|
|||
ui.headerFrame->setHeaderImage(QPixmap(":/images/user/identityinfo64.png"));
|
||||
ui.headerFrame->setHeaderText(tr("Friend Details"));
|
||||
|
||||
ui._chat_CB->hide() ;
|
||||
//ui._chat_CB->hide() ;
|
||||
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
|
||||
|
@ -135,19 +135,6 @@ ConfCertDialog::~ConfCertDialog()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void ConfCertDialog::setServiceFlags()
|
||||
{
|
||||
ServicePermissionFlags flags(0) ;
|
||||
|
||||
if(ui._anonymous_routing_CB->isChecked()) flags = flags | RS_SERVICE_PERM_TURTLE ;
|
||||
if( ui._discovery_CB->isChecked()) flags = flags | RS_SERVICE_PERM_DISCOVERY ;
|
||||
if( ui._forums_channels_CB->isChecked()) flags = flags | RS_SERVICE_PERM_DISTRIB ;
|
||||
if( ui._direct_transfer_CB->isChecked()) flags = flags | RS_SERVICE_PERM_DIRECT_DL ;
|
||||
|
||||
rsPeers->setServicePermissionFlags(pgpId,flags) ;
|
||||
}
|
||||
|
||||
void ConfCertDialog::loadAll()
|
||||
{
|
||||
for(QMap<RsPeerId, ConfCertDialog*>::iterator it = instances_ssl.begin(); it != instances_ssl.end(); ++it) it.value()->load();
|
||||
|
@ -178,11 +165,6 @@ void ConfCertDialog::load()
|
|||
ui.make_friend_button->setToolTip("") ;
|
||||
}
|
||||
|
||||
ui._anonymous_routing_CB->setChecked(detail.service_perm_flags & RS_SERVICE_PERM_TURTLE ) ;
|
||||
ui._discovery_CB->setChecked( detail.service_perm_flags & RS_SERVICE_PERM_DISCOVERY ) ;
|
||||
ui._forums_channels_CB->setChecked( detail.service_perm_flags & RS_SERVICE_PERM_DISTRIB ) ;
|
||||
ui._direct_transfer_CB->setChecked( detail.service_perm_flags & RS_SERVICE_PERM_DIRECT_DL ) ;
|
||||
|
||||
ui.name->setText(QString::fromUtf8(detail.name.c_str()));
|
||||
ui.peerid->setText(QString::fromStdString(detail.id.toStdString()));
|
||||
|
||||
|
@ -496,8 +478,6 @@ void ConfCertDialog::applyDialog()
|
|||
emit configChanged();
|
||||
}
|
||||
|
||||
setServiceFlags() ;
|
||||
|
||||
loadAll();
|
||||
close();
|
||||
}
|
||||
|
@ -509,7 +489,6 @@ void ConfCertDialog::makeFriend()
|
|||
}
|
||||
|
||||
rsPeers->addFriend(peerId, pgpId);
|
||||
setServiceFlags() ;
|
||||
loadAll();
|
||||
|
||||
emit configChanged();
|
||||
|
|
|
@ -80,7 +80,6 @@ private slots:
|
|||
void denyFriend();
|
||||
void signGPGKey();
|
||||
void loadInvitePage();
|
||||
void setServiceFlags();
|
||||
|
||||
void showHelpDialog();
|
||||
/** Called when a child window requests the given help <b>topic</b>. */
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>635</width>
|
||||
<height>643</height>
|
||||
<height>669</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -60,7 +60,7 @@
|
|||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="stabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="icon">
|
||||
|
@ -810,107 +810,10 @@ p, li { white-space: pre-wrap; }
|
|||
<normaloff>:/images/admin-16.png</normaloff>:/images/admin-16.png</iconset>
|
||||
</attribute>
|
||||
<attribute name="title">
|
||||
<string>Services</string>
|
||||
<string>Options</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../images.qrc">:/images/admin-24.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="StyledLabel" name="servicePermissionsLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>User service permissions</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QPlainTextEdit" name="servicePermissionsInfoLabel">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="plainText">
|
||||
<string>This tab allows you to finely tune which services each of your contacts is allowed to use with you.
|
||||
|
||||
Some services (Discovery, anonymous routing) can be switched off globally, which always overrides the settings per-user.</string>
|
||||
</property>
|
||||
<property name="overwriteMode">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="_anonymous_routing_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p align="justify">Disabling anonymous routing will suppress all sending/retrieval of tunnel and anonymous search requests from/to this user. This user will not be able to transfer anonymously through you.</p><p align="justify">For a global switch, go to the server configuration panel.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Anonymous routing</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="_discovery_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p align="justify">Disabling discovery removes the sending of public keys of your own friends to this user. Discovery information from this friend will be dropped as well.</p><p align="justify">For a global switch, go to the server configuration panel.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Discovery</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="_forums_channels_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p align="justify">Disabling this means that forums and channels posts will not be passed from you to this friend, and items coming from this friend will be dropped.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Forums/Channels</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="_direct_transfer_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p align="justify">Retroshare periodically checks your friend lists for browsable files matching your transfers, to establish a direct transfer. In this case, your friend knows you're downloading the file.</p><p align="justify">To prevent this behavior for this friend only, uncheck this box. You can still perform a direct transfer if you explicitly ask for it, by e.g. downloading from your friend's file list. </p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use as direct source, when available</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="_chat_CB">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Chat</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
@ -923,6 +826,16 @@ Some services (Discovery, anonymous routing) can be switched off globally, which
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="_direct_transfer_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p align="justify">Retroshare periodically checks your friend lists for browsable files matching your transfers, to establish a direct transfer. In this case, your friend knows you're downloading the file.</p><p align="justify">To prevent this behavior for this friend only, uncheck this box. You can still perform a direct transfer if you explicitly ask for it, by e.g. downloading from your friend's file list. </p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use as direct source, when available</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
@ -939,11 +852,6 @@ Some services (Discovery, anonymous routing) can be switched off globally, which
|
|||
<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>HeaderFrame</class>
|
||||
<extends>QFrame</extends>
|
||||
|
|
|
@ -256,10 +256,7 @@ void ConnectFriendWizard::initializePage(int id)
|
|||
{
|
||||
std::cerr << "Conclusion page id : " << peerDetails.id << "; gpg_id : " << peerDetails.gpg_id << std::endl;
|
||||
|
||||
ui->_anonymous_routing_CB_2->setChecked(peerDetails.service_perm_flags & RS_SERVICE_PERM_TURTLE) ;
|
||||
ui->_discovery_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_SERVICE_PERM_DISCOVERY) ;
|
||||
ui->_forums_channels_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_SERVICE_PERM_DISTRIB) ;
|
||||
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_SERVICE_PERM_DIRECT_DL) ;
|
||||
|
||||
RsPeerDetails tmp_det ;
|
||||
bool already_in_keyring = rsPeers->getGPGDetails(peerDetails.gpg_id, tmp_det) ;
|
||||
|
@ -277,7 +274,7 @@ void ConnectFriendWizard::initializePage(int id)
|
|||
//gpg key connection is already accepted, don't propose to accept it again
|
||||
ui->signGPGCheckBox->setChecked(false);
|
||||
ui->acceptNoSignGPGCheckBox->hide();
|
||||
ui->acceptNoSignGPGCheckBox->setChecked(false);
|
||||
ui->acceptNoSignGPGCheckBox->setChecked(false);
|
||||
}
|
||||
if (!peerDetails.accept_connection && peerDetails.ownsign) {
|
||||
//gpg key is already signed, don't propose to sign it again
|
||||
|
@ -619,21 +616,15 @@ int ConnectFriendWizard::nextId() const
|
|||
|
||||
ServicePermissionFlags ConnectFriendWizard::serviceFlags() const
|
||||
{
|
||||
ServicePermissionFlags flags(0) ;
|
||||
ServicePermissionFlags flags(0) ;
|
||||
|
||||
if (hasVisitedPage(Page_FriendRequest))
|
||||
{
|
||||
if(ui->_anonymous_routing_CB->isChecked()) flags |= RS_SERVICE_PERM_TURTLE ;
|
||||
if( ui->_discovery_CB->isChecked()) flags |= RS_SERVICE_PERM_DISCOVERY ;
|
||||
if( ui->_forums_channels_CB->isChecked()) flags |= RS_SERVICE_PERM_DISTRIB ;
|
||||
if( ui->_direct_transfer_CB->isChecked()) flags |= RS_SERVICE_PERM_DIRECT_DL ;
|
||||
} else if (hasVisitedPage(Page_Conclusion)) {
|
||||
if(ui->_anonymous_routing_CB_2->isChecked()) flags |= RS_SERVICE_PERM_TURTLE ;
|
||||
if( ui->_discovery_CB_2->isChecked()) flags |= RS_SERVICE_PERM_DISCOVERY ;
|
||||
if( ui->_forums_channels_CB_2->isChecked()) flags |= RS_SERVICE_PERM_DISTRIB ;
|
||||
if( ui->_direct_transfer_CB_2->isChecked()) flags |= RS_SERVICE_PERM_DIRECT_DL ;
|
||||
}
|
||||
return flags ;
|
||||
if (hasVisitedPage(Page_FriendRequest))
|
||||
{
|
||||
if( ui->_direct_transfer_CB->isChecked()) flags |= RS_SERVICE_PERM_DIRECT_DL ;
|
||||
} else if (hasVisitedPage(Page_Conclusion)) {
|
||||
if( ui->_direct_transfer_CB_2->isChecked()) flags |= RS_SERVICE_PERM_DIRECT_DL ;
|
||||
}
|
||||
return flags ;
|
||||
}
|
||||
void ConnectFriendWizard::accept()
|
||||
{
|
||||
|
@ -675,8 +666,8 @@ void ConnectFriendWizard::accept()
|
|||
if(accept_connection && !peerDetails.gpg_id.isNull())
|
||||
{
|
||||
std::cerr << "ConclusionPage::validatePage() accepting GPG key for connection." << std::endl;
|
||||
rsPeers->addFriend(peerDetails.id, peerDetails.gpg_id,serviceFlags()) ;
|
||||
rsPeers->setServicePermissionFlags(peerDetails.gpg_id,serviceFlags()) ;
|
||||
rsPeers->addFriend(peerDetails.id, peerDetails.gpg_id,serviceFlags()) ;
|
||||
rsPeers->setServicePermissionFlags(peerDetails.gpg_id,serviceFlags()) ;
|
||||
|
||||
if(sign)
|
||||
{
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>604</width>
|
||||
<width>662</width>
|
||||
<height>623</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -677,30 +677,9 @@
|
|||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Service permissions</string>
|
||||
<string>Options</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="_anonymous_routing_CB">
|
||||
<property name="text">
|
||||
<string>Anonymous routing</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="_discovery_CB">
|
||||
<property name="text">
|
||||
<string>Discovery</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="_forums_channels_CB">
|
||||
<property name="text">
|
||||
<string>Forums/channels</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="_direct_transfer_CB">
|
||||
<property name="text">
|
||||
|
@ -708,6 +687,19 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue