mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 08:29:26 -05:00
remove channel/posted/forum info when no group is selected
This commit is contained in:
parent
08b436e5f4
commit
a5d1a154a4
@ -454,6 +454,10 @@ void PostedListWidget::applyRanking()
|
||||
ui->scrollAreaWidgetContents->update();
|
||||
}
|
||||
|
||||
void PostedListWidget::blank()
|
||||
{
|
||||
clearPosts();
|
||||
}
|
||||
void PostedListWidget::clearPosts()
|
||||
{
|
||||
/* clear all messages */
|
||||
|
@ -63,6 +63,7 @@ protected:
|
||||
virtual void insertAllPosts(const uint32_t &token, GxsMessageFramePostThread *thread);
|
||||
virtual void insertPosts(const uint32_t &token);
|
||||
virtual void clearPosts();
|
||||
virtual void blank();
|
||||
virtual bool navigatePostItem(const RsGxsMessageId& msgId);
|
||||
|
||||
/* GxsMessageFrameWidget */
|
||||
|
@ -57,6 +57,7 @@ protected:
|
||||
virtual void groupNameChanged(const QString &/*name*/) {}
|
||||
|
||||
virtual void clearPosts() = 0;
|
||||
virtual void blank() = 0;
|
||||
virtual bool navigatePostItem(const RsGxsMessageId& msgId) = 0;
|
||||
|
||||
/* Thread functions */
|
||||
|
@ -72,12 +72,11 @@ bool GxsMessageFrameWidget::isWaiting()
|
||||
|
||||
void GxsMessageFrameWidget::setGroupId(const RsGxsGroupId &groupId)
|
||||
{
|
||||
if (mGroupId == groupId) {
|
||||
if (!groupId.isNull()) {
|
||||
if (mGroupId == groupId && !groupId.isNull())
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(!groupId.isNull())
|
||||
{
|
||||
mAcknowledgeReadStatusToken = 0;
|
||||
if (mStateHelper->isLoading(mTokenTypeAcknowledgeReadStatus)) {
|
||||
mStateHelper->setLoading(mTokenTypeAcknowledgeReadStatus, false);
|
||||
@ -87,6 +86,12 @@ void GxsMessageFrameWidget::setGroupId(const RsGxsGroupId &groupId)
|
||||
|
||||
mGroupId = groupId;
|
||||
groupIdChanged();
|
||||
}
|
||||
else
|
||||
{
|
||||
mGroupId.clear();
|
||||
blank(); // clear the displayed data, because no group is selected.
|
||||
}
|
||||
}
|
||||
|
||||
void GxsMessageFrameWidget::setAllMessagesRead(bool read)
|
||||
|
@ -43,6 +43,7 @@ public:
|
||||
virtual void groupIdChanged() = 0;
|
||||
virtual QString groupName(bool withUnreadCount) = 0;
|
||||
virtual QIcon groupIcon() = 0;
|
||||
virtual void blank() =0;
|
||||
virtual bool navigate(const RsGxsMessageId& msgId) = 0;
|
||||
virtual bool isLoading();
|
||||
virtual bool isWaiting();
|
||||
|
@ -596,6 +596,20 @@ void GxsChannelPostsWidget::clearPosts()
|
||||
ui->fileWidget->clear();
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidget::blank()
|
||||
{
|
||||
mStateHelper->setWidgetEnabled(ui->postButton, false);
|
||||
mStateHelper->setWidgetEnabled(ui->subscribeToolButton, false);
|
||||
|
||||
clearPosts();
|
||||
|
||||
groupNameChanged(QString());
|
||||
|
||||
ui->infoWidget->hide();
|
||||
ui->feedWidget->show();
|
||||
ui->fileWidget->hide();
|
||||
}
|
||||
|
||||
bool GxsChannelPostsWidget::navigatePostItem(const RsGxsMessageId &msgId)
|
||||
{
|
||||
FeedItem *feedItem = ui->feedWidget->findGxsFeedItem(groupId(), msgId);
|
||||
|
@ -73,6 +73,7 @@ protected:
|
||||
virtual bool useThread() { return mUseThread; }
|
||||
virtual void fillThreadCreatePost(const QVariant &post, bool related, int current, int count);
|
||||
virtual bool navigatePostItem(const RsGxsMessageId& msgId);
|
||||
virtual void blank() ;
|
||||
|
||||
/* GxsMessageFrameWidget */
|
||||
virtual void setAllMessagesReadDo(bool read, uint32_t &token);
|
||||
|
@ -299,6 +299,28 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
|
||||
|
||||
}
|
||||
|
||||
void GxsForumThreadWidget::blank()
|
||||
{
|
||||
ui->progressBar->hide();
|
||||
ui->progressText->hide();
|
||||
ui->postText->clear() ;
|
||||
ui->by_label->setId(RsGxsId()) ;
|
||||
ui->time_label->clear();
|
||||
ui->lineRight->hide();
|
||||
ui->lineLeft->hide();
|
||||
ui->by_text_label->hide();
|
||||
ui->by_label->hide();
|
||||
ui->postText->setImageBlockWidget(ui->imageBlockWidget) ;
|
||||
ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages());
|
||||
ui->threadTreeWidget->clear();
|
||||
ui->forumName->setText("");
|
||||
|
||||
mStateHelper->setWidgetEnabled(ui->newthreadButton, false);
|
||||
mStateHelper->setWidgetEnabled(ui->previousButton, false);
|
||||
mStateHelper->setWidgetEnabled(ui->nextButton, false);
|
||||
ui->versions_CB->hide();
|
||||
}
|
||||
|
||||
GxsForumThreadWidget::~GxsForumThreadWidget()
|
||||
{
|
||||
if (mFillThread) {
|
||||
|
@ -58,6 +58,7 @@ public:
|
||||
|
||||
// Callback for all Loads.
|
||||
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
virtual void blank();
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *ev);
|
||||
|
Loading…
Reference in New Issue
Block a user