mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-22 14:15:08 -05:00
changed link scheme to retroshare:// for forums
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2039 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9a8f693f3d
commit
0b8cb7b287
@ -93,7 +93,7 @@ ForumsDialog::ForumsDialog(QWidget *parent)
|
|||||||
|
|
||||||
connect( ui.threadTreeWidget, SIGNAL( itemSelectionChanged() ), this, SLOT( changedThread2() ) );
|
connect( ui.threadTreeWidget, SIGNAL( itemSelectionChanged() ), this, SLOT( changedThread2() ) );
|
||||||
connect( ui.viewBox, SIGNAL( currentIndexChanged ( int ) ), this, SLOT( insertThreads() ) );
|
connect( ui.viewBox, SIGNAL( currentIndexChanged ( int ) ), this, SLOT( insertThreads() ) );
|
||||||
connect(ui.postText, SIGNAL( anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &)));
|
connect( ui.postText, SIGNAL( anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &)));
|
||||||
|
|
||||||
|
|
||||||
connect(ui.expandButton, SIGNAL(clicked()), this, SLOT(togglefileview()));
|
connect(ui.expandButton, SIGNAL(clicked()), this, SLOT(togglefileview()));
|
||||||
@ -127,6 +127,9 @@ ForumsDialog::ForumsDialog(QWidget *parent)
|
|||||||
forummenu->addSeparator();
|
forummenu->addSeparator();
|
||||||
ui.forumpushButton->setMenu(forummenu);
|
ui.forumpushButton->setMenu(forummenu);
|
||||||
|
|
||||||
|
ui.postText->setOpenExternalLinks ( false );
|
||||||
|
ui.postText->setOpenLinks ( false );
|
||||||
|
|
||||||
|
|
||||||
/* Hide platform specific features */
|
/* Hide platform specific features */
|
||||||
#ifdef Q_WS_WIN
|
#ifdef Q_WS_WIN
|
||||||
@ -1073,7 +1076,7 @@ void ForumsDialog::anchorClicked (const QUrl& link )
|
|||||||
std::cerr << "ForumsDialog::anchorClicked link.scheme() : " << link.scheme().toStdString() << std::endl;
|
std::cerr << "ForumsDialog::anchorClicked link.scheme() : " << link.scheme().toStdString() << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (link.scheme() == "file") {
|
if (link.scheme() == "retroshare://") {
|
||||||
std::string fileName = link.queryItemValue(QString("fileName")).toStdString();
|
std::string fileName = link.queryItemValue(QString("fileName")).toStdString();
|
||||||
std::string fileHash = link.queryItemValue(QString("fileHash")).toStdString();
|
std::string fileHash = link.queryItemValue(QString("fileHash")).toStdString();
|
||||||
uint32_t fileSize = link.queryItemValue(QString("fileSize")).toInt();
|
uint32_t fileSize = link.queryItemValue(QString("fileSize")).toInt();
|
||||||
@ -1086,7 +1089,7 @@ void ForumsDialog::anchorClicked (const QUrl& link )
|
|||||||
if (fileName != "" && fileHash != "") {
|
if (fileName != "" && fileHash != "") {
|
||||||
|
|
||||||
std::list<std::string> srcIds;
|
std::list<std::string> srcIds;
|
||||||
//srcIds.push_front(dialogId);
|
//srcIds.push_front();
|
||||||
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);
|
QMessageBox mb(tr("File Request Confirmation"), tr("The file has been added to your download list."),QMessageBox::Information,QMessageBox::Ok,0,0);
|
||||||
|
@ -350,8 +350,8 @@ void CreateForumMsg::fileHashingFinished(SubFileItem* file) {
|
|||||||
sprintf(fileSizeChar, "%lld", file->FileSize());
|
sprintf(fileSizeChar, "%lld", file->FileSize());
|
||||||
std::string fileSize = *(&fileSizeChar);
|
std::string fileSize = *(&fileSizeChar);
|
||||||
|
|
||||||
std::string mesgString = "<a href='file:?fileHash=" + (file->FileHash()) + "&fileName=" + (file->FileName()) + "&fileSize=" + fileSize + "'>"
|
std::string mesgString = "<a href='retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "'>"
|
||||||
+ "file:?fileHash=" + (file->FileHash()) + "&fileName=" + (file->FileName()) + "&fileSize=" + fileSize + "</a>";
|
+ "retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "</a>";
|
||||||
#ifdef CHAT_DEBUG
|
#ifdef CHAT_DEBUG
|
||||||
std::cerr << "CreateForumMsg::anchorClicked mesgString : " << mesgString << std::endl;
|
std::cerr << "CreateForumMsg::anchorClicked mesgString : " << mesgString << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user