From d1393acfa698cd1c9eda10b381c695736f86e297 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Tue, 26 Dec 2023 12:35:29 +0100 Subject: [PATCH] Added show author for comments tree --- .../src/gui/gxs/GxsCommentTreeWidget.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp index bd230fe9c..277b11e4f 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp @@ -21,6 +21,8 @@ #include "GxsCommentTreeWidget.h" #include "gui/common/FilesDefs.h" +#include "gui/Identity/IdDialog.h" +#include "gui/MainWindow.h" #include "gui/common/RSElidedItemDelegate.h" #include "gui/common/RSTreeWidgetItem.h" #include "gui/gxs/GxsCreateCommentDialog.h" @@ -346,6 +348,10 @@ void GxsCommentTreeWidget::customPopUpMenu(const QPoint& point) action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_VOTEDOWN), tr("Vote Down"), this, SLOT(voteDown())); action->setDisabled(!item || mCurrentCommentMsgId.isNull() || mVoterId.isNull()); + contextMnu.addSeparator(); + + action = contextMnu.addAction(tr("Show Author"), this, SLOT(showAuthor())); + action->setDisabled(!item || mCurrentCommentMsgId.isNull() || mVoterId.isNull()); if (!mCurrentCommentMsgId.isNull()) { @@ -464,6 +470,19 @@ void GxsCommentTreeWidget::replyToComment() pcc.exec(); } + +void GxsCommentTreeWidget::showAuthor() +{ + /* window will destroy itself! */ + IdDialog *idDialog = dynamic_cast(MainWindow::getPage(MainWindow::People)); + + if (!idDialog) + return ; + + MainWindow::showWindow(MainWindow::People); + idDialog->navigate(RsGxsId(mCurrentCommentAuthorId)); +} + void GxsCommentTreeWidget::copyComment() { QString txt = dynamic_cast(sender())->data().toString();