mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-26 17:51:26 -05: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
@ -29,6 +29,7 @@
|
|||||||
#include <gui/common/RsUrlHandler.h>
|
#include <gui/common/RsUrlHandler.h>
|
||||||
#include <retroshare/rsfiles.h>
|
#include <retroshare/rsfiles.h>
|
||||||
#include "util/misc.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( playButton, SIGNAL( clicked( void ) ), this, SLOT( play ( void ) ) );
|
||||||
connect( downloadButton, SIGNAL( clicked( void ) ), this, SLOT( download ( void ) ) );
|
connect( downloadButton, SIGNAL( clicked( void ) ), this, SLOT( download ( void ) ) );
|
||||||
connect( cancelButton, SIGNAL( clicked( void ) ), this, SLOT( cancel ( 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 ) ) );
|
connect( saveButton, SIGNAL( clicked( void ) ), this, SLOT( save ( void ) ) );
|
||||||
|
|
||||||
/* once off check - if remote, check if we have it
|
/* once off check - if remote, check if we have it
|
||||||
@ -692,3 +694,17 @@ void SubFileItem::mediatype()
|
|||||||
playButton->setText(tr("Open"));
|
playButton->setText(tr("Open"));
|
||||||
playButton->setToolTip(tr("Open File"));
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -77,6 +77,7 @@ public slots:
|
|||||||
void download();
|
void download();
|
||||||
void play();
|
void play();
|
||||||
void mediatype();
|
void mediatype();
|
||||||
|
void copyLink();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void toggle();
|
void toggle();
|
||||||
|
@ -159,6 +159,32 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="copyLinkButton">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>24</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Copy RetroShare Link</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../images.qrc">
|
||||||
|
<normaloff>:/images/copyrslink.png</normaloff>:/images/copyrslink.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="saveButton">
|
<widget class="QPushButton" name="saveButton">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user