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

@ -405,8 +405,12 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
if(!items.empty())
contextMnu.addAction( copylinkAct);
if(!RSLinkClipboard::empty())
contextMnu.addAction( pastelinkAct);
if(!RSLinkClipboard::empty(RetroShareLink::TYPE_FILE)) {
pastelinkAct->setEnabled(true);
} else {
pastelinkAct->setDisabled(true);
}
contextMnu.addAction( pastelinkAct);
contextMnu.addSeparator();
@ -1123,12 +1127,7 @@ void TransfersDialog::updateDetailsDialog()
void TransfersDialog::pasteLink()
{
const std::vector<RetroShareLink>& links(RSLinkClipboard::pasteLinks()) ;
for(uint32_t i=0;i<links.size();++i)
if (links[i].valid())
if(!rsFiles->FileRequest(links[i].name().toStdString(), links[i].hash().toStdString(),links[i].size(), "", RS_FILE_HINTS_NETWORK_WIDE, std::list<std::string>()))
QMessageBox::critical(NULL,"Download refused","The file "+links[i].name()+" could not be downloaded. Do you already have it ?") ;
RSLinkClipboard::process(RetroShareLink::TYPE_FILE, RSLINK_PROCESS_NOTIFY_ERROR);
}
void TransfersDialog::getIdOfSelectedItems(std::set<QStandardItem *>& items)