From a954b19d8e05f6a3d982af86a41773ea33528d11 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Jan 2017 01:18:35 +0300 Subject: [PATCH] groups tree tooltips and info panels - add last post date info --- .../src/gui/common/GroupTreeWidget.cpp | 6 ++- .../gui/gxschannels/GxsChannelPostsWidget.cpp | 5 +++ .../gui/gxschannels/GxsChannelPostsWidget.ui | 38 ++++++++++++++++--- .../gui/gxsforums/GxsForumThreadWidget.cpp | 1 + 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index 2009d55a5..50165aadd 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -36,6 +36,7 @@ #include "gui/common/ElidedLabel.h" #include "gui/settings/rsharesettings.h" #include "util/QtVersion.h" +#include "util/DateTime.h" #include @@ -477,10 +478,11 @@ void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList< tooltip += "\n" + tr("You have been granted as publisher (you can post here!)"); if(!IS_GROUP_SUBSCRIBED(itemInfo.subscribeFlags)) - { tooltip += "\n" + QString::number(itemInfo.max_visible_posts) + " messages available" ; + // if(itemInfo.max_visible_posts) // wtf? this=0 when there are some posts definitely exist - lastpost is recent + tooltip += "\n" + tr("Last Post") + ": " + DateTime::formatLongDateTime(itemInfo.lastpost) ; + if(!IS_GROUP_SUBSCRIBED(itemInfo.subscribeFlags)) tooltip += "\n" + tr("Subscribe to download and read messages") ; - } item->setToolTip(COLUMN_NAME, tooltip); item->setToolTip(COLUMN_UNREAD, tooltip); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp index dd5c39b50..109ab942a 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp @@ -33,6 +33,7 @@ #include "gui/feeds/SubFileItem.h" #include "gui/notifyqt.h" #include +#include "util/DateTime.h" #define CHAN_DEFAULT_IMAGE ":/images/channels.png" @@ -266,6 +267,10 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group) ui->infoDescription->clear(); } else { ui->infoPosts->setText(QString::number(group.mMeta.mVisibleMsgCount)); + + ui->infoLastPost->setText(DateTime::formatLongDateTime(group.mMeta.mLastPost)); + + ui->infoDescription->setText(QString::fromUtf8(group.mDescription.c_str())); ui->infoAdministrator->setId(group.mMeta.mAuthorId) ; diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.ui b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.ui index bdb6ca5d2..e93296003 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.ui +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.ui @@ -397,7 +397,7 @@ - + @@ -429,7 +429,26 @@ - + + + + + 0 + 0 + + + + + 75 + true + + + + Last Post: + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> @@ -446,7 +465,7 @@ p, li { white-space: pre-wrap; } - + @@ -459,7 +478,7 @@ p, li { white-space: pre-wrap; } - + unknown @@ -473,7 +492,14 @@ p, li { white-space: pre-wrap; } - + + + + unknown + + + + @@ -486,7 +512,7 @@ p, li { white-space: pre-wrap; } - + unknown diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index cc0890077..113cc8ecb 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -879,6 +879,7 @@ static QString getDurationString(uint32_t days) tw->mForumDescription = QString("%1: \t%2
").arg(tr("Forum name"), QString::fromUtf8( group.mMeta.mGroupName.c_str())); tw->mForumDescription += QString("%1: \t%2
").arg(tr("Subscribers")).arg(group.mMeta.mPop); tw->mForumDescription += QString("%1: \t%2
").arg(tr("Posts (at neighbor nodes)")).arg(group.mMeta.mVisibleMsgCount); + tw->mForumDescription += QString("%1: \t%2
").arg(tr("Last post")).arg(DateTime::formatLongDateTime(group.mMeta.mLastPost)); tw->mForumDescription += QString("%1: \t%2
").arg(tr("Synchronization")).arg(getDurationString( rsGxsForums->getSyncPeriod(group.mMeta.mGroupId)/86400 )) ; tw->mForumDescription += QString("%1: \t%2
").arg(tr("Storage")).arg(getDurationString( rsGxsForums->getStoragePeriod(group.mMeta.mGroupId)/86400));