add a popup when file link is clicked, and a test if a file link is malformed

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1183 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2009-05-07 16:07:43 +00:00
parent aa0c678d67
commit dfad69de9f

View File

@ -94,7 +94,7 @@ PopupChatDialog::PopupChatDialog(std::string id, std::string name,
// Create the status bar // Create the status bar
resetStatusBar() ; resetStatusBar() ;
ui.textBrowser->setOpenExternalLinks ( false ); ui.textBrowser->setOpenExternalLinks ( true );
ui.textBrowser->setOpenLinks ( false ); ui.textBrowser->setOpenLinks ( false );
QString title = QString::fromStdString(name) + " :" + tr(" RetroShare - Encrypted Chat") ; QString title = QString::fromStdString(name) + " :" + tr(" RetroShare - Encrypted Chat") ;
@ -777,7 +777,19 @@ void PopupChatDialog::anchorClicked (const QUrl& link ) {
std::cerr << "PopupChatDialog::anchorClicked FileRequest : fileName : " << fileName << ". fileHash : " << fileHash << ". fileSize : " << fileSize; std::cerr << "PopupChatDialog::anchorClicked FileRequest : fileName : " << fileName << ". fileHash : " << fileHash << ". fileSize : " << fileSize;
std::cerr << ". source id : " << dialogId << std::endl; std::cerr << ". source id : " << dialogId << std::endl;
#endif #endif
std::list<std::string> srcIds; if (fileName != "" &&
srcIds.push_front(dialogId); fileHash != "") {
rsFiles->FileRequest(fileName, fileHash, fileSize, "", 0, srcIds); std::list<std::string> srcIds;
srcIds.push_front(dialogId);
rsFiles->FileRequest(fileName, fileHash, fileSize, "", 0, srcIds);
QMessageBox mb(tr("File Request Confirmation"), tr("The file has been added to your download list."),QMessageBox::Information,QMessageBox::Ok,0,0);
mb.setButtonText( QMessageBox::Ok, "OK" );
mb.exec();
} else {
QMessageBox mb(tr("File Request Error"), tr("The file link is malformed."),QMessageBox::Information,QMessageBox::Ok,0,0);
mb.setButtonText( QMessageBox::Ok, "OK" );
mb.exec();
}
} }