From 99baceae7e0fdc2645d6126e00a477afbadd0ad6 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 21 Mar 2009 20:29:23 +0000 Subject: [PATCH] added a direct make friend button in the drop down list of network dialog git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1093 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/NetworkDialog.cpp | 23 +++++++++++++++++++---- retroshare-gui/src/gui/NetworkDialog.h | 2 ++ 2 files changed, 21 insertions(+), 4 deletions(-) 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;