Merge pull request #2814 from defnax/comments-tree

Added show author for comments tree
This commit is contained in:
csoler 2024-01-01 15:40:22 +01:00 committed by GitHub
commit 24f13a4b88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -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<IdDialog*>(MainWindow::getPage(MainWindow::People));
if (!idDialog)
return ;
MainWindow::showWindow(MainWindow::People);
idDialog->navigate(RsGxsId(mCurrentCommentAuthorId));
}
void GxsCommentTreeWidget::copyComment()
{
QString txt = dynamic_cast<QAction*>(sender())->data().toString();

View File

@ -72,6 +72,7 @@ public slots:
void makeComment();
void replyToComment();
void showAuthor();
void copyComment();