diff --git a/retroshare-gui/src/gui/NetworkDialog.cpp b/retroshare-gui/src/gui/NetworkDialog.cpp index 512ea9c1c..5a529e5d1 100644 --- a/retroshare-gui/src/gui/NetworkDialog.cpp +++ b/retroshare-gui/src/gui/NetworkDialog.cpp @@ -153,18 +153,33 @@ void NetworkDialog::connecttreeWidgetCostumPopupMenu( QPoint point ) } else { - peerdetailsAct = new QAction(QIcon(IMAGE_PEERDETAILS), tr( "Make Friend / Peer Details" ), this ); + makefriendAct = new QAction(QIcon(IMAGE_PEERDETAILS), tr( "Make Friend" ), this ); + connect( makefriendAct , SIGNAL( triggered() ), this, SLOT( makeFriend() ) ); + contextMnu.addAction( makefriendAct); + + peerdetailsAct = new QAction(QIcon(IMAGE_PEERDETAILS), tr( "Peer Details..." ), this ); connect( peerdetailsAct , SIGNAL( triggered() ), this, SLOT( peerdetails() ) ); contextMnu.addAction( peerdetailsAct); - loadcertAct = new QAction(QIcon(IMAGE_LOADCERT), tr( "Load Certificate" ), this ); - connect( loadcertAct , SIGNAL( triggered() ), this, SLOT( loadneighbour() ) ); - contextMnu.addAction( loadcertAct); +// loadcertAct = new QAction(QIcon(IMAGE_LOADCERT), tr( "Load Certificate" ), this ); +// connect( loadcertAct , SIGNAL( triggered() ), this, SLOT( loadneighbour() ) ); +// contextMnu.addAction( loadcertAct); } contextMnu.exec( mevent->globalPos() ); } +void NetworkDialog::makeFriend() +{ + QTreeWidgetItem *wi = getCurrentNeighbour(); + std::string authId = wi->text(9).toStdString() ; + + rsPeers->AuthCertificate(authId, ""); + rsPeers->addFriend(authId); + + insertConnect() ; +} + /** Shows Peer Information/Auth Dialog */ void NetworkDialog::peerdetails() { diff --git a/retroshare-gui/src/gui/NetworkDialog.h b/retroshare-gui/src/gui/NetworkDialog.h index 64c9bdf59..044a1c437 100644 --- a/retroshare-gui/src/gui/NetworkDialog.h +++ b/retroshare-gui/src/gui/NetworkDialog.h @@ -53,6 +53,7 @@ public slots: private slots: + void makeFriend() ; void peerdetails(); /** Create the context popup menu and it's submenus */ void connecttreeWidgetCostumPopupMenu( QPoint point ); @@ -75,6 +76,7 @@ QTreeWidgetItem *getCurrentNeighbour(); QMenu* contextMnu; /** Defines the actions for the context menu */ QAction* peerdetailsAct; + QAction* makefriendAct; QAction* authAct; QAction* loadcertAct;