mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
FeedReader: The feed can be used as source for board
This commit is contained in:
parent
ecffb3cb7f
commit
571f709b50
13 changed files with 704 additions and 113 deletions
|
@ -30,9 +30,11 @@
|
|||
#include "gui/common/UIStateHelper.h"
|
||||
|
||||
#include <retroshare/rsgxsforums.h>
|
||||
#include <retroshare/rsposted.h>
|
||||
#include <iostream>
|
||||
|
||||
#define TOKEN_TYPE_FORUM_GROUPS 1
|
||||
#define TOKEN_TYPE_FORUM_GROUPS 1
|
||||
#define TOKEN_TYPE_POSTED_GROUPS 2
|
||||
|
||||
AddFeedDialog::AddFeedDialog(RsFeedReader *feedReader, FeedReaderNotify *notify, QWidget *parent)
|
||||
: QDialog(parent, Qt::Window), mFeedReader(feedReader), mNotify(notify), ui(new Ui::AddFeedDialog)
|
||||
|
@ -47,9 +49,12 @@ AddFeedDialog::AddFeedDialog(RsFeedReader *feedReader, FeedReaderNotify *notify,
|
|||
|
||||
mStateHelper->addWidget(TOKEN_TYPE_FORUM_GROUPS, ui->forumComboBox, UISTATE_LOADING_DISABLED);
|
||||
mStateHelper->addWidget(TOKEN_TYPE_FORUM_GROUPS, ui->buttonBox->button(QDialogButtonBox::Ok), UISTATE_LOADING_DISABLED);
|
||||
mStateHelper->addWidget(TOKEN_TYPE_POSTED_GROUPS, ui->postedComboBox, UISTATE_LOADING_DISABLED);
|
||||
mStateHelper->addWidget(TOKEN_TYPE_POSTED_GROUPS, ui->buttonBox->button(QDialogButtonBox::Ok), UISTATE_LOADING_DISABLED);
|
||||
|
||||
/* Setup TokenQueue */
|
||||
mTokenQueue = new TokenQueue(rsGxsForums->getTokenService(), this);
|
||||
mForumTokenQueue = new TokenQueue(rsGxsForums->getTokenService(), this);
|
||||
mPostedTokenQueue = new TokenQueue(rsPosted->getTokenService(), this);
|
||||
|
||||
/* Connect signals */
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(createFeed()));
|
||||
|
@ -59,18 +64,23 @@ AddFeedDialog::AddFeedDialog(RsFeedReader *feedReader, FeedReaderNotify *notify,
|
|||
connect(ui->useStandardStorageTimeCheckBox, SIGNAL(toggled(bool)), this, SLOT(useStandardStorageTimeToggled()));
|
||||
connect(ui->useStandardUpdateInterval, SIGNAL(toggled(bool)), this, SLOT(useStandardUpdateIntervalToggled()));
|
||||
connect(ui->useStandardProxyCheckBox, SIGNAL(toggled(bool)), this, SLOT(useStandardProxyToggled()));
|
||||
connect(ui->typeForumRadio, SIGNAL(toggled(bool)), this, SLOT(typeForumToggled()));
|
||||
connect(ui->typeForumCheckBox, SIGNAL(toggled(bool)), this, SLOT(typeForumToggled()));
|
||||
connect(ui->typePostedCheckBox, SIGNAL(toggled(bool)), this, SLOT(typePostedToggled()));
|
||||
connect(ui->typeLocalCheckBox, SIGNAL(toggled(bool)), this, SLOT(typeLocalToggled()));
|
||||
connect(ui->postedFirstImageCheckBox, SIGNAL(toggled(bool)), this, SLOT(postedFirstImageToggled()));
|
||||
connect(ui->previewButton, SIGNAL(clicked()), this, SLOT(preview()));
|
||||
|
||||
/* currently only for local feeds */
|
||||
connect(ui->saveCompletePageCheckBox, SIGNAL(toggled(bool)), this, SLOT(denyForumToggled()));
|
||||
connect(ui->saveCompletePageCheckBox, SIGNAL(toggled(bool)), this, SLOT(denyForumAndPostedToggled()));
|
||||
|
||||
connect(ui->urlLineEdit, SIGNAL(textChanged(QString)), this, SLOT(validate()));
|
||||
connect(ui->nameLineEdit, SIGNAL(textChanged(QString)), this, SLOT(validate()));
|
||||
connect(ui->useInfoFromFeedCheckBox, SIGNAL(toggled(bool)), this, SLOT(validate()));
|
||||
connect(ui->typeLocalRadio, SIGNAL(toggled(bool)), this, SLOT(validate()));
|
||||
connect(ui->typeForumRadio, SIGNAL(toggled(bool)), this, SLOT(validate()));
|
||||
connect(ui->typeLocalCheckBox, SIGNAL(toggled(bool)), this, SLOT(validate()));
|
||||
connect(ui->typeForumCheckBox, SIGNAL(toggled(bool)), this, SLOT(validate()));
|
||||
connect(ui->forumComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(validate()));
|
||||
connect(ui->typePostedCheckBox, SIGNAL(toggled(bool)), this, SLOT(validate()));
|
||||
connect(ui->postedComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(validate()));
|
||||
|
||||
connect(ui->clearCachePushButton, SIGNAL(clicked()), this, SLOT(clearMessageCache()));
|
||||
|
||||
|
@ -79,13 +89,22 @@ AddFeedDialog::AddFeedDialog(RsFeedReader *feedReader, FeedReaderNotify *notify,
|
|||
|
||||
ui->activatedCheckBox->setChecked(true);
|
||||
mStateHelper->setWidgetEnabled(ui->forumComboBox, false);
|
||||
mStateHelper->setWidgetEnabled(ui->postedComboBox, false);
|
||||
ui->useInfoFromFeedCheckBox->setChecked(true);
|
||||
ui->updateForumInfoCheckBox->setEnabled(false);
|
||||
ui->updateForumInfoCheckBox->setChecked(true);
|
||||
ui->updatePostedInfoCheckBox->setEnabled(false);
|
||||
ui->updatePostedInfoCheckBox->setChecked(true);
|
||||
ui->postedFirstImageCheckBox->setEnabled(false);
|
||||
ui->postedFirstImageCheckBox->setChecked(false);
|
||||
ui->postedOnlyImageCheckBox->setEnabled(false);
|
||||
ui->postedOnlyImageCheckBox->setChecked(false);
|
||||
ui->useAuthenticationCheckBox->setChecked(false);
|
||||
ui->useStandardStorageTimeCheckBox->setChecked(true);
|
||||
ui->useStandardUpdateInterval->setChecked(true);
|
||||
ui->useStandardProxyCheckBox->setChecked(true);
|
||||
ui->embedImagesCheckBox->setChecked(true);
|
||||
ui->saveCompletePageCheckBox->setEnabled(false);
|
||||
|
||||
/* not yet supported */
|
||||
ui->authenticationGroupBox->setEnabled(false);
|
||||
|
@ -98,6 +117,9 @@ AddFeedDialog::AddFeedDialog(RsFeedReader *feedReader, FeedReaderNotify *notify,
|
|||
/* fill own forums */
|
||||
requestForumGroups();
|
||||
|
||||
/* fill own posted */
|
||||
requestPostedGroups();
|
||||
|
||||
validate();
|
||||
|
||||
ui->urlLineEdit->setFocus();
|
||||
|
@ -112,7 +134,8 @@ AddFeedDialog::~AddFeedDialog()
|
|||
processSettings(false);
|
||||
|
||||
delete(ui);
|
||||
delete(mTokenQueue);
|
||||
delete(mForumTokenQueue);
|
||||
delete(mPostedTokenQueue);
|
||||
}
|
||||
|
||||
void AddFeedDialog::processSettings(bool load)
|
||||
|
@ -161,18 +184,65 @@ void AddFeedDialog::useStandardProxyToggled()
|
|||
|
||||
void AddFeedDialog::typeForumToggled()
|
||||
{
|
||||
bool checked = ui->typeForumRadio->isChecked();
|
||||
bool checked = ui->typeForumCheckBox->isChecked();
|
||||
mStateHelper->setWidgetEnabled(ui->forumComboBox, checked);
|
||||
ui->updateForumInfoCheckBox->setEnabled(checked);
|
||||
|
||||
if (checked) {
|
||||
ui->typeLocalCheckBox->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
void AddFeedDialog::denyForumToggled()
|
||||
void AddFeedDialog::postedFirstImageToggled()
|
||||
{
|
||||
bool checked = ui->postedFirstImageCheckBox->isChecked();
|
||||
ui->postedOnlyImageCheckBox->setEnabled(checked);
|
||||
|
||||
if (!checked) {
|
||||
ui->postedOnlyImageCheckBox->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
void AddFeedDialog::typePostedToggled()
|
||||
{
|
||||
bool checked = ui->typePostedCheckBox->isChecked();
|
||||
mStateHelper->setWidgetEnabled(ui->postedComboBox, checked);
|
||||
ui->updatePostedInfoCheckBox->setEnabled(checked);
|
||||
ui->postedFirstImageCheckBox->setEnabled(checked);
|
||||
|
||||
if (checked) {
|
||||
ui->typeLocalCheckBox->setChecked(false);
|
||||
}else {
|
||||
ui->postedFirstImageCheckBox->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
void AddFeedDialog::typeLocalToggled()
|
||||
{
|
||||
bool checked = ui->typeLocalCheckBox->isChecked();
|
||||
if (checked) {
|
||||
mStateHelper->setWidgetEnabled(ui->forumComboBox, false);
|
||||
mStateHelper->setWidgetEnabled(ui->postedComboBox, false);
|
||||
ui->typeForumCheckBox->setChecked(false);
|
||||
ui->typePostedCheckBox->setChecked(false);
|
||||
ui->saveCompletePageCheckBox->setEnabled(true);
|
||||
} else {
|
||||
ui->saveCompletePageCheckBox->setEnabled(false);
|
||||
ui->saveCompletePageCheckBox->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
void AddFeedDialog::denyForumAndPostedToggled()
|
||||
{
|
||||
if (ui->saveCompletePageCheckBox->isChecked()) {
|
||||
ui->typeForumRadio->setEnabled(false);
|
||||
ui->typeLocalRadio->setChecked(true);
|
||||
ui->typeForumCheckBox->setEnabled(false);
|
||||
ui->typeForumCheckBox->setChecked(false);
|
||||
ui->typePostedCheckBox->setEnabled(false);
|
||||
ui->typePostedCheckBox->setChecked(false);
|
||||
ui->typeLocalCheckBox->setChecked(true);
|
||||
} else {
|
||||
ui->typeForumRadio->setEnabled(true);
|
||||
ui->typeForumCheckBox->setEnabled(true);
|
||||
ui->typePostedCheckBox->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,11 +259,15 @@ void AddFeedDialog::validate()
|
|||
|
||||
ui->previewButton->setEnabled(ok);
|
||||
|
||||
if (!ui->typeLocalRadio->isChecked() && !ui->typeForumRadio->isChecked()) {
|
||||
if (!ui->typeLocalCheckBox->isChecked() && !ui->typeForumCheckBox->isChecked() && !ui->typePostedCheckBox->isChecked()) {
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (ui->typeForumRadio->isChecked() && ui->forumComboBox->itemData(ui->forumComboBox->currentIndex()).toString().isEmpty()) {
|
||||
if (ui->typeForumCheckBox->isChecked() && ui->forumComboBox->itemData(ui->forumComboBox->currentIndex()).toString().isEmpty()) {
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (ui->typePostedCheckBox->isChecked() && ui->postedComboBox->itemData(ui->postedComboBox->currentIndex()).toString().isEmpty()) {
|
||||
ok = false;
|
||||
}
|
||||
|
||||
|
@ -224,20 +298,31 @@ bool AddFeedDialog::fillFeed(uint32_t feedId)
|
|||
ui->urlLineEdit->setText(QString::fromUtf8(feedInfo.url.c_str()));
|
||||
ui->useInfoFromFeedCheckBox->setChecked(feedInfo.flag.infoFromFeed);
|
||||
ui->updateForumInfoCheckBox->setChecked(feedInfo.flag.updateForumInfo);
|
||||
ui->updatePostedInfoCheckBox->setChecked(feedInfo.flag.updatePostedInfo);
|
||||
ui->postedFirstImageCheckBox->setChecked(feedInfo.flag.postedFirstImage);
|
||||
ui->postedOnlyImageCheckBox->setChecked(feedInfo.flag.postedOnlyImage);
|
||||
ui->activatedCheckBox->setChecked(!feedInfo.flag.deactivated);
|
||||
ui->embedImagesCheckBox->setChecked(feedInfo.flag.embedImages);
|
||||
ui->saveCompletePageCheckBox->setChecked(feedInfo.flag.saveCompletePage);
|
||||
|
||||
ui->descriptionPlainTextEdit->setPlainText(QString::fromUtf8(feedInfo.description.c_str()));
|
||||
|
||||
if (feedInfo.flag.forum) {
|
||||
mStateHelper->setWidgetEnabled(ui->forumComboBox, true);
|
||||
ui->typeForumRadio->setChecked(true);
|
||||
ui->saveCompletePageCheckBox->setEnabled(false);
|
||||
if (feedInfo.flag.forum || feedInfo.flag.posted) {
|
||||
if (feedInfo.flag.forum) {
|
||||
mStateHelper->setWidgetEnabled(ui->forumComboBox, true);
|
||||
ui->typeForumCheckBox->setChecked(true);
|
||||
|
||||
setActiveForumId(feedInfo.forumId);
|
||||
setActiveForumId(feedInfo.forumId);
|
||||
}
|
||||
if (feedInfo.flag.posted) {
|
||||
mStateHelper->setWidgetEnabled(ui->postedComboBox, true);
|
||||
ui->typePostedCheckBox->setChecked(true);
|
||||
|
||||
setActivePostedId(feedInfo.postedId);
|
||||
}
|
||||
ui->saveCompletePageCheckBox->setEnabled(false);
|
||||
} else {
|
||||
ui->typeLocalRadio->setChecked(true);
|
||||
ui->typeLocalCheckBox->setChecked(true);
|
||||
mStateHelper->setWidgetEnabled(ui->forumComboBox, false);
|
||||
}
|
||||
|
||||
|
@ -286,6 +371,21 @@ void AddFeedDialog::setActiveForumId(const std::string &forumId)
|
|||
}
|
||||
}
|
||||
|
||||
void AddFeedDialog::setActivePostedId(const std::string &postedId)
|
||||
{
|
||||
if (mStateHelper->isLoading(TOKEN_TYPE_POSTED_GROUPS)) {
|
||||
mFillPostedId = postedId;
|
||||
return;
|
||||
}
|
||||
|
||||
int index = ui->postedComboBox->findData(QString::fromStdString(postedId));
|
||||
if (index >= 0) {
|
||||
ui->postedComboBox->setCurrentIndex(index);
|
||||
} else {
|
||||
ui->postedComboBox->setCurrentIndex(0);
|
||||
}
|
||||
}
|
||||
|
||||
void AddFeedDialog::getFeedInfo(FeedInfo &feedInfo)
|
||||
{
|
||||
feedInfo.parentId = mParentId;
|
||||
|
@ -294,18 +394,27 @@ void AddFeedDialog::getFeedInfo(FeedInfo &feedInfo)
|
|||
feedInfo.url = ui->urlLineEdit->text().toUtf8().constData();
|
||||
feedInfo.flag.infoFromFeed = ui->useInfoFromFeedCheckBox->isChecked();
|
||||
feedInfo.flag.updateForumInfo = ui->updateForumInfoCheckBox->isChecked() && ui->updateForumInfoCheckBox->isEnabled();
|
||||
feedInfo.flag.updatePostedInfo = ui->updatePostedInfoCheckBox->isChecked() && ui->updatePostedInfoCheckBox->isEnabled();
|
||||
feedInfo.flag.postedFirstImage = ui->postedFirstImageCheckBox->isChecked() && ui->postedFirstImageCheckBox->isEnabled();
|
||||
feedInfo.flag.postedOnlyImage = ui->postedOnlyImageCheckBox->isChecked() && ui->postedOnlyImageCheckBox->isEnabled();
|
||||
feedInfo.flag.deactivated = !ui->activatedCheckBox->isChecked();
|
||||
feedInfo.flag.embedImages = ui->embedImagesCheckBox->isChecked();
|
||||
feedInfo.flag.saveCompletePage = ui->saveCompletePageCheckBox->isChecked();
|
||||
|
||||
feedInfo.description = ui->descriptionPlainTextEdit->toPlainText().toUtf8().constData();
|
||||
|
||||
feedInfo.flag.forum = ui->typeForumRadio->isChecked();
|
||||
feedInfo.flag.forum = ui->typeForumCheckBox->isChecked();
|
||||
|
||||
if (feedInfo.flag.forum) {
|
||||
feedInfo.forumId = ui->forumComboBox->itemData(ui->forumComboBox->currentIndex()).toString().toStdString();
|
||||
}
|
||||
|
||||
feedInfo.flag.posted = ui->typePostedCheckBox->isChecked();
|
||||
|
||||
if (feedInfo.flag.posted) {
|
||||
feedInfo.postedId = ui->postedComboBox->itemData(ui->postedComboBox->currentIndex()).toString().toStdString();
|
||||
}
|
||||
|
||||
feedInfo.flag.authentication = ui->useAuthenticationCheckBox->isChecked();
|
||||
feedInfo.user = ui->userLineEdit->text().toUtf8().constData();
|
||||
feedInfo.password = ui->passwordLineEdit->text().toUtf8().constData();
|
||||
|
@ -382,10 +491,10 @@ void AddFeedDialog::requestForumGroups()
|
|||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
|
||||
mTokenQueue->cancelActiveRequestTokens(TOKEN_TYPE_FORUM_GROUPS);
|
||||
mForumTokenQueue->cancelActiveRequestTokens(TOKEN_TYPE_FORUM_GROUPS);
|
||||
|
||||
uint32_t token;
|
||||
mTokenQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, TOKEN_TYPE_FORUM_GROUPS);
|
||||
mForumTokenQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, TOKEN_TYPE_FORUM_GROUPS);
|
||||
}
|
||||
|
||||
void AddFeedDialog::loadForumGroups(const uint32_t &token)
|
||||
|
@ -416,9 +525,50 @@ void AddFeedDialog::loadForumGroups(const uint32_t &token)
|
|||
}
|
||||
}
|
||||
|
||||
void AddFeedDialog::requestPostedGroups()
|
||||
{
|
||||
mStateHelper->setLoading(TOKEN_TYPE_POSTED_GROUPS, true);
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
|
||||
mPostedTokenQueue->cancelActiveRequestTokens(TOKEN_TYPE_POSTED_GROUPS);
|
||||
|
||||
uint32_t token;
|
||||
mPostedTokenQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, TOKEN_TYPE_POSTED_GROUPS);
|
||||
}
|
||||
|
||||
void AddFeedDialog::loadPostedGroups(const uint32_t &token)
|
||||
{
|
||||
std::vector<RsPostedGroup> groups;
|
||||
rsPosted->getGroupData(token, groups);
|
||||
|
||||
ui->postedComboBox->clear();
|
||||
|
||||
for (std::vector<RsPostedGroup>::iterator it = groups.begin(); it != groups.end(); ++it) {
|
||||
const RsPostedGroup &group = *it;
|
||||
|
||||
/* show only own posted */
|
||||
if (IS_GROUP_PUBLISHER(group.mMeta.mSubscribeFlags) && IS_GROUP_ADMIN(group.mMeta.mSubscribeFlags) && !group.mMeta.mAuthorId.isNull()) {
|
||||
ui->postedComboBox->addItem(QString::fromUtf8(group.mMeta.mGroupName.c_str()), QString::fromStdString(group.mMeta.mGroupId.toStdString()));
|
||||
}
|
||||
}
|
||||
|
||||
/* insert empty item */
|
||||
ui->postedComboBox->insertItem(0, "", "");
|
||||
ui->postedComboBox->setCurrentIndex(0);
|
||||
|
||||
mStateHelper->setLoading(TOKEN_TYPE_POSTED_GROUPS, false);
|
||||
|
||||
if (!mFillPostedId.empty()) {
|
||||
setActivePostedId(mFillPostedId);
|
||||
mFillPostedId.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void AddFeedDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
if (queue == mTokenQueue)
|
||||
if (queue == mForumTokenQueue)
|
||||
{
|
||||
/* now switch on req */
|
||||
switch(req.mUserType)
|
||||
|
@ -433,4 +583,20 @@ void AddFeedDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
if (queue == mPostedTokenQueue)
|
||||
{
|
||||
/* now switch on req */
|
||||
switch(req.mUserType)
|
||||
{
|
||||
case TOKEN_TYPE_POSTED_GROUPS:
|
||||
loadPostedGroups(req.mToken);
|
||||
break;
|
||||
|
||||
default:
|
||||
std::cerr << "AddFeedDialog::loadRequest() ERROR: INVALID TYPE";
|
||||
std::cerr << std::endl;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,10 @@ private slots:
|
|||
void useStandardUpdateIntervalToggled();
|
||||
void useStandardProxyToggled();
|
||||
void typeForumToggled();
|
||||
void denyForumToggled();
|
||||
void postedFirstImageToggled();
|
||||
void typePostedToggled();
|
||||
void typeLocalToggled();
|
||||
void denyForumAndPostedToggled();
|
||||
void validate();
|
||||
void createFeed();
|
||||
void preview();
|
||||
|
@ -63,9 +66,12 @@ private:
|
|||
void processSettings(bool load);
|
||||
void getFeedInfo(FeedInfo &feedInfo);
|
||||
void setActiveForumId(const std::string &forumId);
|
||||
void setActivePostedId(const std::string &postedId);
|
||||
|
||||
void requestForumGroups();
|
||||
void loadForumGroups(const uint32_t &token);
|
||||
void requestPostedGroups();
|
||||
void loadPostedGroups(const uint32_t &token);
|
||||
|
||||
private:
|
||||
RsFeedReader *mFeedReader;
|
||||
|
@ -73,13 +79,15 @@ private:
|
|||
uint32_t mFeedId;
|
||||
uint32_t mParentId;
|
||||
std::string mFillForumId;
|
||||
std::string mFillPostedId;
|
||||
|
||||
RsFeedTransformationType mTransformationType;
|
||||
std::list<std::string> mXPathsToUse;
|
||||
std::list<std::string> mXPathsToRemove;
|
||||
std::string mXslt;
|
||||
|
||||
TokenQueue *mTokenQueue;
|
||||
TokenQueue *mForumTokenQueue;
|
||||
TokenQueue *mPostedTokenQueue;
|
||||
UIStateHelper *mStateHelper;
|
||||
|
||||
Ui::AddFeedDialog *ui;
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
<property name="title">
|
||||
<string>Type</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
|
@ -63,27 +63,75 @@
|
|||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="typeForumRadio">
|
||||
<property name="text">
|
||||
<string>Forum</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="RSComboBox" name="forumComboBox"/>
|
||||
</item>
|
||||
</layout>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="typeForumCheckBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Forum</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="typeLocalRadio">
|
||||
<item row="0" column="1">
|
||||
<widget class="RSComboBox" name="forumComboBox"/>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QCheckBox" name="typeLocalCheckBox">
|
||||
<property name="text">
|
||||
<string>Local Feed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="updateForumInfoCheckBox">
|
||||
<property name="text">
|
||||
<string>Update forum information</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="RSComboBox" name="postedComboBox"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="typePostedCheckBox">
|
||||
<property name="text">
|
||||
<string>Board</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="updatePostedInfoCheckBox">
|
||||
<property name="text">
|
||||
<string>Update board information</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="postedOnlyImageCheckBox">
|
||||
<property name="text">
|
||||
<string>Only image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="postedFirstImageCheckBox">
|
||||
<property name="text">
|
||||
<string>Use first image as board image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -309,7 +357,6 @@
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
<weight>75</weight>
|
||||
<italic>true</italic>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
|
@ -377,13 +424,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="updateForumInfoCheckBox">
|
||||
<property name="text">
|
||||
<string>Update forum information</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="embedImagesCheckBox">
|
||||
<property name="text">
|
||||
|
@ -398,6 +438,19 @@
|
|||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
|
@ -423,22 +476,31 @@
|
|||
<tabstop>urlLineEdit</tabstop>
|
||||
<tabstop>nameLineEdit</tabstop>
|
||||
<tabstop>descriptionPlainTextEdit</tabstop>
|
||||
<tabstop>typeForumRadio</tabstop>
|
||||
<tabstop>typeForumCheckBox</tabstop>
|
||||
<tabstop>forumComboBox</tabstop>
|
||||
<tabstop>updateForumInfoCheckBox</tabstop>
|
||||
<tabstop>typePostedCheckBox</tabstop>
|
||||
<tabstop>postedComboBox</tabstop>
|
||||
<tabstop>updatePostedInfoCheckBox</tabstop>
|
||||
<tabstop>postedFirstImageCheckBox</tabstop>
|
||||
<tabstop>checkBox</tabstop>
|
||||
<tabstop>typeLocalCheckBox</tabstop>
|
||||
<tabstop>activatedCheckBox</tabstop>
|
||||
<tabstop>useInfoFromFeedCheckBox</tabstop>
|
||||
<tabstop>updateForumInfoCheckBox</tabstop>
|
||||
<tabstop>embedImagesCheckBox</tabstop>
|
||||
<tabstop>saveCompletePageCheckBox</tabstop>
|
||||
<tabstop>previewButton</tabstop>
|
||||
<tabstop>useAuthenticationCheckBox</tabstop>
|
||||
<tabstop>userLineEdit</tabstop>
|
||||
<tabstop>passwordLineEdit</tabstop>
|
||||
<tabstop>useStandardStorageTimeCheckBox</tabstop>
|
||||
<tabstop>clearCachePushButton</tabstop>
|
||||
<tabstop>storageTimeSpinBox</tabstop>
|
||||
<tabstop>useStandardUpdateInterval</tabstop>
|
||||
<tabstop>updateIntervalSpinBox</tabstop>
|
||||
<tabstop>useStandardProxyCheckBox</tabstop>
|
||||
<tabstop>proxyAddressLineEdit</tabstop>
|
||||
<tabstop>proxyPortSpinBox</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
|
|
@ -245,9 +245,19 @@ void FeedReaderMessageWidget::setFeedId(uint32_t feedId)
|
|||
ui->msgReadAllButton->setEnabled(false);
|
||||
ui->msgTreeWidget->setPlaceholderText("");
|
||||
} else {
|
||||
if (mFeedInfo.flag.forum) {
|
||||
if (mFeedInfo.flag.forum || mFeedInfo.flag.posted) {
|
||||
ui->msgReadAllButton->setEnabled(false);
|
||||
ui->msgTreeWidget->setPlaceholderText(tr("The messages will be added to the forum"));
|
||||
|
||||
if (mFeedInfo.flag.forum && mFeedInfo.flag.posted) {
|
||||
ui->msgTreeWidget->setPlaceholderText(tr("The messages will be added to the forum and the board"));
|
||||
} else {
|
||||
if (mFeedInfo.flag.forum) {
|
||||
ui->msgTreeWidget->setPlaceholderText(tr("The messages will be added to the forum"));
|
||||
}
|
||||
if (mFeedInfo.flag.posted) {
|
||||
ui->msgTreeWidget->setPlaceholderText(tr("The messages will be added to the board"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ui->msgReadAllButton->setEnabled(true);
|
||||
ui->msgTreeWidget->setPlaceholderText("");
|
||||
|
|
|
@ -109,9 +109,9 @@ QString FeedReaderStringDefs::errorString(RsFeedReaderErrorState errorState, con
|
|||
case RS_FEED_ERRORSTATE_PROCESS_UNKNOWN_FORMAT:
|
||||
errorText = QApplication::translate("FeedReaderStringDefs", "Unknown XML format");
|
||||
break;
|
||||
case RS_FEED_ERRORSTATE_PROCESS_FORUM_CREATE:
|
||||
errorText = QApplication::translate("FeedReaderStringDefs", "Can't create forum");
|
||||
break;
|
||||
// case RS_FEED_ERRORSTATE_PROCESS_FORUM_CREATE:
|
||||
// errorText = QApplication::translate("FeedReaderStringDefs", "Can't create forum");
|
||||
// break;
|
||||
case RS_FEED_ERRORSTATE_PROCESS_FORUM_NOT_FOUND:
|
||||
errorText = QApplication::translate("FeedReaderStringDefs", "Forum not found");
|
||||
break;
|
||||
|
@ -121,6 +121,18 @@ QString FeedReaderStringDefs::errorString(RsFeedReaderErrorState errorState, con
|
|||
case RS_FEED_ERRORSTATE_PROCESS_FORUM_NO_AUTHOR:
|
||||
errorText = QApplication::translate("FeedReaderStringDefs", "Forum has no author");
|
||||
break;
|
||||
// case RS_FEED_ERRORSTATE_PROCESS_POSTED_CREATE:
|
||||
// errorText = QApplication::translate("FeedReaderStringDefs", "Can't create board");
|
||||
// break;
|
||||
case RS_FEED_ERRORSTATE_PROCESS_POSTED_NOT_FOUND:
|
||||
errorText = QApplication::translate("FeedReaderStringDefs", "Board not found");
|
||||
break;
|
||||
case RS_FEED_ERRORSTATE_PROCESS_POSTED_NO_ADMIN:
|
||||
errorText = QApplication::translate("FeedReaderStringDefs", "You are not admin of the board");
|
||||
break;
|
||||
case RS_FEED_ERRORSTATE_PROCESS_POSTED_NO_AUTHOR:
|
||||
errorText = QApplication::translate("FeedReaderStringDefs", "Board has no author");
|
||||
break;
|
||||
|
||||
case RS_FEED_ERRORSTATE_PROCESS_HTML_ERROR:
|
||||
errorText = QApplication::translate("FeedReaderStringDefs", "Can't read html");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue