mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-13 16:39:43 -05:00
Fixed picture show
This commit is contained in:
parent
9442d87644
commit
dcc4242ae6
@ -29,10 +29,10 @@ PulseMessage::PulseMessage(QWidget *parent)
|
|||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
connect(label_image1, SIGNAL(clicked()), this, SLOT(viewPicture()));
|
connect(label_image1, SIGNAL(clicked()), this, SLOT(viewPictureOne()));
|
||||||
connect(label_image2, SIGNAL(clicked()), this, SLOT(viewPicture()));
|
connect(label_image2, SIGNAL(clicked()), this, SLOT(viewPictureTwo()));
|
||||||
connect(label_image3, SIGNAL(clicked()), this, SLOT(viewPicture()));
|
connect(label_image3, SIGNAL(clicked()), this, SLOT(viewPictureThree()));
|
||||||
connect(label_image4, SIGNAL(clicked()), this, SLOT(viewPicture()));
|
connect(label_image4, SIGNAL(clicked()), this, SLOT(viewPictureFour()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PulseMessage::setup(RsWirePulseSPtr pulse)
|
void PulseMessage::setup(RsWirePulseSPtr pulse)
|
||||||
@ -148,7 +148,7 @@ void PulseMessage::setRefImageCount(uint32_t count)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PulseMessage::viewPicture()
|
void PulseMessage::viewPictureOne()
|
||||||
{
|
{
|
||||||
PhotoView *photoView = new PhotoView(this);
|
PhotoView *photoView = new PhotoView(this);
|
||||||
|
|
||||||
@ -158,21 +158,69 @@ void PulseMessage::viewPicture()
|
|||||||
pixmap.loadFromData(mPulse->mImage1.mData, mPulse->mImage1.mSize);
|
pixmap.loadFromData(mPulse->mImage1.mData, mPulse->mImage1.mSize);
|
||||||
photoView->setPixmap(pixmap);
|
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! */
|
||||||
|
}
|
||||||
|
|
||||||
|
void PulseMessage::viewPictureTwo()
|
||||||
|
{
|
||||||
|
PhotoView *photoView = new PhotoView(this);
|
||||||
|
|
||||||
if (!mPulse->mImage2.empty()) {
|
if (!mPulse->mImage2.empty()) {
|
||||||
// install image.
|
// install image.
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
pixmap.loadFromData(mPulse->mImage2.mData, mPulse->mImage2.mSize);
|
pixmap.loadFromData(mPulse->mImage2.mData, mPulse->mImage2.mSize);
|
||||||
photoView->setPixmap(pixmap);
|
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! */
|
||||||
|
}
|
||||||
|
|
||||||
|
void PulseMessage::viewPictureThree()
|
||||||
|
{
|
||||||
|
PhotoView *photoView = new PhotoView(this);
|
||||||
|
|
||||||
if (!mPulse->mImage3.empty()) {
|
if (!mPulse->mImage3.empty()) {
|
||||||
// install image.
|
// install image.
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
pixmap.loadFromData(mPulse->mImage3.mData, mPulse->mImage3.mSize);
|
pixmap.loadFromData(mPulse->mImage3.mData, mPulse->mImage3.mSize);
|
||||||
photoView->setPixmap(pixmap);
|
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! */
|
||||||
|
}
|
||||||
|
|
||||||
|
void PulseMessage::viewPictureFour()
|
||||||
|
{
|
||||||
|
PhotoView *photoView = new PhotoView(this);
|
||||||
|
|
||||||
if (!mPulse->mImage4.empty()) {
|
if (!mPulse->mImage4.empty()) {
|
||||||
// install image.
|
// install image.
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
|
@ -37,7 +37,10 @@ public:
|
|||||||
void setRefImageCount(uint32_t count);
|
void setRefImageCount(uint32_t count);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void viewPicture();
|
void viewPictureOne();
|
||||||
|
void viewPictureTwo();
|
||||||
|
void viewPictureThree();
|
||||||
|
void viewPictureFour();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RsWirePulseSPtr mPulse;
|
RsWirePulseSPtr mPulse;
|
||||||
|
Loading…
Reference in New Issue
Block a user