diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 2d77e6da7..e05ea4fc0 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -1695,6 +1695,14 @@ void RsGenExchange::notifyReceivePublishKey(const RsGxsGroupId &grpId) mNotifications.push_back(gc); } +void RsGenExchange::notifyChangedGroupSyncParams(const RsGxsGroupId &grpId) +{ + RS_STACK_MUTEX(mGenMtx); + + RsGxsGroupChange* gc = new RsGxsGroupChange(RsGxsNotify::TYPE_GROUP_SYNC_PARAMETERS_UPDATED,grpId, false); + + mNotifications.push_back(gc); +} void RsGenExchange::notifyChangedGroupStats(const RsGxsGroupId &grpId) { RS_STACK_MUTEX(mGenMtx); diff --git a/libretroshare/src/gxs/rsgenexchange.h b/libretroshare/src/gxs/rsgenexchange.h index 4a05e61c4..5b18e5663 100644 --- a/libretroshare/src/gxs/rsgenexchange.h +++ b/libretroshare/src/gxs/rsgenexchange.h @@ -133,28 +133,29 @@ public: /*! * @param messages messages are deleted after function returns */ - virtual void receiveNewMessages(std::vector& messages); + virtual void receiveNewMessages(std::vector& messages) override; /*! * @param groups groups are deleted after function returns */ - virtual void receiveNewGroups(std::vector& groups); + virtual void receiveNewGroups(std::vector& groups) override; /*! * @param grpId group id */ - virtual void notifyReceivePublishKey(const RsGxsGroupId &grpId); + virtual void notifyReceivePublishKey(const RsGxsGroupId &grpId) override; + virtual void notifyChangedGroupSyncParams(const RsGxsGroupId &grpId) override; /*! * \brief notifyReceiveDistantSearchResults * Should be called when new search results arrive. * \param grpId */ - virtual void receiveDistantSearchResults(TurtleRequestId id,const RsGxsGroupId &grpId); + virtual void receiveDistantSearchResults(TurtleRequestId id,const RsGxsGroupId &grpId) override; /*! * @param grpId group id */ - virtual void notifyChangedGroupStats(const RsGxsGroupId &grpId); + virtual void notifyChangedGroupStats(const RsGxsGroupId &grpId) override; /** E: Observer implementation **/ diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 8ed657bfb..e46b7efee 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -446,6 +446,7 @@ int RsGxsNetService::tick() should_notify = should_notify || !mNewMessagesToNotify.empty() ; should_notify = should_notify || !mNewPublishKeysToNotify.empty() ; should_notify = should_notify || !mNewStatsToNotify.empty() ; + should_notify = should_notify || !mNewGrpSyncParamsToNotify.empty() ; } if(should_notify) @@ -490,7 +491,7 @@ void RsGxsNetService::processObserverNotifications() std::vector grps_copy ; std::vector msgs_copy ; std::set stat_copy ; - std::set keys_copy ; + std::set keys_copy,grpss_copy ; { RS_STACK_MUTEX(mNxsMutex) ; @@ -499,11 +500,13 @@ void RsGxsNetService::processObserverNotifications() msgs_copy = mNewMessagesToNotify ; stat_copy = mNewStatsToNotify ; keys_copy = mNewPublishKeysToNotify ; + grpss_copy = mNewGrpSyncParamsToNotify ; mNewGroupsToNotify.clear() ; mNewMessagesToNotify.clear() ; mNewStatsToNotify.clear() ; mNewPublishKeysToNotify.clear() ; + mNewGrpSyncParamsToNotify.clear() ; } if(!grps_copy.empty()) mObserver->receiveNewGroups (grps_copy); @@ -514,6 +517,9 @@ void RsGxsNetService::processObserverNotifications() for(std::set::const_iterator it(stat_copy.begin());it!=stat_copy.end();++it) mObserver->notifyChangedGroupStats(*it); + + for(std::set::const_iterator it(grpss_copy.begin());it!=grpss_copy.end();++it) + mObserver->notifyChangedGroupSyncParams(*it); } void RsGxsNetService::rejectMessage(const RsGxsMessageId& msg_id) @@ -4740,6 +4746,10 @@ void RsGxsNetService::setSyncAge(const RsGxsGroupId &grpId, uint32_t age_in_secs locked_resetClientTS(grpId); IndicateConfigChanged(); + + // also send an event so that UI is updated + + mNewGrpSyncParamsToNotify.insert(grpId); } } void RsGxsNetService::setKeepAge(const RsGxsGroupId &grpId, uint32_t age_in_secs) diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index 6b3e39d30..78f384e42 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -608,6 +608,7 @@ private: std::vector mNewMessagesToNotify ; std::set mNewStatsToNotify ; std::set mNewPublishKeysToNotify ; + std::set mNewGrpSyncParamsToNotify ; // Distant search result map std::map > mDistantSearchResults ; diff --git a/libretroshare/src/gxs/rsgxsnotify.h b/libretroshare/src/gxs/rsgxsnotify.h index 71db32ebc..1e1a5f868 100644 --- a/libretroshare/src/gxs/rsgxsnotify.h +++ b/libretroshare/src/gxs/rsgxsnotify.h @@ -48,6 +48,7 @@ public: TYPE_UPDATED = 0x07, TYPE_MESSAGE_DELETED = 0x08, TYPE_GROUP_DELETED = 0x09, + TYPE_GROUP_SYNC_PARAMETERS_UPDATED = 0x0a, }; virtual NotifyType getType() = 0; diff --git a/libretroshare/src/gxs/rsnxsobserver.h b/libretroshare/src/gxs/rsnxsobserver.h index 164cce366..83db62e16 100644 --- a/libretroshare/src/gxs/rsnxsobserver.h +++ b/libretroshare/src/gxs/rsnxsobserver.h @@ -61,6 +61,11 @@ public: */ virtual void notifyReceivePublishKey(const RsGxsGroupId &grpId) = 0; + /*! + * \brief notifyChangedGroupSyncParams + * \param caled when a group sync parameter is updated + */ + virtual void notifyChangedGroupSyncParams(const RsGxsGroupId &grpId) = 0; /*! * @param grpId group id */ diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index 106147dc6..b7ec8ee7f 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -113,6 +113,7 @@ enum class RsChannelEventCode: uint8_t READ_STATUS_CHANGED = 0x07, // existing message has been read or set to unread RECEIVED_DISTANT_SEARCH_RESULT = 0x08, // result for the given group id available for the given turtle request id STATISTICS_CHANGED = 0x09, // stats (nb of supplier friends, how many msgs they have etc) has changed + SYNC_PARAMETERS_UPDATED = 0x0a, // sync and storage times have changed }; struct RsGxsChannelEvent: RsEvent diff --git a/libretroshare/src/retroshare/rsgxsforums.h b/libretroshare/src/retroshare/rsgxsforums.h index a5908c902..20b7d87de 100644 --- a/libretroshare/src/retroshare/rsgxsforums.h +++ b/libretroshare/src/retroshare/rsgxsforums.h @@ -115,6 +115,7 @@ enum class RsForumEventCode: uint8_t READ_STATUS_CHANGED = 0x06, /// msg was read or marked unread STATISTICS_CHANGED = 0x07, /// suppliers and how many messages they have changed MODERATOR_LIST_CHANGED = 0x08, /// forum moderation list has changed. + SYNC_PARAMETERS_UPDATED = 0x0a, /// sync and storage times have changed }; struct RsGxsForumEvent: RsEvent diff --git a/libretroshare/src/retroshare/rsposted.h b/libretroshare/src/retroshare/rsposted.h index 3c7724f6c..e7f155473 100644 --- a/libretroshare/src/retroshare/rsposted.h +++ b/libretroshare/src/retroshare/rsposted.h @@ -116,6 +116,7 @@ enum class RsPostedEventCode: uint8_t READ_STATUS_CHANGED = 0x06, STATISTICS_CHANGED = 0x07, MESSAGE_VOTES_UPDATED = 0x08, + SYNC_PARAMETERS_UPDATED = 0x09, }; diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index ab5990bae..a3117c8a4 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -309,6 +309,15 @@ void p3GxsChannels::notifyChanges(std::vector &changes) } break; + case RsGxsNotify::TYPE_GROUP_SYNC_PARAMETERS_UPDATED: + { + auto ev = std::make_shared(); + ev->mChannelGroupId = grpChange->mGroupId; + ev->mChannelEventCode = RsChannelEventCode::SYNC_PARAMETERS_UPDATED; + rsEvents->postEvent(ev); + } + break; + case RsGxsNotify::TYPE_STATISTICS_CHANGED: { auto ev = std::make_shared(); diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index 988abb667..cf0625f1d 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -256,7 +256,16 @@ void p3GxsForums::notifyChanges(std::vector &changes) } break; - case RsGxsNotify::TYPE_PUBLISHED: + case RsGxsNotify::TYPE_GROUP_SYNC_PARAMETERS_UPDATED: + { + auto ev = std::make_shared(); + ev->mForumGroupId = grpChange->mGroupId; + ev->mForumEventCode = RsForumEventCode::SYNC_PARAMETERS_UPDATED; + rsEvents->postEvent(ev); + } + break; + + case RsGxsNotify::TYPE_PUBLISHED: case RsGxsNotify::TYPE_RECEIVED_NEW: { /* group received */ diff --git a/libretroshare/src/services/p3postbase.cc b/libretroshare/src/services/p3postbase.cc index 5c25ca52c..3b3c70ec7 100644 --- a/libretroshare/src/services/p3postbase.cc +++ b/libretroshare/src/services/p3postbase.cc @@ -162,6 +162,15 @@ void p3PostBase::notifyChanges(std::vector &changes) } break; + case RsGxsNotify::TYPE_GROUP_SYNC_PARAMETERS_UPDATED: + { + auto ev = std::make_shared(); + ev->mPostedGroupId = group_id; + ev->mPostedEventCode = RsPostedEventCode::SYNC_PARAMETERS_UPDATED; + rsEvents->postEvent(ev); + } + break; + case RsGxsNotify::TYPE_STATISTICS_CHANGED: { auto ev = std::make_shared(); diff --git a/retroshare-gui/src/gui/Posted/PostedDialog.h b/retroshare-gui/src/gui/Posted/PostedDialog.h index 5931ec25b..433adbe93 100644 --- a/retroshare-gui/src/gui/Posted/PostedDialog.h +++ b/retroshare-gui/src/gui/Posted/PostedDialog.h @@ -36,15 +36,15 @@ public: /** Default Destructor */ ~PostedDialog(); - virtual QIcon iconPixmap() const { return QIcon(IMAGE_POSTED) ; } //MainPage - virtual QString pageName() const { return tr("Boards") ; } //MainPage - virtual QString helpText() const { return ""; } //MainPage + virtual QIcon iconPixmap() const override { return QIcon(IMAGE_POSTED) ; } //MainPage + virtual QString pageName() const override { return tr("Boards") ; } //MainPage + virtual QString helpText() const override { return ""; } //MainPage protected: virtual UserNotify *createUserNotify(QObject *parent) override; - virtual QString getHelpString() const ; - virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_POSTED; } - virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Posted; } + virtual QString getHelpString() const override; + virtual RetroShareLink::enumType getLinkType() override { return RetroShareLink::TYPE_POSTED; } + virtual GroupFrameSettings::Type groupFrameSettingsType() override { return GroupFrameSettings::Posted; } void groupInfoToGroupItemInfo(const RsGxsGenericGroupData *groupData, GroupItemInfo &groupItemInfo) override; bool getGroupData(std::list& groupInfo) override; @@ -52,16 +52,16 @@ protected: private: /* GxsGroupFrameDialog */ - virtual QString text(TextType type); - virtual QString icon(IconType type); - virtual QString settingsGroupName() { return "PostedDialog"; } - virtual GxsGroupDialog *createNewGroupDialog(); - virtual GxsGroupDialog *createGroupDialog(GxsGroupDialog::Mode mode, RsGxsGroupId groupId); - virtual int shareKeyType(); - virtual GxsMessageFrameWidget *createMessageFrameWidget(const RsGxsGroupId &groupId); - virtual RsGxsCommentService *getCommentService(); - virtual QWidget *createCommentHeaderWidget(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId); - virtual uint32_t requestGroupSummaryType() { return GXS_REQUEST_TYPE_GROUP_DATA; } // request complete group data + virtual QString text(TextType type) override; + virtual QString icon(IconType type) override; + virtual QString settingsGroupName() override{ return "PostedDialog"; } + virtual GxsGroupDialog *createNewGroupDialog() override; + virtual GxsGroupDialog *createGroupDialog(GxsGroupDialog::Mode mode, RsGxsGroupId groupId) override; + virtual int shareKeyType() override; + virtual GxsMessageFrameWidget *createMessageFrameWidget(const RsGxsGroupId &groupId) override; + virtual RsGxsCommentService *getCommentService() override; + virtual QWidget *createCommentHeaderWidget(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId) override; + virtual uint32_t requestGroupSummaryType() override { return GXS_REQUEST_TYPE_GROUP_DATA; } // request complete group data void handleEvent_main_thread(std::shared_ptr event); RsEventsHandlerId_t mEventHandlerId; diff --git a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp index 5e34d2c7e..a7d39d9cf 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp @@ -29,6 +29,7 @@ #include "ui_PostedListWidgetWithModel.h" #include "gui/feeds/GxsChannelPostItem.h" #include "gui/gxs/GxsIdDetails.h" +#include "gui/gxs/GxsGroupFrameDialog.h" #include "gui/gxs/GxsCommentDialog.h" #include "util/misc.h" #include "gui/Posted/PostedCreatePostDialog.h" @@ -277,7 +278,7 @@ PostedListWidgetWithModel::PostedListWidgetWithModel(const RsGxsGroupId& postedI connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()),this, SLOT(settingsChanged())); /* add filter actions */ - ui->postsTree->setPlaceholderText(tr("Thumbnails")); + ui->postsTree->setPlaceholderText(tr("No posts available in this board")); //ui->postsTree->setMinimumWidth(COLUMN_SIZE_FONT_FACTOR_W*QFontMetricsF(font()).height()+1); connect(ui->postsTree,SIGNAL(sizeChanged(QSize)),this,SLOT(handlePostsTreeSizeChange(QSize))); @@ -488,7 +489,8 @@ void PostedListWidgetWithModel::handleEvent_main_thread(std::shared_ptrmPostedGroupId == groupId()) updateDisplay(true); } @@ -851,11 +853,33 @@ void PostedListWidgetWithModel::insertBoardDetails(const RsPostedGroup& group) ui->infoPosts->setText(QString::number(group.mMeta.mVisibleMsgCount)); - if(group.mMeta.mLastPost==0) - ui->infoLastPost->setText(tr("Never")); - else - ui->infoLastPost->setText(DateTime::formatLongDateTime(group.mMeta.mLastPost)); - QString formatDescription = QString::fromUtf8(group.mDescription.c_str()); + if(group.mMeta.mLastPost==0) + ui->infoLastPost->setText(tr("Never")); + else + ui->infoLastPost->setText(DateTime::formatLongDateTime(group.mMeta.mLastPost)); + + uint32_t current_sync_time = GxsGroupFrameDialog::checkDelay(rsPosted->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 + rsPosted->getSyncPeriod(group.mMeta.mGroupId) < time(NULL) && IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags)) + sync_string += " (Warning: will not allow latest posts to sync)"; + + ui->syncPeriodLabel->setText(sync_string); + + QString formatDescription = QString::fromUtf8(group.mDescription.c_str()); unsigned int formatFlag = RSHTML_FORMATTEXT_EMBED_LINKS; diff --git a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.ui b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.ui index 11c6bd63f..c78c7d347 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.ui +++ b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.ui @@ -47,18 +47,6 @@ - - - - - 14 - - - - TextLabel - - - @@ -127,26 +115,6 @@ - - - - - 75 - true - - - - 0 - - - - - - - unknown - - - @@ -169,16 +137,23 @@ - - - - - 75 - true - + + + + Qt::Horizontal + + + 40 + 20 + + + + + + - Created + unknown @@ -195,33 +170,7 @@ - - - - unknown - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Posts - - - - + @@ -234,18 +183,15 @@ - - + + unknown - - true - - - + + 75 @@ -253,7 +199,7 @@ - Popularity + Distribution: @@ -276,8 +222,8 @@ - - + + 75 @@ -285,29 +231,103 @@ - Distribution: + 0 - - + + + + + 75 + true + + - unknown + Created - - - - Qt::Horizontal + + + + + 14 + - - - 40 - 20 - + + TextLabel - + + + + + + unknown + + + + + + + + 75 + true + + + + Popularity + + + + + + + + 0 + 0 + + + + + 75 + true + + + + Posts + + + + + + + unknown + + + true + + + + + + + + 75 + true + + + + Sync period: + + + + + + + unknown + + @@ -320,7 +340,7 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Description</span></p></body></html> diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 14c903d56..7f1c56f55 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -388,7 +388,7 @@ void GxsGroupFrameDialog::removeAllSearches() // Same function than the one in rsgxsnetservice.cc, so that all times are automatically consistent -static uint32_t checkDelay(uint32_t time_in_secs) +uint32_t GxsGroupFrameDialog::checkDelay(uint32_t time_in_secs) { if(time_in_secs < 1 * 86400) return 0 ; diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h index eaf1d0d34..e03bd0038 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h @@ -82,6 +82,8 @@ public: void getServiceStatistics(GxsServiceStatistic& stats) const ; + static uint32_t checkDelay(uint32_t time_in_secs); + protected: virtual void showEvent(QShowEvent *event) override; virtual void paintEvent(QPaintEvent *pe) override; diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index c0c6cb327..390b44f05 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -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_ptrmChannelGroupId == 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; diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui index e9dec30c6..1733da68d 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui @@ -181,7 +181,7 @@ - 1 + 0 @@ -219,7 +219,27 @@ - + + + + + 75 + true + + + + Distribution: + + + + + + + 0 + + + + unknown @@ -229,6 +249,20 @@ + + + + unknown + + + + + + + unknown + + + @@ -248,14 +282,7 @@ - - - - unknown - - - - + @@ -268,53 +295,6 @@ - - - - unknown - - - - - - - - 75 - true - - - - Distribution: - - - - - - - - 75 - true - - - - Created: - - - - - - - 0 - - - - - - - unknown - - - @@ -337,6 +317,46 @@ + + + + unknown + + + + + + + + 75 + true + + + + Created: + + + + + + + + 75 + true + + + + Sync period: + + + + + + + unknown + + + diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 0d6a0ff31..3a2d8487e 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -383,7 +383,8 @@ void GxsForumThreadWidget::handleEvent_main_thread(std::shared_ptrmForumGroupId == mForumGroup.mMeta.mGroupId) + case RsForumEventCode::SYNC_PARAMETERS_UPDATED: + if(e->mForumGroupId == mForumGroup.mMeta.mGroupId) updateDisplay(true); break; default: break;