mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-14 00:49:41 -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 <QMessageBox>
|
||||||
|
|
||||||
#include "gui/gxs/GxsIdDetails.h"
|
#include "gui/gxs/GxsIdDetails.h"
|
||||||
|
#include "gui/RetroShareLink.h"
|
||||||
|
|
||||||
#include <retroshare/rsidentity.h>
|
#include <retroshare/rsidentity.h>
|
||||||
|
#include <retroshare/rsposted.h>
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
PhotoView::PhotoView(QWidget *parent)
|
PhotoView::PhotoView(QWidget *parent)
|
||||||
@ -36,8 +39,8 @@ PhotoView::PhotoView(QWidget *parent)
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
|
|
||||||
ui->shareButton->hide();
|
connect(ui->shareButton, SIGNAL(clicked()), this, SLOT(copyMessageLink()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Destructor */
|
/** Destructor */
|
||||||
@ -78,3 +81,23 @@ void PhotoView::setTime(const QString& text)
|
|||||||
ui->timeLabel->setText(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 setTitle (const QString &text);
|
||||||
void setName(const RsGxsId& authorID);
|
void setName(const RsGxsId& authorID);
|
||||||
void setTime(const QString& text);
|
void setTime(const QString& text);
|
||||||
|
void setGroupId(const RsGxsGroupId &groupId);
|
||||||
|
void setMessageId(const RsGxsMessageId& messageId);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void copyMessageLink();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
RsGxsMessageId mMessageId;
|
||||||
|
RsGxsGroupId mGroupId;
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
Ui::PhotoView *ui;
|
Ui::PhotoView *ui;
|
||||||
|
@ -145,6 +145,19 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -160,6 +173,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="shareButton">
|
<widget class="QToolButton" name="shareButton">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Copy RetroShare link</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Share</string>
|
<string>Share</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -605,6 +605,8 @@ void PostedItem::viewPicture()
|
|||||||
PView->setTitle(messageName());
|
PView->setTitle(messageName());
|
||||||
PView->setName(authorID);
|
PView->setName(authorID);
|
||||||
PView->setTime(timestamp);
|
PView->setTime(timestamp);
|
||||||
|
PView->setGroupId(groupId());
|
||||||
|
PView->setMessageId(mMessageId);
|
||||||
|
|
||||||
PView->show();
|
PView->show();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user