mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-30 11:24:24 -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
|
@ -73,26 +73,21 @@ const uint32_t RS_PEER_STATE_ONLINE = 0x0002;
|
||||||
const uint32_t RS_PEER_STATE_CONNECTED = 0x0004;
|
const uint32_t RS_PEER_STATE_CONNECTED = 0x0004;
|
||||||
const uint32_t RS_PEER_STATE_UNREACHABLE= 0x0008;
|
const uint32_t RS_PEER_STATE_UNREACHABLE= 0x0008;
|
||||||
|
|
||||||
// Service permission flags.
|
// Service option flags.
|
||||||
//
|
//
|
||||||
const ServicePermissionFlags RS_SERVICE_PERM_NONE ( 0x00000000 ) ;
|
const ServicePermissionFlags RS_SERVICE_PERM_NONE ( 0x00000000 ) ;
|
||||||
const ServicePermissionFlags RS_SERVICE_PERM_TURTLE ( 0x00000001 ) ;
|
|
||||||
const ServicePermissionFlags RS_SERVICE_PERM_DISCOVERY ( 0x00000002 ) ;
|
|
||||||
const ServicePermissionFlags RS_SERVICE_PERM_DISTRIB ( 0x00000004 ) ;
|
|
||||||
const ServicePermissionFlags RS_SERVICE_PERM_DIRECT_DL ( 0x00000008 ) ;
|
const ServicePermissionFlags RS_SERVICE_PERM_DIRECT_DL ( 0x00000008 ) ;
|
||||||
const ServicePermissionFlags RS_SERVICE_PERM_ALL = RS_SERVICE_PERM_TURTLE | RS_SERVICE_PERM_DISCOVERY
|
const ServicePermissionFlags RS_SERVICE_PERM_ALL = RS_SERVICE_PERM_DIRECT_DL ;
|
||||||
| RS_SERVICE_PERM_DISTRIB | RS_SERVICE_PERM_DIRECT_DL;
|
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
/* Connect state */
|
/* Connect state */
|
||||||
const uint32_t RS_PEER_CONNECTSTATE_OFFLINE = 0;
|
const uint32_t RS_PEER_CONNECTSTATE_OFFLINE = 0;
|
||||||
|
|
||||||
const uint32_t RS_PEER_CONNECTSTATE_TRYING_TCP = 2;
|
const uint32_t RS_PEER_CONNECTSTATE_TRYING_TCP = 2;
|
||||||
const uint32_t RS_PEER_CONNECTSTATE_TRYING_UDP = 3;
|
const uint32_t RS_PEER_CONNECTSTATE_TRYING_UDP = 3;
|
||||||
const uint32_t RS_PEER_CONNECTSTATE_CONNECTED_TCP = 4;
|
const uint32_t RS_PEER_CONNECTSTATE_CONNECTED_TCP = 4;
|
||||||
const uint32_t RS_PEER_CONNECTSTATE_CONNECTED_UDP = 5;
|
const uint32_t RS_PEER_CONNECTSTATE_CONNECTED_UDP = 5;
|
||||||
const uint32_t RS_PEER_CONNECTSTATE_CONNECTED_TOR = 6;
|
const uint32_t RS_PEER_CONNECTSTATE_CONNECTED_TOR = 6;
|
||||||
|
|
||||||
const uint32_t RS_PEER_CONNECTSTATE_CONNECTED_UNKNOWN = 7;
|
const uint32_t RS_PEER_CONNECTSTATE_CONNECTED_UNKNOWN = 7;
|
||||||
|
|
||||||
/* Error codes for certificate cleaning and cert parsing. Numbers should not overlap. */
|
/* Error codes for certificate cleaning and cert parsing. Numbers should not overlap. */
|
||||||
|
@ -215,10 +210,10 @@ class RsPeerDetails
|
||||||
|
|
||||||
bool accept_connection;
|
bool accept_connection;
|
||||||
|
|
||||||
/* Peer permission flags. What services the peer can use (Only valid if friend).*/
|
/* Peer permission flags. What services the peer can use (Only valid if friend).*/
|
||||||
ServicePermissionFlags service_perm_flags ;
|
ServicePermissionFlags service_perm_flags ;
|
||||||
|
|
||||||
/* Network details (only valid if friend) */
|
/* Network details (only valid if friend) */
|
||||||
uint32_t state;
|
uint32_t state;
|
||||||
|
|
||||||
std::string connectAddr ; // current address if connected.
|
std::string connectAddr ; // current address if connected.
|
||||||
|
@ -326,7 +321,7 @@ class RsPeers
|
||||||
virtual bool gpgSignData(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen) = 0;
|
virtual bool gpgSignData(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen) = 0;
|
||||||
|
|
||||||
/* Add/Remove Friends */
|
/* Add/Remove Friends */
|
||||||
virtual bool addFriend(const RsPeerId &ssl_id, const RsPgpId &gpg_id,ServicePermissionFlags flags = RS_SERVICE_PERM_ALL) = 0;
|
virtual bool addFriend(const RsPeerId &ssl_id, const RsPgpId &gpg_id,ServicePermissionFlags flags = RS_SERVICE_PERM_ALL) = 0;
|
||||||
virtual bool removeFriend(const RsPgpId& pgp_id) = 0;
|
virtual bool removeFriend(const RsPgpId& pgp_id) = 0;
|
||||||
virtual bool removeFriendLocation(const RsPeerId& sslId) = 0;
|
virtual bool removeFriendLocation(const RsPeerId& sslId) = 0;
|
||||||
|
|
||||||
|
@ -397,11 +392,11 @@ class RsPeers
|
||||||
//
|
//
|
||||||
virtual FileSearchFlags computePeerPermissionFlags(const RsPeerId& peer_id,FileStorageFlags file_sharing_flags,const std::list<std::string>& file_parent_groups) = 0;
|
virtual FileSearchFlags computePeerPermissionFlags(const RsPeerId& peer_id,FileStorageFlags file_sharing_flags,const std::list<std::string>& file_parent_groups) = 0;
|
||||||
|
|
||||||
/* Service permission flags */
|
/* Service permission flags */
|
||||||
|
|
||||||
virtual ServicePermissionFlags servicePermissionFlags(const RsPgpId& gpg_id) = 0;
|
virtual ServicePermissionFlags servicePermissionFlags(const RsPgpId& gpg_id) = 0;
|
||||||
virtual ServicePermissionFlags servicePermissionFlags(const RsPeerId& ssl_id) = 0;
|
virtual ServicePermissionFlags servicePermissionFlags(const RsPeerId& ssl_id) = 0;
|
||||||
virtual void setServicePermissionFlags(const RsPgpId& gpg_id,const ServicePermissionFlags& flags) = 0;
|
virtual void setServicePermissionFlags(const RsPgpId& gpg_id,const ServicePermissionFlags& flags) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -274,25 +274,10 @@ int p3discovery2::handleIncoming()
|
||||||
if (NULL != (contact = dynamic_cast<RsDiscContactItem *> (item)))
|
if (NULL != (contact = dynamic_cast<RsDiscContactItem *> (item)))
|
||||||
{
|
{
|
||||||
if (item->PeerId() == contact->sslId) /* self describing */
|
if (item->PeerId() == contact->sslId) /* self describing */
|
||||||
{
|
|
||||||
recvOwnContactInfo(item->PeerId(), contact);
|
recvOwnContactInfo(item->PeerId(), contact);
|
||||||
}
|
else
|
||||||
else if (rsPeers->servicePermissionFlags(item->PeerId()) & RS_SERVICE_PERM_DISCOVERY)
|
processContactInfo(item->PeerId(), contact);
|
||||||
{
|
|
||||||
processContactInfo(item->PeerId(), contact);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* not allowed */
|
|
||||||
delete item;
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* any other packets should be dropped if they don't have permission */
|
|
||||||
if(!(rsPeers->servicePermissionFlags(item->PeerId()) & RS_SERVICE_PERM_DISCOVERY))
|
|
||||||
{
|
|
||||||
delete item;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -795,15 +780,6 @@ void p3discovery2::sendContactInfo_locked(const PGPID &aboutId, const SSLID &toI
|
||||||
std::cerr << "p3discovery2::sendContactInfo_locked() aboutPGPId: " << aboutId << " toId: " << toId;
|
std::cerr << "p3discovery2::sendContactInfo_locked() aboutPGPId: " << aboutId << " toId: " << toId;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
if (!(rsPeers->servicePermissionFlags(toId) & RS_SERVICE_PERM_DISCOVERY))
|
|
||||||
{
|
|
||||||
#ifdef P3DISC_DEBUG
|
|
||||||
std::cerr << "p3discovery2::sendContactInfo_locked() discovery disabled for SSLID: " << toId;
|
|
||||||
std::cerr << std::endl;
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::map<PGPID, DiscPgpInfo>::const_iterator it;
|
std::map<PGPID, DiscPgpInfo>::const_iterator it;
|
||||||
it = mFriendList.find(aboutId);
|
it = mFriendList.find(aboutId);
|
||||||
if (it == mFriendList.end())
|
if (it == mFriendList.end())
|
||||||
|
|
|
@ -50,13 +50,7 @@ ServicePermissionDialog::ServicePermissionDialog() :
|
||||||
ui->servicePermissionList->setShowType(FriendSelectionWidget::SHOW_GROUP | FriendSelectionWidget::SHOW_GPG);
|
ui->servicePermissionList->setShowType(FriendSelectionWidget::SHOW_GROUP | FriendSelectionWidget::SHOW_GPG);
|
||||||
|
|
||||||
/* add columns */
|
/* add columns */
|
||||||
int column = ui->servicePermissionList->addColumn(tr("Anonymous routing"));
|
int column = ui->servicePermissionList->addColumn(tr("Use as direct source, when available"));
|
||||||
mColumns[column] = RS_SERVICE_PERM_TURTLE;
|
|
||||||
column = ui->servicePermissionList->addColumn(tr("Discovery"));
|
|
||||||
mColumns[column] = RS_SERVICE_PERM_DISCOVERY;
|
|
||||||
column = ui->servicePermissionList->addColumn(tr("Forums/Channels"));
|
|
||||||
mColumns[column] = RS_SERVICE_PERM_DISTRIB;
|
|
||||||
column = ui->servicePermissionList->addColumn(tr("Use as direct source, when available"));
|
|
||||||
mColumns[column] = RS_SERVICE_PERM_DIRECT_DL;
|
mColumns[column] = RS_SERVICE_PERM_DIRECT_DL;
|
||||||
|
|
||||||
ui->servicePermissionList->start();
|
ui->servicePermissionList->start();
|
||||||
|
|
|
@ -95,7 +95,7 @@ ConfCertDialog::ConfCertDialog(const RsPeerId& id, const RsPgpId &pgp_id, QWidge
|
||||||
ui.headerFrame->setHeaderImage(QPixmap(":/images/user/identityinfo64.png"));
|
ui.headerFrame->setHeaderImage(QPixmap(":/images/user/identityinfo64.png"));
|
||||||
ui.headerFrame->setHeaderText(tr("Friend Details"));
|
ui.headerFrame->setHeaderText(tr("Friend Details"));
|
||||||
|
|
||||||
ui._chat_CB->hide() ;
|
//ui._chat_CB->hide() ;
|
||||||
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
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()
|
void ConfCertDialog::loadAll()
|
||||||
{
|
{
|
||||||
for(QMap<RsPeerId, ConfCertDialog*>::iterator it = instances_ssl.begin(); it != instances_ssl.end(); ++it) it.value()->load();
|
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.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.name->setText(QString::fromUtf8(detail.name.c_str()));
|
||||||
ui.peerid->setText(QString::fromStdString(detail.id.toStdString()));
|
ui.peerid->setText(QString::fromStdString(detail.id.toStdString()));
|
||||||
|
|
||||||
|
@ -496,8 +478,6 @@ void ConfCertDialog::applyDialog()
|
||||||
emit configChanged();
|
emit configChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
setServiceFlags() ;
|
|
||||||
|
|
||||||
loadAll();
|
loadAll();
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
@ -509,7 +489,6 @@ void ConfCertDialog::makeFriend()
|
||||||
}
|
}
|
||||||
|
|
||||||
rsPeers->addFriend(peerId, pgpId);
|
rsPeers->addFriend(peerId, pgpId);
|
||||||
setServiceFlags() ;
|
|
||||||
loadAll();
|
loadAll();
|
||||||
|
|
||||||
emit configChanged();
|
emit configChanged();
|
||||||
|
|
|
@ -80,7 +80,6 @@ private slots:
|
||||||
void denyFriend();
|
void denyFriend();
|
||||||
void signGPGKey();
|
void signGPGKey();
|
||||||
void loadInvitePage();
|
void loadInvitePage();
|
||||||
void setServiceFlags();
|
|
||||||
|
|
||||||
void showHelpDialog();
|
void showHelpDialog();
|
||||||
/** Called when a child window requests the given help <b>topic</b>. */
|
/** Called when a child window requests the given help <b>topic</b>. */
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>635</width>
|
<width>635</width>
|
||||||
<height>643</height>
|
<height>669</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTabWidget" name="stabWidget">
|
<widget class="QTabWidget" name="stabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="icon">
|
<attribute name="icon">
|
||||||
|
@ -810,107 +810,10 @@ p, li { white-space: pre-wrap; }
|
||||||
<normaloff>:/images/admin-16.png</normaloff>:/images/admin-16.png</iconset>
|
<normaloff>:/images/admin-16.png</normaloff>:/images/admin-16.png</iconset>
|
||||||
</attribute>
|
</attribute>
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Services</string>
|
<string>Options</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<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">
|
<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">
|
<spacer name="verticalSpacer_4">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -923,6 +826,16 @@ Some services (Discovery, anonymous routing) can be switched off globally, which
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</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>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -939,11 +852,6 @@ Some services (Discovery, anonymous routing) can be switched off globally, which
|
||||||
<header>gui/common/AvatarWidget.h</header>
|
<header>gui/common/AvatarWidget.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
|
||||||
<class>StyledLabel</class>
|
|
||||||
<extends>QLabel</extends>
|
|
||||||
<header>gui/common/StyledLabel.h</header>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>HeaderFrame</class>
|
<class>HeaderFrame</class>
|
||||||
<extends>QFrame</extends>
|
<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;
|
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->_direct_transfer_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_SERVICE_PERM_DIRECT_DL) ;
|
||||||
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) ;
|
|
||||||
|
|
||||||
RsPeerDetails tmp_det ;
|
RsPeerDetails tmp_det ;
|
||||||
bool already_in_keyring = rsPeers->getGPGDetails(peerDetails.gpg_id, 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
|
//gpg key connection is already accepted, don't propose to accept it again
|
||||||
ui->signGPGCheckBox->setChecked(false);
|
ui->signGPGCheckBox->setChecked(false);
|
||||||
ui->acceptNoSignGPGCheckBox->hide();
|
ui->acceptNoSignGPGCheckBox->hide();
|
||||||
ui->acceptNoSignGPGCheckBox->setChecked(false);
|
ui->acceptNoSignGPGCheckBox->setChecked(false);
|
||||||
}
|
}
|
||||||
if (!peerDetails.accept_connection && peerDetails.ownsign) {
|
if (!peerDetails.accept_connection && peerDetails.ownsign) {
|
||||||
//gpg key is already signed, don't propose to sign it again
|
//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 ConnectFriendWizard::serviceFlags() const
|
||||||
{
|
{
|
||||||
ServicePermissionFlags flags(0) ;
|
ServicePermissionFlags flags(0) ;
|
||||||
|
|
||||||
if (hasVisitedPage(Page_FriendRequest))
|
if (hasVisitedPage(Page_FriendRequest))
|
||||||
{
|
{
|
||||||
if(ui->_anonymous_routing_CB->isChecked()) flags |= RS_SERVICE_PERM_TURTLE ;
|
if( ui->_direct_transfer_CB->isChecked()) flags |= RS_SERVICE_PERM_DIRECT_DL ;
|
||||||
if( ui->_discovery_CB->isChecked()) flags |= RS_SERVICE_PERM_DISCOVERY ;
|
} else if (hasVisitedPage(Page_Conclusion)) {
|
||||||
if( ui->_forums_channels_CB->isChecked()) flags |= RS_SERVICE_PERM_DISTRIB ;
|
if( ui->_direct_transfer_CB_2->isChecked()) flags |= RS_SERVICE_PERM_DIRECT_DL ;
|
||||||
if( ui->_direct_transfer_CB->isChecked()) flags |= RS_SERVICE_PERM_DIRECT_DL ;
|
}
|
||||||
} else if (hasVisitedPage(Page_Conclusion)) {
|
return flags ;
|
||||||
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 ;
|
|
||||||
}
|
}
|
||||||
void ConnectFriendWizard::accept()
|
void ConnectFriendWizard::accept()
|
||||||
{
|
{
|
||||||
|
@ -675,8 +666,8 @@ void ConnectFriendWizard::accept()
|
||||||
if(accept_connection && !peerDetails.gpg_id.isNull())
|
if(accept_connection && !peerDetails.gpg_id.isNull())
|
||||||
{
|
{
|
||||||
std::cerr << "ConclusionPage::validatePage() accepting GPG key for connection." << std::endl;
|
std::cerr << "ConclusionPage::validatePage() accepting GPG key for connection." << std::endl;
|
||||||
rsPeers->addFriend(peerDetails.id, peerDetails.gpg_id,serviceFlags()) ;
|
rsPeers->addFriend(peerDetails.id, peerDetails.gpg_id,serviceFlags()) ;
|
||||||
rsPeers->setServicePermissionFlags(peerDetails.gpg_id,serviceFlags()) ;
|
rsPeers->setServicePermissionFlags(peerDetails.gpg_id,serviceFlags()) ;
|
||||||
|
|
||||||
if(sign)
|
if(sign)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>604</width>
|
<width>662</width>
|
||||||
<height>623</height>
|
<height>623</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -677,30 +677,9 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Service permissions</string>
|
<string>Options</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
<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>
|
<item>
|
||||||
<widget class="QCheckBox" name="_direct_transfer_CB">
|
<widget class="QCheckBox" name="_direct_transfer_CB">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -708,6 +687,19 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue