From ae5e1c7ae58b98a122a3da9a0b50a4e85eeaf5d0 Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 19 Apr 2013 11:54:39 +0000 Subject: [PATCH] reverted last commit. Fixed the perm bug in ConnectFreindWizard (Patch from Henry Morgan) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6316 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../src/gui/connect/ConnectFriendWizard.cpp | 16 +++++++++++----- retroshare-gui/src/gui/feeds/SecurityItem.cpp | 8 ++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp index 0779260ee..e470510ca 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp @@ -515,13 +515,18 @@ ServicePermissionFlags ConnectFriendWizard::serviceFlags() const { ServicePermissionFlags flags(0) ; - 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 (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 ; + } 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 ; + } return flags ; } - void ConnectFriendWizard::accept() { bool sign = false; @@ -560,6 +565,7 @@ void ConnectFriendWizard::accept() } else if (accept_connection) { std::cerr << "ConclusionPage::validatePage() accepting GPG key for connection." << std::endl; rsPeers->addFriend("", peerDetails.gpg_id,serviceFlags()) ; + rsPeers->setServicePermissionFlags(peerDetails.gpg_id,serviceFlags()) ; } if (!groupId.isEmpty()) { diff --git a/retroshare-gui/src/gui/feeds/SecurityItem.cpp b/retroshare-gui/src/gui/feeds/SecurityItem.cpp index 6c2e3b055..0e9c65637 100644 --- a/retroshare-gui/src/gui/feeds/SecurityItem.cpp +++ b/retroshare-gui/src/gui/feeds/SecurityItem.cpp @@ -326,20 +326,20 @@ void SecurityItem::removeFriend() rsPeers->removeFriend(mGpgId); } } - void SecurityItem::friendRequest() { #ifdef DEBUG_ITEM std::cerr << "SecurityItem::friendReguest()"; std::cerr << std::endl; #endif - ConfCertDialog::showIt(mGpgId, ConfCertDialog::PageTrust); -/* ConnectFriendWizard *connectFriendWizard = new ConnectFriendWizard; + + ConnectFriendWizard *connectFriendWizard = new ConnectFriendWizard; connectFriendWizard->setAttribute(Qt::WA_DeleteOnClose, true); connectFriendWizard->setGpgId(mGpgId, true); - connectFriendWizard->show();*/ + connectFriendWizard->show(); } + void SecurityItem::peerDetails() { #ifdef DEBUG_ITEM