mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-09-21 21:34:52 -04:00
Revert "Changes to the .pro file for the newly made files."
This reverts commit 3cc077ff38
.
This commit adds the new files to the .pro file.
This commit is contained in:
parent
680c1942df
commit
59c6eabad9
4 changed files with 105 additions and 62 deletions
|
@ -1,3 +1,23 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* gui/TheWire/CustomFrame.cpp *
|
||||||
|
* *
|
||||||
|
* Copyright (c) 2012-2020 Robert Fernie <retroshare.project@gmail.com> *
|
||||||
|
* *
|
||||||
|
* This program is free software: you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU Affero General Public License as *
|
||||||
|
* published by the Free Software Foundation, either version 3 of the *
|
||||||
|
* License, or (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU Affero General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU Affero General Public License *
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
||||||
|
* *
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
#include "CustomFrame.h"
|
#include "CustomFrame.h"
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,23 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* gui/TheWire/CustomFrame.h *
|
||||||
|
* *
|
||||||
|
* Copyright (c) 2012-2020 Robert Fernie <retroshare.project@gmail.com> *
|
||||||
|
* *
|
||||||
|
* This program is free software: you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU Affero General Public License as *
|
||||||
|
* published by the Free Software Foundation, either version 3 of the *
|
||||||
|
* License, or (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU Affero General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU Affero General Public License *
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
||||||
|
* *
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
#ifndef CUSTOMFRAMEH_H
|
#ifndef CUSTOMFRAMEH_H
|
||||||
#define CUSTOMFRAMEH_H
|
#define CUSTOMFRAMEH_H
|
||||||
|
|
||||||
|
|
|
@ -37,21 +37,21 @@ Q_DECLARE_METATYPE(RsWireGroup)
|
||||||
PulseViewGroup::PulseViewGroup(PulseViewHolder *holder, RsWireGroupSPtr group)
|
PulseViewGroup::PulseViewGroup(PulseViewHolder *holder, RsWireGroupSPtr group)
|
||||||
:PulseViewItem(holder), mGroup(group)
|
:PulseViewItem(holder), mGroup(group)
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||||
setup();
|
setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PulseViewGroup::setup()
|
void PulseViewGroup::setup()
|
||||||
{
|
{
|
||||||
if (mGroup) {
|
if (mGroup) {
|
||||||
connect(followButton, SIGNAL(clicked()), this, SLOT(actionFollow()));
|
connect(followButton, SIGNAL(clicked()), this, SLOT(actionFollow()));
|
||||||
|
|
||||||
label_groupName->setText("@" + QString::fromStdString(mGroup->mMeta.mGroupName));
|
label_groupName->setText("@" + QString::fromStdString(mGroup->mMeta.mGroupName));
|
||||||
label_authorName->setText(BoldString(QString::fromStdString(mGroup->mMeta.mAuthorId.toStdString())));
|
label_authorName->setText(BoldString(QString::fromStdString(mGroup->mMeta.mAuthorId.toStdString())));
|
||||||
label_date->setText(DateTime::formatDateTime(mGroup->mMeta.mPublishTs));
|
label_date->setText(DateTime::formatDateTime(mGroup->mMeta.mPublishTs));
|
||||||
label_tagline->setText(QString::fromStdString(mGroup->mTagline));
|
label_tagline->setText(QString::fromStdString(mGroup->mTagline));
|
||||||
label_location->setText(QString::fromStdString(mGroup->mLocation));
|
label_location->setText(QString::fromStdString(mGroup->mLocation));
|
||||||
|
|
||||||
|
|
||||||
if (mGroup->mMasthead.mData)
|
if (mGroup->mMasthead.mData)
|
||||||
|
@ -65,72 +65,73 @@ void PulseViewGroup::setup()
|
||||||
QSize frameSize = frame_masthead->size();
|
QSize frameSize = frame_masthead->size();
|
||||||
|
|
||||||
// Scale the pixmap based on the frame size
|
// Scale the pixmap based on the frame size
|
||||||
pixmap = pixmap.scaled(frameSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
pixmap = pixmap.scaledToWidth(frameSize.width(), Qt::SmoothTransformation);
|
||||||
frame_masthead->setPixmap(pixmap);
|
frame_masthead->setPixmap(pixmap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Uncomment the below code for default background
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// // Default pixmap
|
||||||
|
// QPixmap pixmap = FilesDefs::getPixmapFromQtResourcePath(":/icons/png/posted.png");
|
||||||
|
// QSize frameSize = frame_masthead->size();
|
||||||
|
|
||||||
|
// // Scale the pixmap based on the frame size
|
||||||
|
// pixmap = pixmap.scaled(frameSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
|
// frame_masthead->setPixmap(pixmap);
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (mGroup->mHeadshot.mData)
|
||||||
|
{
|
||||||
|
QPixmap pixmap;
|
||||||
|
if (GxsIdDetails::loadPixmapFromData(
|
||||||
|
mGroup->mHeadshot.mData,
|
||||||
|
mGroup->mHeadshot.mSize,
|
||||||
|
pixmap,GxsIdDetails::ORIGINAL))
|
||||||
|
{
|
||||||
|
pixmap = pixmap.scaled(100,100);
|
||||||
|
label_headshot->setPixmap(pixmap);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Default pixmap
|
|
||||||
QPixmap pixmap = FilesDefs::getPixmapFromQtResourcePath(":/icons/png/posted.png");
|
|
||||||
QSize frameSize = frame_masthead->size();
|
|
||||||
|
|
||||||
// Scale the pixmap based on the frame size
|
|
||||||
pixmap = pixmap.scaled(frameSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
|
||||||
frame_masthead->setPixmap(pixmap);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mGroup->mHeadshot.mData)
|
|
||||||
{
|
|
||||||
QPixmap pixmap;
|
|
||||||
if (GxsIdDetails::loadPixmapFromData(
|
|
||||||
mGroup->mHeadshot.mData,
|
|
||||||
mGroup->mHeadshot.mSize,
|
|
||||||
pixmap,GxsIdDetails::ORIGINAL))
|
|
||||||
{
|
|
||||||
pixmap = pixmap.scaled(100,100);
|
|
||||||
label_headshot->setPixmap(pixmap);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// default.
|
// default.
|
||||||
QPixmap pixmap = FilesDefs::getPixmapFromQtResourcePath(":/icons/png/posted.png").scaled(100,100);
|
QPixmap pixmap = FilesDefs::getPixmapFromQtResourcePath(":/icons/png/posted.png").scaled(100,100);
|
||||||
label_headshot->setPixmap(pixmap);
|
label_headshot->setPixmap(pixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mGroup->mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED)
|
if (mGroup->mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED)
|
||||||
{
|
{
|
||||||
uint32_t pulses = mGroup->mGroupPulses + mGroup->mGroupReplies;
|
uint32_t pulses = mGroup->mGroupPulses + mGroup->mGroupReplies;
|
||||||
uint32_t replies = mGroup->mRefReplies;
|
uint32_t replies = mGroup->mRefReplies;
|
||||||
uint32_t republishes = mGroup->mRefRepublishes;
|
uint32_t republishes = mGroup->mRefRepublishes;
|
||||||
uint32_t likes = mGroup->mRefLikes;
|
uint32_t likes = mGroup->mRefLikes;
|
||||||
|
|
||||||
label_extra_pulses->setText(BoldString(ToNumberUnits(pulses)));
|
label_extra_pulses->setText(BoldString(ToNumberUnits(pulses)));
|
||||||
label_extra_replies->setText(BoldString(ToNumberUnits(replies)));
|
label_extra_replies->setText(BoldString(ToNumberUnits(replies)));
|
||||||
label_extra_republishes->setText(BoldString(ToNumberUnits(republishes)));
|
label_extra_republishes->setText(BoldString(ToNumberUnits(republishes)));
|
||||||
label_extra_likes->setText(BoldString(ToNumberUnits(likes)));
|
label_extra_likes->setText(BoldString(ToNumberUnits(likes)));
|
||||||
|
|
||||||
// hide follow.
|
// hide follow.
|
||||||
widget_actions->setVisible(false);
|
widget_actions->setVisible(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// hide stats.
|
// hide stats.
|
||||||
widget_replies->setVisible(false);
|
widget_replies->setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PulseViewGroup::actionFollow()
|
void PulseViewGroup::actionFollow()
|
||||||
{
|
{
|
||||||
RsGxsGroupId groupId = mGroup->mMeta.mGroupId;
|
RsGxsGroupId groupId = mGroup->mMeta.mGroupId;
|
||||||
std::cerr << "PulseViewGroup::actionFollow() following ";
|
std::cerr << "PulseViewGroup::actionFollow() following ";
|
||||||
std::cerr << groupId;
|
std::cerr << groupId;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
if (mHolder) {
|
if (mHolder) {
|
||||||
mHolder->PVHfollow(groupId);
|
mHolder->PVHfollow(groupId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1220,6 +1220,7 @@ gxsthewire {
|
||||||
gui/TheWire/PulseReply.h \
|
gui/TheWire/PulseReply.h \
|
||||||
gui/TheWire/PulseReplySeperator.h \
|
gui/TheWire/PulseReplySeperator.h \
|
||||||
gui/TheWire/PulseMessage.h \
|
gui/TheWire/PulseMessage.h \
|
||||||
|
gui/TheWire/CustomFrame.h \
|
||||||
|
|
||||||
FORMS += gui/TheWire/WireDialog.ui \
|
FORMS += gui/TheWire/WireDialog.ui \
|
||||||
gui/TheWire/WireGroupItem.ui \
|
gui/TheWire/WireGroupItem.ui \
|
||||||
|
@ -1242,6 +1243,7 @@ gxsthewire {
|
||||||
gui/TheWire/PulseReply.cpp \
|
gui/TheWire/PulseReply.cpp \
|
||||||
gui/TheWire/PulseReplySeperator.cpp \
|
gui/TheWire/PulseReplySeperator.cpp \
|
||||||
gui/TheWire/PulseMessage.cpp \
|
gui/TheWire/PulseMessage.cpp \
|
||||||
|
gui/TheWire/CustomFrame.cpp \
|
||||||
|
|
||||||
RESOURCES += gui/TheWire/TheWire_images.qrc
|
RESOURCES += gui/TheWire/TheWire_images.qrc
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue