mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-22 05:14:31 -04:00
added copy-rs-link to SubFileItem (Patch from Phenom)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6887 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e0863194a3
commit
f3750d0d61
3 changed files with 50 additions and 7 deletions
|
@ -29,6 +29,7 @@
|
|||
#include <gui/common/RsUrlHandler.h>
|
||||
#include <retroshare/rsfiles.h>
|
||||
#include "util/misc.h"
|
||||
#include "gui/RetroShareLink.h"
|
||||
|
||||
|
||||
/****
|
||||
|
@ -98,6 +99,7 @@ void SubFileItem::Setup()
|
|||
connect( playButton, SIGNAL( clicked( void ) ), this, SLOT( play ( void ) ) );
|
||||
connect( downloadButton, SIGNAL( clicked( void ) ), this, SLOT( download ( void ) ) );
|
||||
connect( cancelButton, SIGNAL( clicked( void ) ), this, SLOT( cancel ( void ) ) );
|
||||
connect( copyLinkButton, SIGNAL( clicked( void ) ), this, SLOT( copyLink ( void ) ) );
|
||||
connect( saveButton, SIGNAL( clicked( void ) ), this, SLOT( save ( void ) ) );
|
||||
|
||||
/* once off check - if remote, check if we have it
|
||||
|
@ -686,9 +688,23 @@ bool SubFileItem::isPlayable(bool &startable)
|
|||
return visible;
|
||||
}
|
||||
|
||||
void SubFileItem::mediatype()
|
||||
{
|
||||
/* check if the file is not a media file and change text */
|
||||
playButton->setText(tr("Open"));
|
||||
playButton->setToolTip(tr("Open File"));
|
||||
}
|
||||
void SubFileItem::mediatype()
|
||||
{
|
||||
/* check if the file is not a media file and change text */
|
||||
playButton->setText(tr("Open"));
|
||||
playButton->setToolTip(tr("Open File"));
|
||||
}
|
||||
|
||||
void SubFileItem::copyLink()
|
||||
{
|
||||
if (mFileName.empty() || mFileHash.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
RetroShareLink link;
|
||||
if (link.createFile(QString::fromUtf8(mFileName.c_str()), mFileSize, QString::fromStdString(mFileHash))) {
|
||||
QList<RetroShareLink> urls;
|
||||
urls.push_back(link);
|
||||
RSLinkClipboard::copyLinks(urls);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue