added a waiting cursor when loading a channel

This commit is contained in:
csoler 2023-04-13 21:51:37 +02:00
parent 7299ace57a
commit a7b2091bb8

View file

@ -27,6 +27,8 @@
#include "retroshare/rsgxschannels.h" #include "retroshare/rsgxschannels.h"
#include "retroshare/rsexpr.h" #include "retroshare/rsexpr.h"
#include "gui/MainWindow.h"
#include "gui/mainpagestack.h"
#include "gui/common/FilesDefs.h" #include "gui/common/FilesDefs.h"
#include "util/qtthreadsutils.h" #include "util/qtthreadsutils.h"
#include "util/HandleRichText.h" #include "util/HandleRichText.h"
@ -453,7 +455,6 @@ const RsGxsGroupId& RsGxsChannelPostsModel::currentGroupId() const
{ {
return mChannelGroup.mMeta.mGroupId; return mChannelGroup.mMeta.mGroupId;
} }
void RsGxsChannelPostsModel::updateChannel(const RsGxsGroupId& channel_group_id) void RsGxsChannelPostsModel::updateChannel(const RsGxsGroupId& channel_group_id)
{ {
if(channel_group_id.isNull()) if(channel_group_id.isNull())
@ -586,6 +587,8 @@ void RsGxsChannelPostsModel::update_posts(const RsGxsGroupId& group_id)
if(group_id.isNull()) if(group_id.isNull())
return; return;
MainWindow::getPage(MainWindow::Channels)->setCursor(Qt::WaitCursor) ; // Maybe we should pass that widget when calling update_posts
RsThread::async([this, group_id]() RsThread::async([this, group_id]()
{ {
// 1 - get message data from p3GxsChannels // 1 - get message data from p3GxsChannels
@ -641,6 +644,8 @@ void RsGxsChannelPostsModel::update_posts(const RsGxsGroupId& group_id)
delete comments; delete comments;
delete votes; delete votes;
MainWindow::getPage(MainWindow::Channels)->setCursor(Qt::ArrowCursor) ;
}, this ); }, this );
}); });