mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
Added a new setting to channels to enable/disable threaded loading.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7484 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
27c2ed0a97
commit
f60b37a213
7 changed files with 83 additions and 24 deletions
|
@ -29,7 +29,7 @@
|
|||
#include "gui/common/UIStateHelper.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/feeds/SubFileItem.h"
|
||||
|
||||
#include "gui/notifyqt.h"
|
||||
#include <algorithm>
|
||||
|
||||
#define CHAN_DEFAULT_IMAGE ":/images/channels.png"
|
||||
|
@ -57,6 +57,7 @@ GxsChannelPostsWidget::GxsChannelPostsWidget(const RsGxsGroupId &channelId, QWid
|
|||
/* Setup UI helper */
|
||||
|
||||
mStateHelper->addWidget(mTokenTypePosts, ui->progressBar, UISTATE_LOADING_VISIBLE);
|
||||
mStateHelper->addWidget(mTokenTypePosts, ui->loadingLabel, UISTATE_LOADING_VISIBLE);
|
||||
mStateHelper->addWidget(mTokenTypePosts, ui->filterLineEdit);
|
||||
|
||||
mStateHelper->addWidget(mTokenTypeRelatedPosts, ui->loadingLabel, UISTATE_LOADING_VISIBLE);
|
||||
|
@ -67,8 +68,10 @@ GxsChannelPostsWidget::GxsChannelPostsWidget(const RsGxsGroupId &channelId, QWid
|
|||
mStateHelper->addWidget(mTokenTypeGroupData, ui->logoLabel);
|
||||
mStateHelper->addWidget(mTokenTypeGroupData, ui->subscribeToolButton);
|
||||
|
||||
/* Connect signals */
|
||||
connect(ui->postButton, SIGNAL(clicked()), this, SLOT(createMsg()));
|
||||
connect(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool)));
|
||||
connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
|
||||
|
||||
/* add filter actions */
|
||||
ui->filterLineEdit->addFilter(QIcon(), tr("Title"), FILTER_TITLE, tr("Search Title"));
|
||||
|
@ -114,6 +117,7 @@ GxsChannelPostsWidget::GxsChannelPostsWidget(const RsGxsGroupId &channelId, QWid
|
|||
|
||||
/* Initialize GUI */
|
||||
setAutoDownload(false);
|
||||
settingsChanged();
|
||||
setGroupId(channelId);
|
||||
}
|
||||
|
||||
|
@ -144,6 +148,13 @@ void GxsChannelPostsWidget::processSettings(bool load)
|
|||
mInProcessSettings = false;
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidget::settingsChanged()
|
||||
{
|
||||
mUseThread = Settings->getChannelLoadThread();
|
||||
|
||||
mStateHelper->setWidgetVisible(ui->progressBar, mUseThread);
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidget::groupNameChanged(const QString &name)
|
||||
{
|
||||
if (groupId().isNull()) {
|
||||
|
|
|
@ -71,7 +71,7 @@ protected:
|
|||
virtual void insertPosts(const uint32_t &token, GxsMessageFramePostThread *thread);
|
||||
virtual void insertRelatedPosts(const uint32_t &token);
|
||||
virtual void clearPosts();
|
||||
virtual bool useThread() { return true; }
|
||||
virtual bool useThread() { return mUseThread; }
|
||||
virtual void fillThreadCreatePost(const QVariant &post, bool related, int current, int count);
|
||||
|
||||
private slots:
|
||||
|
@ -80,6 +80,7 @@ private slots:
|
|||
void subscribeGroup(bool subscribe);
|
||||
void filterChanged(int filter);
|
||||
void setViewMode(int viewMode);
|
||||
void settingsChanged();
|
||||
|
||||
private:
|
||||
void processSettings(bool load);
|
||||
|
@ -96,6 +97,7 @@ private:
|
|||
QAction *mAutoDownloadAction;
|
||||
|
||||
bool mInProcessSettings;
|
||||
bool mUseThread;
|
||||
|
||||
/* UI - from Designer */
|
||||
Ui::GxsChannelPostsWidget *ui;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue