mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-16 17:13:58 -05:00
added up-to-date info about sync period in group data details (channels, boards, forums) and warning when the sync period is too small w.r.t. the date of last post
This commit is contained in:
parent
709b323b03
commit
c30107c248
20 changed files with 331 additions and 183 deletions
|
|
@ -29,6 +29,7 @@
|
|||
#include "ui_GxsChannelPostsWidgetWithModel.h"
|
||||
#include "gui/feeds/GxsChannelPostItem.h"
|
||||
#include "gui/gxs/GxsIdDetails.h"
|
||||
#include "gui/gxs/GxsGroupFrameDialog.h"
|
||||
#include "util/misc.h"
|
||||
#include "gui/gxschannels/CreateGxsChannelMsg.h"
|
||||
#include "gui/common/UIStateHelper.h"
|
||||
|
|
@ -429,7 +430,7 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
|
|||
ui->filterLineEdit->setPlaceholderText(tr("Search..."));
|
||||
connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString)));
|
||||
|
||||
ui->postsTree->setPlaceholderText(tr("Thumbnails"));
|
||||
ui->postsTree->setPlaceholderText(tr("No posts available in this channel"));
|
||||
ui->postsTree->setMinimumWidth(COLUMN_SIZE_FONT_FACTOR_W*QFontMetricsF(font()).height()+1);
|
||||
|
||||
connect(ui->postsTree,SIGNAL(sizeChanged(QSize)),this,SLOT(handlePostsTreeSizeChange(QSize)));
|
||||
|
|
@ -702,7 +703,8 @@ void GxsChannelPostsWidgetWithModel::handleEvent_main_thread(std::shared_ptr<con
|
|||
case RsChannelEventCode::UPDATED_CHANNEL: // [[fallthrough]];
|
||||
case RsChannelEventCode::NEW_MESSAGE: // [[fallthrough]];
|
||||
case RsChannelEventCode::UPDATED_MESSAGE:
|
||||
{
|
||||
case RsChannelEventCode::SYNC_PARAMETERS_UPDATED:
|
||||
{
|
||||
if(e->mChannelGroupId == groupId())
|
||||
updateDisplay(true);
|
||||
}
|
||||
|
|
@ -1067,6 +1069,29 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou
|
|||
ui->infoLastPost->setText(tr("Never"));
|
||||
else
|
||||
ui->infoLastPost->setText(DateTime::formatLongDateTime(group.mMeta.mLastPost));
|
||||
|
||||
uint32_t current_sync_time = GxsGroupFrameDialog::checkDelay(rsGxsChannels->getSyncPeriod(group.mMeta.mGroupId))/86400 ;
|
||||
|
||||
QString sync_string;
|
||||
switch(current_sync_time)
|
||||
{
|
||||
case 5: sync_string = tr("5 days"); break;
|
||||
case 15: sync_string = tr("2 weeks"); break;
|
||||
case 30: sync_string = tr("1 month"); break;
|
||||
case 90: sync_string = tr("3 months"); break;
|
||||
case 180: sync_string = tr("6 months"); break;
|
||||
case 365: sync_string = tr("1 year"); break;
|
||||
case 0: sync_string = tr("indefinitly"); break;
|
||||
default:
|
||||
sync_string = tr("Unknown");
|
||||
}
|
||||
|
||||
if(group.mMeta.mLastPost + rsGxsChannels->getSyncPeriod(group.mMeta.mGroupId) < time(NULL) && IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags))
|
||||
sync_string += " (Warning: will not allow latest posts to sync)";
|
||||
|
||||
ui->infoSyncTimeLabel->setText(sync_string);
|
||||
|
||||
|
||||
QString formatDescription = QString::fromUtf8(group.mDescription.c_str());
|
||||
|
||||
unsigned int formatFlag = RSHTML_FORMATTEXT_EMBED_LINKS;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue