PeersDialog/MessengerWindow:

- send recommended friend as message
- paste recommended friends as "retroshare://person|..." from clipboard

reworked retroshare link handling
- added new type -> retroshare://person|<name>|<hash>
- added processing of links to RetroShareLink and RSLinkClipboard and removed all processing in anchorClicked of QTextBrowser 
- fixed parseClipboard to handle all found links in clipboard
- disabled the processing of the clickable links (RetroShareLink::processUrl), because QUrl can't handle the RetroShare links properly

removed memory leaks of the QAction in some context menus


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3292 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-07-15 11:25:34 +00:00
parent 3291e61291
commit daf0ea50ee
21 changed files with 712 additions and 525 deletions

View file

@ -227,23 +227,23 @@ void SearchDialog::searchtableWidgetCostumPopupMenu( QPoint point )
// block the popup if no results available
if ((ui.searchResultWidget->selectedItems()).size() == 0) return;
downloadAct = new QAction(QIcon(IMAGE_START), tr( "Download" ), this );
QMenu contextMnu(this);
QAction* downloadAct = new QAction(QIcon(IMAGE_START), tr( "Download" ), &contextMnu );
connect( downloadAct , SIGNAL( triggered() ), this, SLOT( download() ) );
copysearchlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), this );
QAction* copysearchlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), &contextMnu );
connect( copysearchlinkAct , SIGNAL( triggered() ), this, SLOT( copysearchLink() ) );
sendrslinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Link" ), this );
QAction* sendrslinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Link" ), &contextMnu );
connect( sendrslinkAct , SIGNAL( triggered() ), this, SLOT( sendLinkTo( ) ) );
broadcastonchannelAct = new QAction( tr( "Broadcast on Channel" ), this );
QAction* broadcastonchannelAct = new QAction( tr( "Broadcast on Channel" ), &contextMnu );
connect( broadcastonchannelAct , SIGNAL( triggered() ), this, SLOT( broadcastonchannel() ) );
recommendtofriendsAct = new QAction( tr( "Recommend to Friends" ), this );
QAction* recommendtofriendsAct = new QAction( tr( "Recommend to Friends" ), &contextMnu );
connect( recommendtofriendsAct , SIGNAL( triggered() ), this, SLOT( recommendtofriends() ) );
QMenu contextMnu(this);
contextMnu.addAction( downloadAct);
contextMnu.addSeparator();
@ -377,15 +377,15 @@ void SearchDialog::searchtableWidget2CostumPopupMenu( QPoint point )
// block the popup if no results available
if ((ui.searchSummaryWidget->selectedItems()).size() == 0) return;
QMenu contextMnu(this);
// create the menu as required
searchRemoveAct = new QAction(QIcon(IMAGE_REMOVE), tr( "Remove" ), this );
QAction* searchRemoveAct = new QAction(QIcon(IMAGE_REMOVE), tr( "Remove" ), &contextMnu );
connect( searchRemoveAct , SIGNAL( triggered() ), this, SLOT( searchRemove() ) );
searchRemoveAllAct = new QAction(QIcon(IMAGE_REMOVEALL), tr( "Remove All" ), this );
QAction* searchRemoveAllAct = new QAction(QIcon(IMAGE_REMOVEALL), tr( "Remove All" ), &contextMnu );
connect( searchRemoveAllAct , SIGNAL( triggered() ), this, SLOT( searchRemoveAll() ) );
QMenu contextMnu(this);
contextMnu.addAction( searchRemoveAct);
contextMnu.addAction( searchRemoveAllAct);
@ -1201,7 +1201,7 @@ void SearchDialog::copysearchLink()
RetroShareLink link(fname, fsize, fhash);
std::cerr << "new link added to clipboard: " << link.toString().toStdString() << std::endl ;
if(link.valid())
if(link.valid() && link.type() == RetroShareLink::TYPE_FILE)
urls.push_back(link) ;
}
}