diff --git a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp index f9b8b1dbc..6512c0c54 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp @@ -36,10 +36,12 @@ GxsCommentDialog::GxsCommentDialog(QWidget *parent, RsTokenService *token_servic /* Invoke the Qt Designer generated QObject setup routine */ ui->setupUi(this); - //ui->postFrame->setVisible(false); - - ui->treeWidget->setup(token_service, comment_service); + setTokenService(token_service,comment_service); + init(); +} +void GxsCommentDialog::init() +{ /* Set header resize modes and initial section sizes */ QHeaderView * ttheader = ui->treeWidget->header () ; ttheader->resizeSection (0, 440); @@ -62,6 +64,20 @@ GxsCommentDialog::GxsCommentDialog(QWidget *parent, RsTokenService *token_servic ui->sortBox->setIconSize(QSize(S*1.5,S*1.5)); } +void GxsCommentDialog::setTokenService(RsTokenService *token_service, RsGxsCommentService *comment_service) +{ + ui->treeWidget->setup(token_service, comment_service); +} + +GxsCommentDialog::GxsCommentDialog(QWidget *parent) + : QWidget(parent), ui(new Ui::GxsCommentDialog) +{ + /* Invoke the Qt Designer generated QObject setup routine */ + ui->setupUi(this); + + init(); +} + GxsCommentDialog::~GxsCommentDialog() { delete(ui); diff --git a/retroshare-gui/src/gui/gxs/GxsCommentDialog.h b/retroshare-gui/src/gui/gxs/GxsCommentDialog.h index 82d2fdbd1..4c506dd21 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsCommentDialog.h @@ -32,9 +32,11 @@ class GxsCommentDialog: public QWidget Q_OBJECT public: + GxsCommentDialog(QWidget *parent); GxsCommentDialog(QWidget *parent, RsTokenService *token_service, RsGxsCommentService *comment_service); virtual ~GxsCommentDialog(); + void setTokenService(RsTokenService *token_service, RsGxsCommentService *comment_service); void setCommentHeader(QWidget *header); void commentLoad(const RsGxsGroupId &grpId, const std::set &msg_versions, const RsGxsMessageId &most_recent_msgId); @@ -48,6 +50,8 @@ private slots: void sortComments(int); private: + void init(); + RsGxsGroupId mGrpId; RsGxsMessageId mMostRecentMsgId; std::set mMsgVersions; diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index 550e97d39..82bc63234 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -322,6 +322,8 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI ui->subscribeToolButton->addSubscribedAction(mAutoDownloadAction); + ui->commentsDialog->setTokenService(rsGxsChannels->getTokenService(),rsGxsChannels); + /* Initialize GUI */ setAutoDownload(false); settingsChanged(); @@ -394,6 +396,11 @@ void GxsChannelPostsWidgetWithModel::showPostDetails() mChannelPostFilesModel->setFiles(post.mFiles); + auto all_msgs_versions(post.mOlderVersions); + all_msgs_versions.insert(post.mMeta.mMsgId); + + ui->commentsDialog->commentLoad(post.mMeta.mGroupId, all_msgs_versions, post.mMeta.mMsgId); + std::cerr << "Showing details about selected index : "<< index.row() << "," << index.column() << std::endl; ui->postDetails_TE->setText(RsHtml().formatText(NULL, QString::fromUtf8(post.mMsg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS)); @@ -417,7 +424,6 @@ void GxsChannelPostsWidgetWithModel::showPostDetails() ui->channelPostFiles_TV->resizeColumnToContents(RsGxsChannelPostFilesModel::COLUMN_FILES_FILE); ui->channelPostFiles_TV->resizeColumnToContents(RsGxsChannelPostFilesModel::COLUMN_FILES_SIZE); - ui->channelPostFiles_TV->resizeColumnToContents(RsGxsChannelPostFilesModel::COLUMN_FILES_NAME); ui->channelPostFiles_TV->setAutoSelect(true); } @@ -431,7 +437,6 @@ void GxsChannelPostsWidgetWithModel::updateChannelFiles() ui->channelFiles_TV->resizeColumnToContents(RsGxsChannelPostFilesModel::COLUMN_FILES_FILE); ui->channelFiles_TV->resizeColumnToContents(RsGxsChannelPostFilesModel::COLUMN_FILES_SIZE); - ui->channelFiles_TV->resizeColumnToContents(RsGxsChannelPostFilesModel::COLUMN_FILES_NAME); ui->channelFiles_TV->setAutoSelect(true); } diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui index 5cc94fbbc..7bee202b7 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui @@ -224,7 +224,7 @@ - 2 + 1 @@ -448,7 +448,7 @@ p, li { white-space: pre-wrap; } - 1 + 2 @@ -532,7 +532,7 @@ p, li { white-space: pre-wrap; } - + @@ -593,6 +593,12 @@ p, li { white-space: pre-wrap; } QTreeView
gui/common/RSTreeView.h
+ + GxsCommentDialog + QWidget +
gui/gxs/GxsCommentDialog.h
+ 1 +