mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-24 23:19:29 -05:00
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:
parent
aa0c678d67
commit
dfad69de9f
@ -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
|
||||||
|
if (fileName != "" &&
|
||||||
|
fileHash != "") {
|
||||||
std::list<std::string> srcIds;
|
std::list<std::string> srcIds;
|
||||||
srcIds.push_front(dialogId);
|
srcIds.push_front(dialogId);
|
||||||
rsFiles->FileRequest(fileName, fileHash, fileSize, "", 0, srcIds);
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user