mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-18 10:58:43 -04:00
gui: forum: not expand unread children no more
Make the setting great again
This commit is contained in:
parent
5d132918c3
commit
638216e513
2 changed files with 21 additions and 1 deletions
|
@ -936,6 +936,12 @@ void GxsForumThreadWidget::changedThread(QModelIndex index)
|
||||||
#endif
|
#endif
|
||||||
markMsgAsReadUnread(true, false, false);
|
markMsgAsReadUnread(true, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Settings->getForumExpandNewMessages())
|
||||||
|
{
|
||||||
|
recursExpandUnread(index);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsForumThreadWidget::clickedThread(QModelIndex index)
|
void GxsForumThreadWidget::clickedThread(QModelIndex index)
|
||||||
|
@ -1323,7 +1329,7 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg)
|
||||||
else {
|
else {
|
||||||
RsIdentityDetails details;
|
RsIdentityDetails details;
|
||||||
rsIdentity->getIdDetails(msg.mMeta.mAuthorId, details);
|
rsIdentity->getIdDetails(msg.mMeta.mAuthorId, details);
|
||||||
QString name = GxsIdDetails::getName(details);
|
QString name = QString::fromUtf8(details.mNickname.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE);
|
||||||
|
|
||||||
banned_text_info += "<p><font color=\"#e00000\"><b>" + tr( "The author of this message (with ID %1) is banned. And named by name ( %2 )").arg(QString::fromStdString(msg.mMeta.mAuthorId.toStdString()), name) + "</b>";
|
banned_text_info += "<p><font color=\"#e00000\"><b>" + tr( "The author of this message (with ID %1) is banned. And named by name ( %2 )").arg(QString::fromStdString(msg.mMeta.mAuthorId.toStdString()), name) + "</b>";
|
||||||
banned_text_info += "<ul><li><b><font color=\"#e00000\">" + tr( "Messages from this author are not forwarded.") + "</font></b></li></ul>";
|
banned_text_info += "<ul><li><b><font color=\"#e00000\">" + tr( "Messages from this author are not forwarded.") + "</font></b></li></ul>";
|
||||||
|
@ -2107,3 +2113,16 @@ void GxsForumThreadWidget::showAuthorInPeople(const RsGxsForumMsg& msg)
|
||||||
MainWindow::showWindow(MainWindow::People);
|
MainWindow::showWindow(MainWindow::People);
|
||||||
idDialog->navigate(RsGxsId(msg.mMeta.mAuthorId));
|
idDialog->navigate(RsGxsId(msg.mMeta.mAuthorId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GxsForumThreadWidget::recursExpandUnread(const QModelIndex &index)
|
||||||
|
{
|
||||||
|
if (index.isValid()
|
||||||
|
&& index.data(RsGxsForumModel::UnreadChildrenRole).toBool()
|
||||||
|
) {
|
||||||
|
ui->threadTreeWidget->expand(index);
|
||||||
|
for (int row=0; row < mThreadProxyModel->rowCount(index); ++row)
|
||||||
|
{
|
||||||
|
recursExpandUnread(index.child(row, 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -199,6 +199,7 @@ private:
|
||||||
void setForumDescriptionLoading();
|
void setForumDescriptionLoading();
|
||||||
void clearForumDescription();
|
void clearForumDescription();
|
||||||
void blankPost();
|
void blankPost();
|
||||||
|
void recursExpandUnread(const QModelIndex &index);
|
||||||
|
|
||||||
RsGxsGroupId mLastForumID;
|
RsGxsGroupId mLastForumID;
|
||||||
RsGxsMessageId mThreadId;
|
RsGxsMessageId mThreadId;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue