From 59c6eabad9b0ee34d31c2b4b262fa4d17c041a96 Mon Sep 17 00:00:00 2001 From: PYRET1C <88980503+PYRET1C@users.noreply.github.com> Date: Sun, 2 Jul 2023 12:48:38 +0530 Subject: [PATCH] Revert "Changes to the .pro file for the newly made files." This reverts commit 3cc077ff381dbf64687ed2d3abf04d0d29921675. This commit adds the new files to the .pro file. --- .../src/gui/TheWire/CustomFrame.cpp | 20 +++ retroshare-gui/src/gui/TheWire/CustomFrame.h | 20 +++ .../src/gui/TheWire/PulseViewGroup.cpp | 125 +++++++++--------- retroshare-gui/src/retroshare-gui.pro | 2 + 4 files changed, 105 insertions(+), 62 deletions(-) diff --git a/retroshare-gui/src/gui/TheWire/CustomFrame.cpp b/retroshare-gui/src/gui/TheWire/CustomFrame.cpp index 20059222d..4f1308df5 100644 --- a/retroshare-gui/src/gui/TheWire/CustomFrame.cpp +++ b/retroshare-gui/src/gui/TheWire/CustomFrame.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/TheWire/CustomFrame.cpp * + * * + * Copyright (c) 2012-2020 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ + #include "CustomFrame.h" #include diff --git a/retroshare-gui/src/gui/TheWire/CustomFrame.h b/retroshare-gui/src/gui/TheWire/CustomFrame.h index ebe2bfa8c..e75a6087a 100644 --- a/retroshare-gui/src/gui/TheWire/CustomFrame.h +++ b/retroshare-gui/src/gui/TheWire/CustomFrame.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/TheWire/CustomFrame.h * + * * + * Copyright (c) 2012-2020 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ + #ifndef CUSTOMFRAMEH_H #define CUSTOMFRAMEH_H diff --git a/retroshare-gui/src/gui/TheWire/PulseViewGroup.cpp b/retroshare-gui/src/gui/TheWire/PulseViewGroup.cpp index 56c4eabdc..4ef0b6512 100644 --- a/retroshare-gui/src/gui/TheWire/PulseViewGroup.cpp +++ b/retroshare-gui/src/gui/TheWire/PulseViewGroup.cpp @@ -37,21 +37,21 @@ Q_DECLARE_METATYPE(RsWireGroup) PulseViewGroup::PulseViewGroup(PulseViewHolder *holder, RsWireGroupSPtr group) :PulseViewItem(holder), mGroup(group) { - setupUi(this); - setAttribute ( Qt::WA_DeleteOnClose, true ); - setup(); + setupUi(this); + setAttribute ( Qt::WA_DeleteOnClose, true ); + setup(); } void PulseViewGroup::setup() { - if (mGroup) { - connect(followButton, SIGNAL(clicked()), this, SLOT(actionFollow())); + if (mGroup) { + connect(followButton, SIGNAL(clicked()), this, SLOT(actionFollow())); - label_groupName->setText("@" + QString::fromStdString(mGroup->mMeta.mGroupName)); - label_authorName->setText(BoldString(QString::fromStdString(mGroup->mMeta.mAuthorId.toStdString()))); - label_date->setText(DateTime::formatDateTime(mGroup->mMeta.mPublishTs)); - label_tagline->setText(QString::fromStdString(mGroup->mTagline)); - label_location->setText(QString::fromStdString(mGroup->mLocation)); + label_groupName->setText("@" + QString::fromStdString(mGroup->mMeta.mGroupName)); + label_authorName->setText(BoldString(QString::fromStdString(mGroup->mMeta.mAuthorId.toStdString()))); + label_date->setText(DateTime::formatDateTime(mGroup->mMeta.mPublishTs)); + label_tagline->setText(QString::fromStdString(mGroup->mTagline)); + label_location->setText(QString::fromStdString(mGroup->mLocation)); if (mGroup->mMasthead.mData) @@ -65,72 +65,73 @@ void PulseViewGroup::setup() QSize frameSize = frame_masthead->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); } } +// 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 { - // 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. 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) - { - uint32_t pulses = mGroup->mGroupPulses + mGroup->mGroupReplies; - uint32_t replies = mGroup->mRefReplies; - uint32_t republishes = mGroup->mRefRepublishes; - uint32_t likes = mGroup->mRefLikes; + if (mGroup->mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED) + { + uint32_t pulses = mGroup->mGroupPulses + mGroup->mGroupReplies; + uint32_t replies = mGroup->mRefReplies; + uint32_t republishes = mGroup->mRefRepublishes; + uint32_t likes = mGroup->mRefLikes; - label_extra_pulses->setText(BoldString(ToNumberUnits(pulses))); - label_extra_replies->setText(BoldString(ToNumberUnits(replies))); - label_extra_republishes->setText(BoldString(ToNumberUnits(republishes))); - label_extra_likes->setText(BoldString(ToNumberUnits(likes))); + label_extra_pulses->setText(BoldString(ToNumberUnits(pulses))); + label_extra_replies->setText(BoldString(ToNumberUnits(replies))); + label_extra_republishes->setText(BoldString(ToNumberUnits(republishes))); + label_extra_likes->setText(BoldString(ToNumberUnits(likes))); - // hide follow. - widget_actions->setVisible(false); - } - else - { - // hide stats. - widget_replies->setVisible(false); - } - } + // hide follow. + widget_actions->setVisible(false); + } + else + { + // hide stats. + widget_replies->setVisible(false); + } + } } void PulseViewGroup::actionFollow() { - RsGxsGroupId groupId = mGroup->mMeta.mGroupId; - std::cerr << "PulseViewGroup::actionFollow() following "; - std::cerr << groupId; - std::cerr << std::endl; + RsGxsGroupId groupId = mGroup->mMeta.mGroupId; + std::cerr << "PulseViewGroup::actionFollow() following "; + std::cerr << groupId; + std::cerr << std::endl; - if (mHolder) { - mHolder->PVHfollow(groupId); - } + if (mHolder) { + mHolder->PVHfollow(groupId); + } } diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index b8e8365e0..93734b454 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -1220,6 +1220,7 @@ gxsthewire { gui/TheWire/PulseReply.h \ gui/TheWire/PulseReplySeperator.h \ gui/TheWire/PulseMessage.h \ + gui/TheWire/CustomFrame.h \ FORMS += gui/TheWire/WireDialog.ui \ gui/TheWire/WireGroupItem.ui \ @@ -1242,6 +1243,7 @@ gxsthewire { gui/TheWire/PulseReply.cpp \ gui/TheWire/PulseReplySeperator.cpp \ gui/TheWire/PulseMessage.cpp \ + gui/TheWire/CustomFrame.cpp \ RESOURCES += gui/TheWire/TheWire_images.qrc }