mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-13 00:19:30 -05:00
Added info pane for unsubscribed channels
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7934 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
326501f1f7
commit
d89cee8bdd
2
TODO.txt
2
TODO.txt
@ -23,7 +23,7 @@ List of fixes/improvements before 0.6
|
|||||||
Raises an error if you click on it.
|
Raises an error if you click on it.
|
||||||
|
|
||||||
Channels
|
Channels
|
||||||
[ ] Unsubscribed channels should show an info page when selected, like forums
|
[X] Unsubscribed channels should show an info page when selected, like forums
|
||||||
[ ] marking all as read in channels takes time. The channel icon should show a waiting clock
|
[ ] marking all as read in channels takes time. The channel icon should show a waiting clock
|
||||||
during the operation to avoid the user to re-click many times in the hope to get
|
during the operation to avoid the user to re-click many times in the hope to get
|
||||||
the posts marked as read.
|
the posts marked as read.
|
||||||
|
@ -52,7 +52,6 @@ GxsChannelPostsWidget::GxsChannelPostsWidget(const RsGxsGroupId &channelId, QWid
|
|||||||
/* Invoke the Qt Designer generated object setup routine */
|
/* Invoke the Qt Designer generated object setup routine */
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
mInProcessSettings = false;
|
|
||||||
|
|
||||||
/* Setup UI helper */
|
/* Setup UI helper */
|
||||||
|
|
||||||
@ -83,6 +82,7 @@ GxsChannelPostsWidget::GxsChannelPostsWidget(const RsGxsGroupId &channelId, QWid
|
|||||||
|
|
||||||
/* Initialize view button */
|
/* Initialize view button */
|
||||||
//setViewMode(VIEW_MODE_FEEDS); see processSettings
|
//setViewMode(VIEW_MODE_FEEDS); see processSettings
|
||||||
|
ui->infoWidget->hide();
|
||||||
|
|
||||||
QSignalMapper *signalMapper = new QSignalMapper(this);
|
QSignalMapper *signalMapper = new QSignalMapper(this);
|
||||||
connect(ui->feedToolButton, SIGNAL(clicked()), signalMapper, SLOT(map()));
|
connect(ui->feedToolButton, SIGNAL(clicked()), signalMapper, SLOT(map()));
|
||||||
@ -133,19 +133,27 @@ GxsChannelPostsWidget::~GxsChannelPostsWidget()
|
|||||||
|
|
||||||
void GxsChannelPostsWidget::processSettings(bool load)
|
void GxsChannelPostsWidget::processSettings(bool load)
|
||||||
{
|
{
|
||||||
mInProcessSettings = true;
|
|
||||||
Settings->beginGroup(QString("ChannelPostsWidget"));
|
Settings->beginGroup(QString("ChannelPostsWidget"));
|
||||||
|
|
||||||
if (load) {
|
if (load) {
|
||||||
// load settings
|
// load settings
|
||||||
|
|
||||||
|
/* Filter */
|
||||||
ui->filterLineEdit->setCurrentFilter(Settings->value("filter", FILTER_TITLE).toInt());
|
ui->filterLineEdit->setCurrentFilter(Settings->value("filter", FILTER_TITLE).toInt());
|
||||||
|
|
||||||
|
/* View mode */
|
||||||
setViewMode(Settings->value("viewMode", VIEW_MODE_FEEDS).toInt());
|
setViewMode(Settings->value("viewMode", VIEW_MODE_FEEDS).toInt());
|
||||||
} else {
|
} else {
|
||||||
// save settings
|
// save settings
|
||||||
|
|
||||||
|
/* Filter */
|
||||||
|
Settings->setValue("filter", ui->filterLineEdit->currentFilter());
|
||||||
|
|
||||||
|
/* View mode */
|
||||||
|
Settings->setValue("viewMode", viewMode());
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings->endGroup();
|
Settings->endGroup();
|
||||||
mInProcessSettings = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsChannelPostsWidget::settingsChanged()
|
void GxsChannelPostsWidget::settingsChanged()
|
||||||
@ -243,6 +251,39 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
|
|||||||
|
|
||||||
bool autoDownload = rsGxsChannels->getChannelAutoDownload(group.mMeta.mGroupId);
|
bool autoDownload = rsGxsChannels->getChannelAutoDownload(group.mMeta.mGroupId);
|
||||||
setAutoDownload(autoDownload);
|
setAutoDownload(autoDownload);
|
||||||
|
|
||||||
|
if (IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags)) {
|
||||||
|
ui->feedToolButton->setEnabled(true);
|
||||||
|
|
||||||
|
ui->fileToolButton->setEnabled(true);
|
||||||
|
ui->infoWidget->hide();
|
||||||
|
setViewMode(viewMode());
|
||||||
|
|
||||||
|
ui->infoPosts->clear();
|
||||||
|
ui->infoDescription->clear();
|
||||||
|
} else {
|
||||||
|
ui->infoPosts->setText(QString::number(group.mMeta.mVisibleMsgCount));
|
||||||
|
ui->infoDescription->setText(QString::fromUtf8(group.mDescription.c_str()));
|
||||||
|
|
||||||
|
ui->infoWidget->show();
|
||||||
|
ui->feedWidget->hide();
|
||||||
|
ui->fileWidget->hide();
|
||||||
|
|
||||||
|
ui->feedToolButton->setEnabled(false);
|
||||||
|
ui->fileToolButton->setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int GxsChannelPostsWidget::viewMode()
|
||||||
|
{
|
||||||
|
if (ui->feedToolButton->isChecked()) {
|
||||||
|
return VIEW_MODE_FEEDS;
|
||||||
|
} else if (ui->fileToolButton->isChecked()) {
|
||||||
|
return VIEW_MODE_FILES;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Default */
|
||||||
|
return VIEW_MODE_FEEDS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsChannelPostsWidget::setViewMode(int viewMode)
|
void GxsChannelPostsWidget::setViewMode(int viewMode)
|
||||||
@ -268,22 +309,12 @@ void GxsChannelPostsWidget::setViewMode(int viewMode)
|
|||||||
setViewMode(VIEW_MODE_FEEDS);
|
setViewMode(VIEW_MODE_FEEDS);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mInProcessSettings) {
|
|
||||||
/* Save view mode */
|
|
||||||
Settings->setValueToGroup("ChannelPostsWidget", "viewMode", viewMode);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsChannelPostsWidget::filterChanged(int filter)
|
void GxsChannelPostsWidget::filterChanged(int filter)
|
||||||
{
|
{
|
||||||
ui->feedWidget->setFilterType(filter);
|
ui->feedWidget->setFilterType(filter);
|
||||||
ui->fileWidget->setFilterType(filter);
|
ui->fileWidget->setFilterType(filter);
|
||||||
|
|
||||||
if (!mInProcessSettings) {
|
|
||||||
// save index
|
|
||||||
Settings->setValueToGroup("ChannelPostsWidget", "filter", filter);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ bool GxsChannelPostsWidget::filterItem(FeedItem *feedItem, const QString &text, int filter)
|
/*static*/ bool GxsChannelPostsWidget::filterItem(FeedItem *feedItem, const QString &text, int filter)
|
||||||
|
@ -89,6 +89,8 @@ private:
|
|||||||
void setAutoDownload(bool autoDl);
|
void setAutoDownload(bool autoDl);
|
||||||
static bool filterItem(FeedItem *feedItem, const QString &text, int filter);
|
static bool filterItem(FeedItem *feedItem, const QString &text, int filter);
|
||||||
|
|
||||||
|
int viewMode();
|
||||||
|
|
||||||
void insertChannelDetails(const RsGxsChannelGroup &group);
|
void insertChannelDetails(const RsGxsChannelGroup &group);
|
||||||
void insertChannelPosts(std::vector<RsGxsChannelPost> &posts, GxsMessageFramePostThread *thread, bool related);
|
void insertChannelPosts(std::vector<RsGxsChannelPost> &posts, GxsMessageFramePostThread *thread, bool related);
|
||||||
|
|
||||||
@ -97,7 +99,6 @@ private:
|
|||||||
private:
|
private:
|
||||||
QAction *mAutoDownloadAction;
|
QAction *mAutoDownloadAction;
|
||||||
|
|
||||||
bool mInProcessSettings;
|
|
||||||
bool mUseThread;
|
bool mUseThread;
|
||||||
|
|
||||||
/* UI - from Designer */
|
/* UI - from Designer */
|
||||||
|
@ -283,6 +283,63 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="infoWidget" native="true">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="infoPosts">
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">0</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="infoDescriptionLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Description:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="infoPostsLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Posts (at neighbor nodes):</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="infoDescription">
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">Description</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="GxsChannelFilesWidget" name="fileWidget" native="true">
|
<widget class="GxsChannelFilesWidget" name="fileWidget" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -318,6 +375,7 @@
|
|||||||
<zorder>headFrame</zorder>
|
<zorder>headFrame</zorder>
|
||||||
<zorder>feedWidget</zorder>
|
<zorder>feedWidget</zorder>
|
||||||
<zorder>fileWidget</zorder>
|
<zorder>fileWidget</zorder>
|
||||||
|
<zorder>infoWidget</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
Loading…
Reference in New Issue
Block a user