mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-09 19:38:45 -05:00
Added to get view the attached Pulse images
This commit is contained in:
parent
a177d456a1
commit
daa724151b
@ -101,3 +101,8 @@ void PhotoView::copyMessageLink()
|
|||||||
QMessageBox::information(NULL,tr("information"),tr("The Retrohare link was copied to your clipboard.")) ;
|
QMessageBox::information(NULL,tr("information"),tr("The Retrohare link was copied to your clipboard.")) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PhotoView::setGroupNameString(const QString& name)
|
||||||
|
{
|
||||||
|
ui->nameLabel->setText("@" + name);
|
||||||
|
}
|
||||||
|
@ -48,6 +48,7 @@ public slots:
|
|||||||
void setTime(const QString& text);
|
void setTime(const QString& text);
|
||||||
void setGroupId(const RsGxsGroupId &groupId);
|
void setGroupId(const RsGxsGroupId &groupId);
|
||||||
void setMessageId(const RsGxsMessageId& messageId);
|
void setMessageId(const RsGxsMessageId& messageId);
|
||||||
|
void setGroupNameString(const QString& name);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void copyMessageLink();
|
void copyMessageLink();
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
#include "PulseMessage.h"
|
#include "PulseMessage.h"
|
||||||
|
#include "gui/Posted/PhotoView.h"
|
||||||
|
#include "util/misc.h"
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
|
|
||||||
@ -26,6 +28,11 @@ PulseMessage::PulseMessage(QWidget *parent)
|
|||||||
:QWidget(parent)
|
:QWidget(parent)
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
|
connect(label_image1, SIGNAL(clicked()), this, SLOT(viewPicture()));
|
||||||
|
connect(label_image2, SIGNAL(clicked()), this, SLOT(viewPicture()));
|
||||||
|
connect(label_image3, SIGNAL(clicked()), this, SLOT(viewPicture()));
|
||||||
|
connect(label_image4, SIGNAL(clicked()), this, SLOT(viewPicture()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PulseMessage::setup(RsWirePulseSPtr pulse)
|
void PulseMessage::setup(RsWirePulseSPtr pulse)
|
||||||
@ -34,6 +41,8 @@ void PulseMessage::setup(RsWirePulseSPtr pulse)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mPulse = pulse;
|
||||||
|
|
||||||
setMessage(QString::fromStdString(pulse->mPulseText));
|
setMessage(QString::fromStdString(pulse->mPulseText));
|
||||||
|
|
||||||
// show indent if republish (both RESPONSE or REF)
|
// show indent if republish (both RESPONSE or REF)
|
||||||
@ -139,3 +148,46 @@ void PulseMessage::setRefImageCount(uint32_t count)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PulseMessage::viewPicture()
|
||||||
|
{
|
||||||
|
PhotoView *photoView = new PhotoView(this);
|
||||||
|
|
||||||
|
if (!mPulse->mImage1.empty()) {
|
||||||
|
// install image.
|
||||||
|
QPixmap pixmap;
|
||||||
|
pixmap.loadFromData(mPulse->mImage1.mData, mPulse->mImage1.mSize);
|
||||||
|
photoView->setPixmap(pixmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mPulse->mImage2.empty()) {
|
||||||
|
// install image.
|
||||||
|
QPixmap pixmap;
|
||||||
|
pixmap.loadFromData(mPulse->mImage2.mData, mPulse->mImage2.mSize);
|
||||||
|
photoView->setPixmap(pixmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mPulse->mImage3.empty()) {
|
||||||
|
// install image.
|
||||||
|
QPixmap pixmap;
|
||||||
|
pixmap.loadFromData(mPulse->mImage3.mData, mPulse->mImage3.mSize);
|
||||||
|
photoView->setPixmap(pixmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mPulse->mImage4.empty()) {
|
||||||
|
// install image.
|
||||||
|
QPixmap pixmap;
|
||||||
|
pixmap.loadFromData(mPulse->mImage4.mData, mPulse->mImage4.mSize);
|
||||||
|
photoView->setPixmap(pixmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString timestamp = misc::timeRelativeToNow(mPulse->mRefPublishTs);
|
||||||
|
|
||||||
|
photoView->setTitle(QString::fromStdString(mPulse->mPulseText));
|
||||||
|
photoView->setGroupNameString(QString::fromStdString(mPulse->mRefGroupName));
|
||||||
|
photoView->setTime(timestamp);
|
||||||
|
//photoView->setGroupId(mPulse->mRefGroupId);
|
||||||
|
|
||||||
|
photoView->show();
|
||||||
|
|
||||||
|
/* window will destroy itself! */
|
||||||
|
}
|
||||||
|
@ -35,6 +35,13 @@ public:
|
|||||||
void setup(RsWirePulseSPtr pulse);
|
void setup(RsWirePulseSPtr pulse);
|
||||||
void setMessage(QString msg);
|
void setMessage(QString msg);
|
||||||
void setRefImageCount(uint32_t count);
|
void setRefImageCount(uint32_t count);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void viewPicture();
|
||||||
|
|
||||||
|
private:
|
||||||
|
RsWirePulseSPtr mPulse;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -68,13 +68,16 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_image1">
|
<widget class="ClickableLabel" name="label_image1">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>128</width>
|
<width>128</width>
|
||||||
<height>128</height>
|
<height>128</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Click to view picture</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Image</string>
|
<string>Image</string>
|
||||||
</property>
|
</property>
|
||||||
@ -84,13 +87,16 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QLabel" name="label_image2">
|
<widget class="ClickableLabel" name="label_image2">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>128</width>
|
<width>128</width>
|
||||||
<height>128</height>
|
<height>128</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Click to view picture</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Image</string>
|
<string>Image</string>
|
||||||
</property>
|
</property>
|
||||||
@ -100,13 +106,16 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_image3">
|
<widget class="ClickableLabel" name="label_image3">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>128</width>
|
<width>128</width>
|
||||||
<height>128</height>
|
<height>128</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Click to view picture</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Image</string>
|
<string>Image</string>
|
||||||
</property>
|
</property>
|
||||||
@ -116,13 +125,16 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QLabel" name="label_image4">
|
<widget class="ClickableLabel" name="label_image4">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>128</width>
|
<width>128</width>
|
||||||
<height>128</height>
|
<height>128</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Click to view picture</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Image</string>
|
<string>Image</string>
|
||||||
</property>
|
</property>
|
||||||
@ -136,6 +148,13 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>ClickableLabel</class>
|
||||||
|
<extends>QLabel</extends>
|
||||||
|
<header>util/ClickableLabel.h</header>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user