mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-26 07:55:44 -04:00
remove channel/posted/forum info when no group is selected
This commit is contained in:
parent
08b436e5f4
commit
a5d1a154a4
9 changed files with 63 additions and 13 deletions
|
@ -454,6 +454,10 @@ void PostedListWidget::applyRanking()
|
||||||
ui->scrollAreaWidgetContents->update();
|
ui->scrollAreaWidgetContents->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PostedListWidget::blank()
|
||||||
|
{
|
||||||
|
clearPosts();
|
||||||
|
}
|
||||||
void PostedListWidget::clearPosts()
|
void PostedListWidget::clearPosts()
|
||||||
{
|
{
|
||||||
/* clear all messages */
|
/* clear all messages */
|
||||||
|
|
|
@ -63,6 +63,7 @@ protected:
|
||||||
virtual void insertAllPosts(const uint32_t &token, GxsMessageFramePostThread *thread);
|
virtual void insertAllPosts(const uint32_t &token, GxsMessageFramePostThread *thread);
|
||||||
virtual void insertPosts(const uint32_t &token);
|
virtual void insertPosts(const uint32_t &token);
|
||||||
virtual void clearPosts();
|
virtual void clearPosts();
|
||||||
|
virtual void blank();
|
||||||
virtual bool navigatePostItem(const RsGxsMessageId& msgId);
|
virtual bool navigatePostItem(const RsGxsMessageId& msgId);
|
||||||
|
|
||||||
/* GxsMessageFrameWidget */
|
/* GxsMessageFrameWidget */
|
||||||
|
|
|
@ -57,6 +57,7 @@ protected:
|
||||||
virtual void groupNameChanged(const QString &/*name*/) {}
|
virtual void groupNameChanged(const QString &/*name*/) {}
|
||||||
|
|
||||||
virtual void clearPosts() = 0;
|
virtual void clearPosts() = 0;
|
||||||
|
virtual void blank() = 0;
|
||||||
virtual bool navigatePostItem(const RsGxsMessageId& msgId) = 0;
|
virtual bool navigatePostItem(const RsGxsMessageId& msgId) = 0;
|
||||||
|
|
||||||
/* Thread functions */
|
/* Thread functions */
|
||||||
|
|
|
@ -72,12 +72,11 @@ bool GxsMessageFrameWidget::isWaiting()
|
||||||
|
|
||||||
void GxsMessageFrameWidget::setGroupId(const RsGxsGroupId &groupId)
|
void GxsMessageFrameWidget::setGroupId(const RsGxsGroupId &groupId)
|
||||||
{
|
{
|
||||||
if (mGroupId == groupId) {
|
if (mGroupId == groupId && !groupId.isNull())
|
||||||
if (!groupId.isNull()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if(!groupId.isNull())
|
||||||
|
{
|
||||||
mAcknowledgeReadStatusToken = 0;
|
mAcknowledgeReadStatusToken = 0;
|
||||||
if (mStateHelper->isLoading(mTokenTypeAcknowledgeReadStatus)) {
|
if (mStateHelper->isLoading(mTokenTypeAcknowledgeReadStatus)) {
|
||||||
mStateHelper->setLoading(mTokenTypeAcknowledgeReadStatus, false);
|
mStateHelper->setLoading(mTokenTypeAcknowledgeReadStatus, false);
|
||||||
|
@ -87,6 +86,12 @@ void GxsMessageFrameWidget::setGroupId(const RsGxsGroupId &groupId)
|
||||||
|
|
||||||
mGroupId = groupId;
|
mGroupId = groupId;
|
||||||
groupIdChanged();
|
groupIdChanged();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mGroupId.clear();
|
||||||
|
blank(); // clear the displayed data, because no group is selected.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsMessageFrameWidget::setAllMessagesRead(bool read)
|
void GxsMessageFrameWidget::setAllMessagesRead(bool read)
|
||||||
|
|
|
@ -43,6 +43,7 @@ public:
|
||||||
virtual void groupIdChanged() = 0;
|
virtual void groupIdChanged() = 0;
|
||||||
virtual QString groupName(bool withUnreadCount) = 0;
|
virtual QString groupName(bool withUnreadCount) = 0;
|
||||||
virtual QIcon groupIcon() = 0;
|
virtual QIcon groupIcon() = 0;
|
||||||
|
virtual void blank() =0;
|
||||||
virtual bool navigate(const RsGxsMessageId& msgId) = 0;
|
virtual bool navigate(const RsGxsMessageId& msgId) = 0;
|
||||||
virtual bool isLoading();
|
virtual bool isLoading();
|
||||||
virtual bool isWaiting();
|
virtual bool isWaiting();
|
||||||
|
|
|
@ -596,6 +596,20 @@ void GxsChannelPostsWidget::clearPosts()
|
||||||
ui->fileWidget->clear();
|
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)
|
bool GxsChannelPostsWidget::navigatePostItem(const RsGxsMessageId &msgId)
|
||||||
{
|
{
|
||||||
FeedItem *feedItem = ui->feedWidget->findGxsFeedItem(groupId(), msgId);
|
FeedItem *feedItem = ui->feedWidget->findGxsFeedItem(groupId(), msgId);
|
||||||
|
|
|
@ -73,6 +73,7 @@ protected:
|
||||||
virtual bool useThread() { return mUseThread; }
|
virtual bool useThread() { return mUseThread; }
|
||||||
virtual void fillThreadCreatePost(const QVariant &post, bool related, int current, int count);
|
virtual void fillThreadCreatePost(const QVariant &post, bool related, int current, int count);
|
||||||
virtual bool navigatePostItem(const RsGxsMessageId& msgId);
|
virtual bool navigatePostItem(const RsGxsMessageId& msgId);
|
||||||
|
virtual void blank() ;
|
||||||
|
|
||||||
/* GxsMessageFrameWidget */
|
/* GxsMessageFrameWidget */
|
||||||
virtual void setAllMessagesReadDo(bool read, uint32_t &token);
|
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()
|
GxsForumThreadWidget::~GxsForumThreadWidget()
|
||||||
{
|
{
|
||||||
if (mFillThread) {
|
if (mFillThread) {
|
||||||
|
|
|
@ -58,6 +58,7 @@ public:
|
||||||
|
|
||||||
// Callback for all Loads.
|
// Callback for all Loads.
|
||||||
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||||
|
virtual void blank();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *obj, QEvent *ev);
|
bool eventFilter(QObject *obj, QEvent *ev);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue