mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 00:19:25 -05:00
get the share button usable for copy the rs link
This commit is contained in:
parent
ca60e1d094
commit
c1efdac7f6
@ -25,7 +25,10 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "gui/gxs/GxsIdDetails.h"
|
||||
#include "gui/RetroShareLink.h"
|
||||
|
||||
#include <retroshare/rsidentity.h>
|
||||
#include <retroshare/rsposted.h>
|
||||
|
||||
/** Constructor */
|
||||
PhotoView::PhotoView(QWidget *parent)
|
||||
@ -36,8 +39,8 @@ PhotoView::PhotoView(QWidget *parent)
|
||||
ui->setupUi(this);
|
||||
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
|
||||
ui->shareButton->hide();
|
||||
|
||||
connect(ui->shareButton, SIGNAL(clicked()), this, SLOT(copyMessageLink()));
|
||||
}
|
||||
|
||||
/** Destructor */
|
||||
@ -78,3 +81,23 @@ void PhotoView::setTime(const QString& text)
|
||||
ui->timeLabel->setText(text);
|
||||
}
|
||||
|
||||
void PhotoView::setGroupId(const RsGxsGroupId &groupId)
|
||||
{
|
||||
mGroupId = groupId;
|
||||
}
|
||||
|
||||
void PhotoView::setMessageId(const RsGxsMessageId& messageId)
|
||||
{
|
||||
mMessageId = messageId ;
|
||||
}
|
||||
|
||||
void PhotoView::copyMessageLink()
|
||||
{
|
||||
RetroShareLink link = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_POSTED, mGroupId, mMessageId, ui->titleLabel->text());
|
||||
|
||||
if (link.valid()) {
|
||||
QList<RetroShareLink> urls;
|
||||
urls.push_back(link);
|
||||
RSLinkClipboard::copyLinks(urls);
|
||||
}
|
||||
}
|
||||
|
@ -46,12 +46,15 @@ public slots:
|
||||
void setTitle (const QString &text);
|
||||
void setName(const RsGxsId& authorID);
|
||||
void setTime(const QString& text);
|
||||
void setGroupId(const RsGxsGroupId &groupId);
|
||||
void setMessageId(const RsGxsMessageId& messageId);
|
||||
|
||||
private slots:
|
||||
|
||||
void copyMessageLink();
|
||||
|
||||
private:
|
||||
|
||||
RsGxsMessageId mMessageId;
|
||||
RsGxsGroupId mGroupId;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::PhotoView *ui;
|
||||
|
@ -145,6 +145,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="agoLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MS Sans Serif</family>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>ago</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
@ -160,6 +173,9 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="shareButton">
|
||||
<property name="toolTip">
|
||||
<string>Copy RetroShare link</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Share</string>
|
||||
</property>
|
||||
|
@ -605,6 +605,8 @@ void PostedItem::viewPicture()
|
||||
PView->setTitle(messageName());
|
||||
PView->setName(authorID);
|
||||
PView->setTime(timestamp);
|
||||
PView->setGroupId(groupId());
|
||||
PView->setMessageId(mMessageId);
|
||||
|
||||
PView->show();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user