mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-04 23:25:32 -04:00
added paste multiple links
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2516 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ff0b797248
commit
0705d9dfc7
7 changed files with 74 additions and 75 deletions
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include <gui/settings/rsharesettings.h>
|
||||
|
||||
#include <gui/RetroShareLink.h>
|
||||
#include <QtGui>
|
||||
#include <QFileDialog>
|
||||
#include <QString>
|
||||
|
@ -414,21 +415,14 @@ void CreateForumMsg::fileHashingFinished(AttachFileItem* file) {
|
|||
|
||||
void CreateForumMsg::pasteLink()
|
||||
{
|
||||
|
||||
QString link = QApplication::clipboard()->text();
|
||||
|
||||
if (link.startsWith("retroshare://", Qt::CaseInsensitive))
|
||||
{
|
||||
ui.forumMessage->setHtml("<a href='" + link + "'> " + link + "</a>");
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::warning(this, tr("RetroShare"),tr("Clipboard does not contains RetroShare link('s)"),
|
||||
QMessageBox::Ok, QMessageBox::Ok);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
QList<QUrl> list = QApplication::clipboard()->mimeData()->urls();
|
||||
|
||||
for(QList<QUrl>::const_iterator it(list.begin());it!=list.end();++it)
|
||||
{
|
||||
RetroShareLink link(*it) ;
|
||||
|
||||
if(link.valid())
|
||||
ui.forumMessage->insertHtml("<a href='" + link.toString() + "'> " + link.toString() + "</a> <br>") ;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue