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
This commit is contained in:
csoler 2009-03-21 20:29:23 +00:00
parent 418478877a
commit 99baceae7e
2 changed files with 21 additions and 4 deletions

View File

@ -153,18 +153,33 @@ void NetworkDialog::connecttreeWidgetCostumPopupMenu( QPoint point )
} }
else 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() ) ); connect( peerdetailsAct , SIGNAL( triggered() ), this, SLOT( peerdetails() ) );
contextMnu.addAction( peerdetailsAct); contextMnu.addAction( peerdetailsAct);
loadcertAct = new QAction(QIcon(IMAGE_LOADCERT), tr( "Load Certificate" ), this ); // loadcertAct = new QAction(QIcon(IMAGE_LOADCERT), tr( "Load Certificate" ), this );
connect( loadcertAct , SIGNAL( triggered() ), this, SLOT( loadneighbour() ) ); // connect( loadcertAct , SIGNAL( triggered() ), this, SLOT( loadneighbour() ) );
contextMnu.addAction( loadcertAct); // contextMnu.addAction( loadcertAct);
} }
contextMnu.exec( mevent->globalPos() ); 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 */ /** Shows Peer Information/Auth Dialog */
void NetworkDialog::peerdetails() void NetworkDialog::peerdetails()
{ {

View File

@ -53,6 +53,7 @@ public slots:
private slots: private slots:
void makeFriend() ;
void peerdetails(); void peerdetails();
/** Create the context popup menu and it's submenus */ /** Create the context popup menu and it's submenus */
void connecttreeWidgetCostumPopupMenu( QPoint point ); void connecttreeWidgetCostumPopupMenu( QPoint point );
@ -75,6 +76,7 @@ QTreeWidgetItem *getCurrentNeighbour();
QMenu* contextMnu; QMenu* contextMnu;
/** Defines the actions for the context menu */ /** Defines the actions for the context menu */
QAction* peerdetailsAct; QAction* peerdetailsAct;
QAction* makefriendAct;
QAction* authAct; QAction* authAct;
QAction* loadcertAct; QAction* loadcertAct;