work on article amount limitting
This commit is contained in:
parent
b73acd47da
commit
fb62f66445
@ -109,6 +109,8 @@ set(SOURCES
|
|||||||
gui/notifications/toastnotification.h
|
gui/notifications/toastnotification.h
|
||||||
gui/notifications/toastnotificationsmanager.cpp
|
gui/notifications/toastnotificationsmanager.cpp
|
||||||
gui/notifications/toastnotificationsmanager.h
|
gui/notifications/toastnotificationsmanager.h
|
||||||
|
gui/reusable/articleamountcontrol.cpp
|
||||||
|
gui/reusable/articleamountcontrol.h
|
||||||
gui/reusable/baselineedit.cpp
|
gui/reusable/baselineedit.cpp
|
||||||
gui/reusable/baselineedit.h
|
gui/reusable/baselineedit.h
|
||||||
gui/reusable/basetreeview.cpp
|
gui/reusable/basetreeview.cpp
|
||||||
@ -171,12 +173,12 @@ set(SOURCES
|
|||||||
gui/settings/settingsfeedsmessages.h
|
gui/settings/settingsfeedsmessages.h
|
||||||
gui/settings/settingsgeneral.cpp
|
gui/settings/settingsgeneral.cpp
|
||||||
gui/settings/settingsgeneral.h
|
gui/settings/settingsgeneral.h
|
||||||
gui/settings/settingsmediaplayer.cpp
|
|
||||||
gui/settings/settingsmediaplayer.h
|
|
||||||
gui/settings/settingsgui.cpp
|
gui/settings/settingsgui.cpp
|
||||||
gui/settings/settingsgui.h
|
gui/settings/settingsgui.h
|
||||||
gui/settings/settingslocalization.cpp
|
gui/settings/settingslocalization.cpp
|
||||||
gui/settings/settingslocalization.h
|
gui/settings/settingslocalization.h
|
||||||
|
gui/settings/settingsmediaplayer.cpp
|
||||||
|
gui/settings/settingsmediaplayer.h
|
||||||
gui/settings/settingsnodejs.cpp
|
gui/settings/settingsnodejs.cpp
|
||||||
gui/settings/settingsnodejs.h
|
gui/settings/settingsnodejs.h
|
||||||
gui/settings/settingsnotifications.cpp
|
gui/settings/settingsnotifications.cpp
|
||||||
@ -251,6 +253,8 @@ set(SOURCES
|
|||||||
network-web/adblock/adblockmanager.h
|
network-web/adblock/adblockmanager.h
|
||||||
network-web/adblock/adblockrequestinfo.cpp
|
network-web/adblock/adblockrequestinfo.cpp
|
||||||
network-web/adblock/adblockrequestinfo.h
|
network-web/adblock/adblockrequestinfo.h
|
||||||
|
network-web/apiserver.cpp
|
||||||
|
network-web/apiserver.h
|
||||||
network-web/basenetworkaccessmanager.cpp
|
network-web/basenetworkaccessmanager.cpp
|
||||||
network-web/basenetworkaccessmanager.h
|
network-web/basenetworkaccessmanager.h
|
||||||
network-web/cookiejar.cpp
|
network-web/cookiejar.cpp
|
||||||
@ -261,8 +265,6 @@ set(SOURCES
|
|||||||
network-web/downloadmanager.h
|
network-web/downloadmanager.h
|
||||||
network-web/googlesuggest.cpp
|
network-web/googlesuggest.cpp
|
||||||
network-web/googlesuggest.h
|
network-web/googlesuggest.h
|
||||||
network-web/apiserver.cpp
|
|
||||||
network-web/apiserver.h
|
|
||||||
network-web/httpresponse.cpp
|
network-web/httpresponse.cpp
|
||||||
network-web/httpresponse.h
|
network-web/httpresponse.h
|
||||||
network-web/httpserver.cpp
|
network-web/httpserver.cpp
|
||||||
@ -355,18 +357,18 @@ set(SOURCES
|
|||||||
services/greader/definitions.h
|
services/greader/definitions.h
|
||||||
services/greader/greaderentrypoint.cpp
|
services/greader/greaderentrypoint.cpp
|
||||||
services/greader/greaderentrypoint.h
|
services/greader/greaderentrypoint.h
|
||||||
|
services/greader/greaderfeed.cpp
|
||||||
|
services/greader/greaderfeed.h
|
||||||
services/greader/greadernetwork.cpp
|
services/greader/greadernetwork.cpp
|
||||||
services/greader/greadernetwork.h
|
services/greader/greadernetwork.h
|
||||||
services/greader/greaderserviceroot.cpp
|
services/greader/greaderserviceroot.cpp
|
||||||
services/greader/greaderserviceroot.h
|
services/greader/greaderserviceroot.h
|
||||||
services/greader/greaderfeed.cpp
|
|
||||||
services/greader/greaderfeed.h
|
|
||||||
services/greader/gui/formeditgreaderaccount.cpp
|
services/greader/gui/formeditgreaderaccount.cpp
|
||||||
services/greader/gui/formeditgreaderaccount.h
|
services/greader/gui/formeditgreaderaccount.h
|
||||||
services/greader/gui/greaderaccountdetails.cpp
|
|
||||||
services/greader/gui/greaderaccountdetails.h
|
|
||||||
services/greader/gui/formgreaderfeeddetails.cpp
|
services/greader/gui/formgreaderfeeddetails.cpp
|
||||||
services/greader/gui/formgreaderfeeddetails.h
|
services/greader/gui/formgreaderfeeddetails.h
|
||||||
|
services/greader/gui/greaderaccountdetails.cpp
|
||||||
|
services/greader/gui/greaderaccountdetails.h
|
||||||
services/greader/gui/greaderfeeddetails.cpp
|
services/greader/gui/greaderfeeddetails.cpp
|
||||||
services/greader/gui/greaderfeeddetails.h
|
services/greader/gui/greaderfeeddetails.h
|
||||||
services/owncloud/definitions.h
|
services/owncloud/definitions.h
|
||||||
@ -406,10 +408,10 @@ set(SOURCES
|
|||||||
services/standard/gui/formstandardfeeddetails.h
|
services/standard/gui/formstandardfeeddetails.h
|
||||||
services/standard/gui/formstandardimportexport.cpp
|
services/standard/gui/formstandardimportexport.cpp
|
||||||
services/standard/gui/formstandardimportexport.h
|
services/standard/gui/formstandardimportexport.h
|
||||||
services/standard/gui/standardfeeddetails.cpp
|
|
||||||
services/standard/gui/standardfeeddetails.h
|
|
||||||
services/standard/gui/standardaccountdetails.cpp
|
services/standard/gui/standardaccountdetails.cpp
|
||||||
services/standard/gui/standardaccountdetails.h
|
services/standard/gui/standardaccountdetails.h
|
||||||
|
services/standard/gui/standardfeeddetails.cpp
|
||||||
|
services/standard/gui/standardfeeddetails.h
|
||||||
services/standard/parsers/atomparser.cpp
|
services/standard/parsers/atomparser.cpp
|
||||||
services/standard/parsers/atomparser.h
|
services/standard/parsers/atomparser.h
|
||||||
services/standard/parsers/feedparser.cpp
|
services/standard/parsers/feedparser.cpp
|
||||||
@ -470,6 +472,7 @@ set(UI_FILES
|
|||||||
gui/notifications/notificationseditor.ui
|
gui/notifications/notificationseditor.ui
|
||||||
gui/notifications/singlenotificationeditor.ui
|
gui/notifications/singlenotificationeditor.ui
|
||||||
gui/notifications/toastnotification.ui
|
gui/notifications/toastnotification.ui
|
||||||
|
gui/reusable/articleamountcontrol.ui
|
||||||
gui/reusable/networkproxydetails.ui
|
gui/reusable/networkproxydetails.ui
|
||||||
gui/reusable/searchtextwidget.ui
|
gui/reusable/searchtextwidget.ui
|
||||||
gui/richtexteditor/mrichtextedit.ui
|
gui/richtexteditor/mrichtextedit.ui
|
||||||
@ -480,10 +483,10 @@ set(UI_FILES
|
|||||||
gui/settings/settingsgeneral.ui
|
gui/settings/settingsgeneral.ui
|
||||||
gui/settings/settingsgui.ui
|
gui/settings/settingsgui.ui
|
||||||
gui/settings/settingslocalization.ui
|
gui/settings/settingslocalization.ui
|
||||||
|
gui/settings/settingsmediaplayer.ui
|
||||||
gui/settings/settingsnodejs.ui
|
gui/settings/settingsnodejs.ui
|
||||||
gui/settings/settingsnotifications.ui
|
gui/settings/settingsnotifications.ui
|
||||||
gui/settings/settingsshortcuts.ui
|
gui/settings/settingsshortcuts.ui
|
||||||
gui/settings/settingsmediaplayer.ui
|
|
||||||
gui/toolbars/toolbareditor.ui
|
gui/toolbars/toolbareditor.ui
|
||||||
network-web/adblock/adblockdialog.ui
|
network-web/adblock/adblockdialog.ui
|
||||||
network-web/downloaditem.ui
|
network-web/downloaditem.ui
|
||||||
@ -505,8 +508,8 @@ set(UI_FILES
|
|||||||
services/reddit/gui/redditaccountdetails.ui
|
services/reddit/gui/redditaccountdetails.ui
|
||||||
services/standard/gui/formdiscoverfeeds.ui
|
services/standard/gui/formdiscoverfeeds.ui
|
||||||
services/standard/gui/formstandardimportexport.ui
|
services/standard/gui/formstandardimportexport.ui
|
||||||
services/standard/gui/standardfeeddetails.ui
|
|
||||||
services/standard/gui/standardaccountdetails.ui
|
services/standard/gui/standardaccountdetails.ui
|
||||||
|
services/standard/gui/standardfeeddetails.ui
|
||||||
services/tt-rss/gui/formttrssnote.ui
|
services/tt-rss/gui/formttrssnote.ui
|
||||||
services/tt-rss/gui/ttrssaccountdetails.ui
|
services/tt-rss/gui/ttrssaccountdetails.ui
|
||||||
services/tt-rss/gui/ttrssfeeddetails.ui
|
services/tt-rss/gui/ttrssfeeddetails.ui
|
||||||
|
@ -39,6 +39,7 @@ FormSettings::FormSettings(QWidget& parent) : QDialog(&parent), m_settings(*qApp
|
|||||||
// Establish needed connections.
|
// Establish needed connections.
|
||||||
connect(m_ui.m_buttonBox, &QDialogButtonBox::accepted, this, &FormSettings::saveSettings);
|
connect(m_ui.m_buttonBox, &QDialogButtonBox::accepted, this, &FormSettings::saveSettings);
|
||||||
connect(m_ui.m_buttonBox, &QDialogButtonBox::rejected, this, &FormSettings::cancelSettings);
|
connect(m_ui.m_buttonBox, &QDialogButtonBox::rejected, this, &FormSettings::cancelSettings);
|
||||||
|
|
||||||
connect(m_btnApply, &QPushButton::clicked, this, &FormSettings::applySettings);
|
connect(m_btnApply, &QPushButton::clicked, this, &FormSettings::applySettings);
|
||||||
connect(m_ui.m_listSettings, &QListWidget::currentRowChanged, this, &FormSettings::openSettingsCategory);
|
connect(m_ui.m_listSettings, &QListWidget::currentRowChanged, this, &FormSettings::openSettingsCategory);
|
||||||
|
|
||||||
@ -65,6 +66,10 @@ FormSettings::~FormSettings() {
|
|||||||
qDebugNN << LOGSEC_GUI << "Destroying FormSettings distance.";
|
qDebugNN << LOGSEC_GUI << "Destroying FormSettings distance.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FormSettings::reject() {
|
||||||
|
m_ui.m_buttonBox->button(QDialogButtonBox::StandardButton::Cancel)->click();
|
||||||
|
}
|
||||||
|
|
||||||
void FormSettings::openSettingsCategory(int category) {
|
void FormSettings::openSettingsCategory(int category) {
|
||||||
if (category >= 0 && category < m_panels.size()) {
|
if (category >= 0 && category < m_panels.size()) {
|
||||||
if (!m_panels.at(category)->isLoaded()) {
|
if (!m_panels.at(category)->isLoaded()) {
|
||||||
@ -130,7 +135,7 @@ void FormSettings::cancelSettings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (changed_panels.isEmpty()) {
|
if (changed_panels.isEmpty()) {
|
||||||
reject();
|
done(QDialog::DialogCode::Rejected);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const QStringList changed_settings_description =
|
const QStringList changed_settings_description =
|
||||||
@ -144,7 +149,7 @@ void FormSettings::cancelSettings() {
|
|||||||
tr("Changed categories of settings:\n%1.").arg(changed_settings_description.join(QSL(",\n"))),
|
tr("Changed categories of settings:\n%1.").arg(changed_settings_description.join(QSL(",\n"))),
|
||||||
QMessageBox::StandardButton::Yes | QMessageBox::StandardButton::No,
|
QMessageBox::StandardButton::Yes | QMessageBox::StandardButton::No,
|
||||||
QMessageBox::StandardButton::Yes) == QMessageBox::StandardButton::Yes) {
|
QMessageBox::StandardButton::Yes) == QMessageBox::StandardButton::Yes) {
|
||||||
reject();
|
done(QDialog::DialogCode::Rejected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,14 +11,16 @@ class Settings;
|
|||||||
class SettingsPanel;
|
class SettingsPanel;
|
||||||
|
|
||||||
class FormSettings : public QDialog {
|
class FormSettings : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors and destructors.
|
// Constructors and destructors.
|
||||||
explicit FormSettings(QWidget& parent);
|
explicit FormSettings(QWidget& parent);
|
||||||
virtual ~FormSettings();
|
virtual ~FormSettings();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void reject();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void openSettingsCategory(int category);
|
void openSettingsCategory(int category);
|
||||||
|
|
||||||
|
124
src/librssguard/gui/reusable/articleamountcontrol.cpp
Normal file
124
src/librssguard/gui/reusable/articleamountcontrol.cpp
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
// For license of this file, see <project-root-folder>/LICENSE.md.
|
||||||
|
|
||||||
|
#include "articleamountcontrol.h"
|
||||||
|
|
||||||
|
#include "miscellaneous/application.h"
|
||||||
|
|
||||||
|
ArticleAmountControl::ArticleAmountControl(QWidget* parent) : QWidget(parent) {
|
||||||
|
m_ui.setupUi(this);
|
||||||
|
|
||||||
|
m_ui.m_helpIgnoring
|
||||||
|
->setHelpText(tr("Setting any limitations here will instruct %1 to ignore "
|
||||||
|
"some incoming articles. The logic runs AFTER any article filters so even if your article filter "
|
||||||
|
"accepts particular article, it can still subsequently ignored and not added to database.")
|
||||||
|
.arg(QSL(APP_NAME)),
|
||||||
|
false);
|
||||||
|
m_ui.m_helpLimit->setHelpText(tr("All excessive articles are removed automatically by the application, usually when "
|
||||||
|
"particular feed is fetched. Articles are either completely purged from internal "
|
||||||
|
"database or are just moved to recycle bin."),
|
||||||
|
false);
|
||||||
|
|
||||||
|
m_ui.m_spinArticleCount->setSpecialValueText(tr("all articles"));
|
||||||
|
m_ui.m_cbAddAnyDateArticles->setChecked(true);
|
||||||
|
m_ui.m_dtDateTimeToAvoid->setEnabled(false);
|
||||||
|
m_ui.m_spinHoursAvoid->setEnabled(false);
|
||||||
|
m_ui.m_spinHoursAvoid->setMode(TimeSpinBox::Mode::DaysHours);
|
||||||
|
m_ui.m_dtDateTimeToAvoid
|
||||||
|
->setDisplayFormat(qApp->localization()->loadedLocale().dateTimeFormat(QLocale::FormatType::ShortFormat));
|
||||||
|
|
||||||
|
// Ignoring articles.
|
||||||
|
connect(m_ui.m_cbAddAnyDateArticles, &QCheckBox::toggled, this, &ArticleAmountControl::changed);
|
||||||
|
connect(m_ui.m_gbAvoidOldArticles, &QGroupBox::toggled, this, &ArticleAmountControl::changed);
|
||||||
|
connect(m_ui.m_dtDateTimeToAvoid, &QDateTimeEdit::dateTimeChanged, this, &ArticleAmountControl::changed);
|
||||||
|
connect(m_ui.m_spinHoursAvoid,
|
||||||
|
QOverload<double>::of(&TimeSpinBox::valueChanged),
|
||||||
|
this,
|
||||||
|
&ArticleAmountControl::changed);
|
||||||
|
connect(m_ui.m_rbAvoidAbsolute, &QRadioButton::toggled, this, &ArticleAmountControl::changed);
|
||||||
|
connect(m_ui.m_rbAvoidRelative, &QRadioButton::toggled, this, &ArticleAmountControl::changed);
|
||||||
|
|
||||||
|
// Limitting articles.
|
||||||
|
connect(m_ui.m_spinArticleCount,
|
||||||
|
QOverload<int>::of(&QSpinBox::valueChanged),
|
||||||
|
this,
|
||||||
|
&ArticleAmountControl::updateArticleCountSuffix);
|
||||||
|
connect(m_ui.m_spinArticleCount, &QSpinBox::valueChanged, this, &ArticleAmountControl::changed);
|
||||||
|
connect(m_ui.m_cbMoveToBinNoPurge, &QCheckBox::toggled, this, &ArticleAmountControl::changed);
|
||||||
|
connect(m_ui.m_cbNoRemoveImportant, &QCheckBox::toggled, this, &ArticleAmountControl::changed);
|
||||||
|
connect(m_ui.m_cbNoRemoveUnread, &QCheckBox::toggled, this, &ArticleAmountControl::changed);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ArticleAmountControl::setForAppWideFeatures(bool app_wide, bool batch_edit) {
|
||||||
|
if (app_wide) {
|
||||||
|
m_ui.m_cbAddAnyDateArticles->setVisible(false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
connect(m_ui.m_cbAddAnyDateArticles, &QCheckBox::toggled, m_ui.m_gbAvoidOldArticles, &QGroupBox::setEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (batch_edit) {
|
||||||
|
// We hook batch selectors.
|
||||||
|
/*
|
||||||
|
m_ui.m_mcbAutoDownloading->addActionWidget(m_ui.m_wdgAutoUpdate);
|
||||||
|
m_ui.m_mcbAddAnyDateArticles->addActionWidget(m_ui.m_cbAddAnyDateArticles);
|
||||||
|
m_ui.m_mcbOpenArticlesAutomatically->addActionWidget(m_ui.m_cbOpenArticlesAutomatically);
|
||||||
|
m_ui.m_mcbAvoidOldArticles->addActionWidget(m_ui.m_gbAvoidOldArticles);
|
||||||
|
m_ui.m_mcbDisableFeed->addActionWidget(m_ui.m_cbDisableFeed);
|
||||||
|
m_ui.m_mcbSuppressFeed->addActionWidget(m_ui.m_cbSuppressFeed);
|
||||||
|
m_ui.m_mcbFeedRtl->addActionWidget(m_ui.m_cbFeedRTL);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// We hide batch selectors.
|
||||||
|
for (auto* cb : findChildren<MultiFeedEditCheckBox*>()) {
|
||||||
|
cb->hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ArticleAmountControl::load(const Setup& setup) {
|
||||||
|
// Ignoring articles.
|
||||||
|
if (setup.m_dtToAvoid.isValid() && setup.m_dtToAvoid.toMSecsSinceEpoch() > 0) {
|
||||||
|
m_ui.m_rbAvoidAbsolute->setChecked(true);
|
||||||
|
m_ui.m_dtDateTimeToAvoid->setDateTime(setup.m_dtToAvoid);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_ui.m_rbAvoidRelative->setChecked(true);
|
||||||
|
m_ui.m_spinHoursAvoid->setValue(setup.m_hoursToAvoid);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ui.m_gbAvoidOldArticles->setChecked(setup.m_avoidOldArticles);
|
||||||
|
|
||||||
|
// Limitting articles.
|
||||||
|
m_ui.m_spinArticleCount->setValue(setup.m_keepCountOfArticles);
|
||||||
|
m_ui.m_cbMoveToBinNoPurge->setChecked(setup.m_moveToBinDontPurge);
|
||||||
|
m_ui.m_cbNoRemoveImportant->setChecked(setup.m_doNotRemoveStarred);
|
||||||
|
m_ui.m_cbNoRemoveUnread->setChecked(setup.m_doNotRemoveUnread);
|
||||||
|
}
|
||||||
|
|
||||||
|
ArticleAmountControl::Setup ArticleAmountControl::save() const {
|
||||||
|
Setup setup;
|
||||||
|
|
||||||
|
// Ignoring articles.
|
||||||
|
setup.m_addAnyArticlesToDb = m_ui.m_cbAddAnyDateArticles->isChecked();
|
||||||
|
setup.m_avoidOldArticles = m_ui.m_gbAvoidOldArticles->isChecked();
|
||||||
|
|
||||||
|
if (m_ui.m_rbAvoidAbsolute->isChecked()) {
|
||||||
|
setup.m_dtToAvoid = m_ui.m_dtDateTimeToAvoid->dateTime();
|
||||||
|
}
|
||||||
|
else if (m_ui.m_rbAvoidRelative->isChecked()) {
|
||||||
|
setup.m_hoursToAvoid = int(m_ui.m_spinHoursAvoid->value());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Limitting articles.
|
||||||
|
setup.m_keepCountOfArticles = m_ui.m_spinArticleCount->value();
|
||||||
|
setup.m_moveToBinDontPurge = m_ui.m_cbMoveToBinNoPurge->isChecked();
|
||||||
|
setup.m_doNotRemoveStarred = m_ui.m_cbNoRemoveImportant->isChecked();
|
||||||
|
setup.m_doNotRemoveUnread = m_ui.m_cbNoRemoveUnread->isChecked();
|
||||||
|
|
||||||
|
return setup;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ArticleAmountControl::updateArticleCountSuffix(int count) {
|
||||||
|
m_ui.m_spinArticleCount->setSuffix(QSL(" ") + tr("newest article(s)", nullptr, count));
|
||||||
|
}
|
45
src/librssguard/gui/reusable/articleamountcontrol.h
Normal file
45
src/librssguard/gui/reusable/articleamountcontrol.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
// For license of this file, see <project-root-folder>/LICENSE.md.
|
||||||
|
|
||||||
|
#ifndef ARTICLEAMOUNTCONTROL_H
|
||||||
|
#define ARTICLEAMOUNTCONTROL_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
#include "ui_articleamountcontrol.h"
|
||||||
|
|
||||||
|
class ArticleAmountControl : public QWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
struct Setup {
|
||||||
|
// Ignoring articles.
|
||||||
|
bool m_avoidOldArticles = false;
|
||||||
|
bool m_addAnyArticlesToDb = false;
|
||||||
|
QDateTime m_dtToAvoid = QDateTime();
|
||||||
|
int m_hoursToAvoid = 0;
|
||||||
|
|
||||||
|
// Limitting articles.
|
||||||
|
int m_keepCountOfArticles = 0;
|
||||||
|
bool m_doNotRemoveStarred = true;
|
||||||
|
bool m_doNotRemoveUnread = true;
|
||||||
|
bool m_moveToBinDontPurge = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
explicit ArticleAmountControl(QWidget* parent = nullptr);
|
||||||
|
|
||||||
|
void setForAppWideFeatures(bool app_wide, bool batch_edit);
|
||||||
|
|
||||||
|
void load(const Setup& setup);
|
||||||
|
Setup save() const;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void updateArticleCountSuffix(int count);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::ArticleAmountControl m_ui;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void changed();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ARTICLEAMOUNTCONTROL_H
|
314
src/librssguard/gui/reusable/articleamountcontrol.ui
Normal file
314
src/librssguard/gui/reusable/articleamountcontrol.ui
Normal file
@ -0,0 +1,314 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>ArticleAmountControl</class>
|
||||||
|
<widget class="QWidget" name="ArticleAmountControl">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>402</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="m_tabIgnore">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Ignoring old articles</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QFormLayout" name="formLayout_2">
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="MultiFeedEditCheckBox" name="m_mcbAvoidOldArticles_2"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="m_cbAddAnyDateArticles">
|
||||||
|
<property name="text">
|
||||||
|
<string>Add articles with any date into the database</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="MultiFeedEditCheckBox" name="m_mcbAvoidOldArticles"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="m_wdgAvoidOldArticles" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="m_gbAvoidOldArticles">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Avoid adding articles before this date/time into the database</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QRadioButton" name="m_rbAvoidAbsolute">
|
||||||
|
<property name="text">
|
||||||
|
<string>Absolute date/time</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QRadioButton" name="m_rbAvoidRelative">
|
||||||
|
<property name="text">
|
||||||
|
<string>Relative time</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QDateTimeEdit" name="m_dtDateTimeToAvoid">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumDate">
|
||||||
|
<date>
|
||||||
|
<year>1971</year>
|
||||||
|
<month>1</month>
|
||||||
|
<day>1</day>
|
||||||
|
</date>
|
||||||
|
</property>
|
||||||
|
<property name="calendarPopup">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="TimeSpinBox" name="m_spinHoursAvoid">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>10000.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="HelpSpoiler" name="m_helpIgnoring" native="true"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="m_tabLimit">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Limiting amount of article in feeds</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="MultiFeedEditCheckBox" name="m_mcbAvoidOldArticles_3"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>In database, keep</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="m_spinArticleCount">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>100000</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
|
<item>
|
||||||
|
<widget class="MultiFeedEditCheckBox" name="m_mcbAvoidOldArticles_4"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="m_cbNoRemoveImportant">
|
||||||
|
<property name="text">
|
||||||
|
<string>Do not remove important articles</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||||
|
<item>
|
||||||
|
<widget class="MultiFeedEditCheckBox" name="m_mcbAvoidOldArticles_5"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="m_cbNoRemoveUnread">
|
||||||
|
<property name="text">
|
||||||
|
<string>Do not remove unread articles</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0" colspan="2">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||||
|
<item>
|
||||||
|
<widget class="MultiFeedEditCheckBox" name="m_mcbAvoidOldArticles_6"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="m_cbMoveToBinNoPurge">
|
||||||
|
<property name="text">
|
||||||
|
<string>Just move articles to recycle bin, do not purge them</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" colspan="2">
|
||||||
|
<widget class="HelpSpoiler" name="m_helpLimit" native="true"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>TimeSpinBox</class>
|
||||||
|
<extends>QDoubleSpinBox</extends>
|
||||||
|
<header>timespinbox.h</header>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>MultiFeedEditCheckBox</class>
|
||||||
|
<extends>QCheckBox</extends>
|
||||||
|
<header>multifeededitcheckbox.h</header>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>HelpSpoiler</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>helpspoiler.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>m_rbAvoidAbsolute</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>m_dtDateTimeToAvoid</receiver>
|
||||||
|
<slot>setEnabled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>83</x>
|
||||||
|
<y>117</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>231</x>
|
||||||
|
<y>117</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>m_rbAvoidRelative</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>m_spinHoursAvoid</receiver>
|
||||||
|
<slot>setEnabled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>83</x>
|
||||||
|
<y>166</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>231</x>
|
||||||
|
<y>166</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
@ -22,10 +22,11 @@ SettingsFeedsMessages::SettingsFeedsMessages(Settings* settings, QWidget* parent
|
|||||||
: SettingsPanel(settings, parent), m_ui(new Ui::SettingsFeedsMessages) {
|
: SettingsPanel(settings, parent), m_ui(new Ui::SettingsFeedsMessages) {
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
m_ui->m_spinHoursAvoid->setMode(TimeSpinBox::Mode::DaysHours);
|
|
||||||
m_ui->m_spinAutoUpdateInterval->setMode(TimeSpinBox::Mode::MinutesSeconds);
|
m_ui->m_spinAutoUpdateInterval->setMode(TimeSpinBox::Mode::MinutesSeconds);
|
||||||
m_ui->m_spinStartupUpdateDelay->setMode(TimeSpinBox::Mode::MinutesSeconds);
|
m_ui->m_spinStartupUpdateDelay->setMode(TimeSpinBox::Mode::MinutesSeconds);
|
||||||
|
|
||||||
|
m_ui->m_wdgArticleLimiting->setForAppWideFeatures(true, false);
|
||||||
|
|
||||||
initializeMessageDateFormats();
|
initializeMessageDateFormats();
|
||||||
|
|
||||||
m_ui->m_helpCountsFeedsFormat
|
m_ui->m_helpCountsFeedsFormat
|
||||||
@ -201,17 +202,7 @@ SettingsFeedsMessages::SettingsFeedsMessages(Settings* settings, QWidget* parent
|
|||||||
m_ui->m_spinFeedUpdateTimeout->setSuffix(QSL(" ") + m_ui->m_spinFeedUpdateTimeout->suffix());
|
m_ui->m_spinFeedUpdateTimeout->setSuffix(QSL(" ") + m_ui->m_spinFeedUpdateTimeout->suffix());
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ui->m_dtDateTimeToAvoid
|
connect(m_ui->m_wdgArticleLimiting, &ArticleAmountControl::changed, this, &SettingsFeedsMessages::dirtifySettings);
|
||||||
->setDisplayFormat(qApp->localization()->loadedLocale().dateTimeFormat(QLocale::FormatType::ShortFormat));
|
|
||||||
|
|
||||||
connect(m_ui->m_gbAvoidOldArticles, &QGroupBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
|
||||||
connect(m_ui->m_dtDateTimeToAvoid, &QDateTimeEdit::dateTimeChanged, this, &SettingsFeedsMessages::dirtifySettings);
|
|
||||||
connect(m_ui->m_spinHoursAvoid,
|
|
||||||
QOverload<double>::of(&TimeSpinBox::valueChanged),
|
|
||||||
this,
|
|
||||||
&SettingsFeedsMessages::dirtifySettings);
|
|
||||||
connect(m_ui->m_rbAvoidAbsolute, &QRadioButton::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
|
||||||
connect(m_ui->m_rbAvoidAbsolute, &QRadioButton::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
|
||||||
|
|
||||||
m_ui->m_spinRelativeArticleTime->setValue(-1);
|
m_ui->m_spinRelativeArticleTime->setValue(-1);
|
||||||
}
|
}
|
||||||
@ -292,25 +283,20 @@ void SettingsFeedsMessages::loadSettings() {
|
|||||||
->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::UseLegacyArticleFormat)).toBool());
|
->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::UseLegacyArticleFormat)).toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ui->m_dtDateTimeToAvoid->setEnabled(false);
|
ArticleAmountControl::Setup art_limit;
|
||||||
m_ui->m_spinHoursAvoid->setEnabled(false);
|
art_limit.m_avoidOldArticles = settings()->value(GROUP(Messages), SETTING(Messages::AvoidOldArticles)).toBool();
|
||||||
|
art_limit.m_dtToAvoid = settings()->value(GROUP(Messages), SETTING(Messages::DateTimeToAvoidArticle)).toDateTime();
|
||||||
|
art_limit.m_hoursToAvoid = settings()->value(GROUP(Messages), SETTING(Messages::HoursToAvoidArticle)).toInt();
|
||||||
|
|
||||||
QDateTime avoid_dt_barrier =
|
art_limit.m_doNotRemoveStarred =
|
||||||
settings()->value(GROUP(Messages), SETTING(Messages::DateTimeToAvoidArticle)).toDateTime();
|
settings()->value(GROUP(Messages), SETTING(Messages::LimitDoNotRemoveStarred)).toBool();
|
||||||
int avoid_hour_barrier = settings()->value(GROUP(Messages), SETTING(Messages::HoursToAvoidArticle)).toInt();
|
art_limit.m_doNotRemoveUnread =
|
||||||
|
settings()->value(GROUP(Messages), SETTING(Messages::LimitDoNotRemoveUnread)).toBool();
|
||||||
|
art_limit.m_keepCountOfArticles = settings()->value(GROUP(Messages), SETTING(Messages::LimitCountOfArticles)).toInt();
|
||||||
|
art_limit.m_moveToBinDontPurge =
|
||||||
|
settings()->value(GROUP(Messages), SETTING(Messages::LimitRecycleInsteadOfPurging)).toBool();
|
||||||
|
|
||||||
if (avoid_dt_barrier.isValid() && avoid_dt_barrier.toMSecsSinceEpoch() > 0) {
|
m_ui->m_wdgArticleLimiting->load(art_limit);
|
||||||
m_ui->m_rbAvoidAbsolute->setChecked(true);
|
|
||||||
m_ui->m_dtDateTimeToAvoid
|
|
||||||
->setDateTime(settings()->value(GROUP(Messages), SETTING(Messages::DateTimeToAvoidArticle)).toDateTime());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
m_ui->m_rbAvoidRelative->setChecked(true);
|
|
||||||
m_ui->m_spinHoursAvoid->setValue(avoid_hour_barrier);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_ui->m_gbAvoidOldArticles
|
|
||||||
->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::AvoidOldArticles)).toBool());
|
|
||||||
|
|
||||||
m_ui->m_cmbFastAutoUpdate->setChecked(settings()->value(GROUP(Feeds), SETTING(Feeds::FastAutoUpdate)).toBool());
|
m_ui->m_cmbFastAutoUpdate->setChecked(settings()->value(GROUP(Feeds), SETTING(Feeds::FastAutoUpdate)).toBool());
|
||||||
m_ui->m_checkUpdateAllFeedsOnStartup
|
m_ui->m_checkUpdateAllFeedsOnStartup
|
||||||
@ -421,22 +407,22 @@ void SettingsFeedsMessages::saveSettings() {
|
|||||||
settings()->setValue(GROUP(Feeds), Feeds::AutoUpdateInterval, m_ui->m_spinAutoUpdateInterval->value());
|
settings()->setValue(GROUP(Feeds), Feeds::AutoUpdateInterval, m_ui->m_spinAutoUpdateInterval->value());
|
||||||
settings()->setValue(GROUP(Feeds), Feeds::UpdateTimeout, m_ui->m_spinFeedUpdateTimeout->value());
|
settings()->setValue(GROUP(Feeds), Feeds::UpdateTimeout, m_ui->m_spinFeedUpdateTimeout->value());
|
||||||
|
|
||||||
settings()->setValue(GROUP(Messages), Messages::AvoidOldArticles, m_ui->m_gbAvoidOldArticles->isChecked());
|
|
||||||
|
|
||||||
if (qApp->usingLite()) {
|
if (qApp->usingLite()) {
|
||||||
settings()->setValue(GROUP(Messages),
|
settings()->setValue(GROUP(Messages),
|
||||||
Messages::UseLegacyArticleFormat,
|
Messages::UseLegacyArticleFormat,
|
||||||
m_ui->m_cbLegacyArticleFormatting->isChecked());
|
m_ui->m_cbLegacyArticleFormatting->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_ui->m_rbAvoidAbsolute->isChecked()) {
|
ArticleAmountControl::Setup art_limit = m_ui->m_wdgArticleLimiting->save();
|
||||||
settings()->setValue(GROUP(Messages), Messages::DateTimeToAvoidArticle, m_ui->m_dtDateTimeToAvoid->dateTime());
|
|
||||||
settings()->setValue(GROUP(Messages), Messages::HoursToAvoidArticle, 0);
|
settings()->setValue(GROUP(Messages), Messages::AvoidOldArticles, art_limit.m_avoidOldArticles);
|
||||||
}
|
settings()->setValue(GROUP(Messages), Messages::DateTimeToAvoidArticle, art_limit.m_dtToAvoid);
|
||||||
else if (m_ui->m_rbAvoidRelative->isChecked()) {
|
settings()->setValue(GROUP(Messages), Messages::HoursToAvoidArticle, art_limit.m_hoursToAvoid);
|
||||||
settings()->setValue(GROUP(Messages), Messages::DateTimeToAvoidArticle, QDateTime());
|
|
||||||
settings()->setValue(GROUP(Messages), Messages::HoursToAvoidArticle, m_ui->m_spinHoursAvoid->value());
|
settings()->setValue(GROUP(Messages), Messages::LimitDoNotRemoveStarred, art_limit.m_doNotRemoveStarred);
|
||||||
}
|
settings()->setValue(GROUP(Messages), Messages::LimitDoNotRemoveUnread, art_limit.m_doNotRemoveUnread);
|
||||||
|
settings()->setValue(GROUP(Messages), Messages::LimitCountOfArticles, art_limit.m_keepCountOfArticles);
|
||||||
|
settings()->setValue(GROUP(Messages), Messages::LimitRecycleInsteadOfPurging, art_limit.m_moveToBinDontPurge);
|
||||||
|
|
||||||
settings()->setValue(GROUP(Feeds), Feeds::FastAutoUpdate, m_ui->m_cmbFastAutoUpdate->isChecked());
|
settings()->setValue(GROUP(Feeds), Feeds::FastAutoUpdate, m_ui->m_cmbFastAutoUpdate->isChecked());
|
||||||
settings()->setValue(GROUP(Feeds), Feeds::FeedsUpdateOnStartup, m_ui->m_checkUpdateAllFeedsOnStartup->isChecked());
|
settings()->setValue(GROUP(Feeds), Feeds::FeedsUpdateOnStartup, m_ui->m_checkUpdateAllFeedsOnStartup->isChecked());
|
||||||
|
@ -123,92 +123,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0" colspan="2">
|
<item row="5" column="0" colspan="2">
|
||||||
<widget class="QGroupBox" name="m_gbAvoidOldArticles">
|
<widget class="ArticleAmountControl" name="m_wdgArticleLimiting" native="true"/>
|
||||||
<property name="title">
|
|
||||||
<string>Avoid adding articles before this date into the database</string>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QDateTimeEdit" name="m_dtDateTimeToAvoid">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
|
||||||
<horstretch>1</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumDate">
|
|
||||||
<date>
|
|
||||||
<year>1971</year>
|
|
||||||
<month>1</month>
|
|
||||||
<day>1</day>
|
|
||||||
</date>
|
|
||||||
</property>
|
|
||||||
<property name="calendarPopup">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="TimeSpinBox" name="m_spinHoursAvoid">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
|
||||||
<horstretch>1</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<double>10000.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QRadioButton" name="m_rbAvoidAbsolute">
|
|
||||||
<property name="text">
|
|
||||||
<string>Absolute date/time</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QRadioButton" name="m_rbAvoidRelative">
|
|
||||||
<property name="text">
|
|
||||||
<string>Relative time</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<spacer name="horizontalSpacer_4">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2">
|
|
||||||
<spacer name="horizontalSpacer_5">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@ -727,6 +642,12 @@
|
|||||||
<header>helpspoiler.h</header>
|
<header>helpspoiler.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>ArticleAmountControl</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>articleamountcontrol.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>m_checkUpdateAllFeedsOnStartup</tabstop>
|
<tabstop>m_checkUpdateAllFeedsOnStartup</tabstop>
|
||||||
@ -765,41 +686,7 @@
|
|||||||
<tabstop>m_tabFeedsMessages</tabstop>
|
<tabstop>m_tabFeedsMessages</tabstop>
|
||||||
<tabstop>m_gbFeedListFont</tabstop>
|
<tabstop>m_gbFeedListFont</tabstop>
|
||||||
<tabstop>m_gbArticleListFont</tabstop>
|
<tabstop>m_gbArticleListFont</tabstop>
|
||||||
<tabstop>m_gbAvoidOldArticles</tabstop>
|
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections/>
|
||||||
<connection>
|
|
||||||
<sender>m_rbAvoidAbsolute</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>m_dtDateTimeToAvoid</receiver>
|
|
||||||
<slot>setEnabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>92</x>
|
|
||||||
<y>215</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>326</x>
|
|
||||||
<y>215</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>m_rbAvoidRelative</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>m_spinHoursAvoid</receiver>
|
|
||||||
<slot>setEnabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>92</x>
|
|
||||||
<y>243</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>326</x>
|
|
||||||
<y>243</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
</ui>
|
||||||
|
@ -158,6 +158,18 @@ DVALUE(QDateTime) Messages::DateTimeToAvoidArticleDef = QDateTime::currentDateTi
|
|||||||
DKEY Messages::HoursToAvoidArticle = "hours_to_avoid_article";
|
DKEY Messages::HoursToAvoidArticle = "hours_to_avoid_article";
|
||||||
DVALUE(int) Messages::HoursToAvoidArticleDef = 0;
|
DVALUE(int) Messages::HoursToAvoidArticleDef = 0;
|
||||||
|
|
||||||
|
DKEY Messages::LimitDoNotRemoveUnread = "limit_dont_remove_unread";
|
||||||
|
DVALUE(bool) Messages::LimitDoNotRemoveUnreadDef = true;
|
||||||
|
|
||||||
|
DKEY Messages::LimitDoNotRemoveStarred = "limit_dont_remove_starred";
|
||||||
|
DVALUE(bool) Messages::LimitDoNotRemoveStarredDef = true;
|
||||||
|
|
||||||
|
DKEY Messages::LimitRecycleInsteadOfPurging = "limit_recycle_dont_purge";
|
||||||
|
DVALUE(bool) Messages::LimitRecycleInsteadOfPurgingDef = false;
|
||||||
|
|
||||||
|
DKEY Messages::LimitCountOfArticles = "limit_count_of_articles";
|
||||||
|
DVALUE(int) Messages::LimitCountOfArticlesDef = 0;
|
||||||
|
|
||||||
DKEY Messages::AlwaysDisplayItemPreview = "always_display_preview";
|
DKEY Messages::AlwaysDisplayItemPreview = "always_display_preview";
|
||||||
DVALUE(bool) Messages::AlwaysDisplayItemPreviewDef = true;
|
DVALUE(bool) Messages::AlwaysDisplayItemPreviewDef = true;
|
||||||
|
|
||||||
|
@ -155,6 +155,18 @@ namespace Messages {
|
|||||||
KEY HoursToAvoidArticle;
|
KEY HoursToAvoidArticle;
|
||||||
VALUE(int) HoursToAvoidArticleDef;
|
VALUE(int) HoursToAvoidArticleDef;
|
||||||
|
|
||||||
|
KEY LimitDoNotRemoveUnread;
|
||||||
|
VALUE(bool) LimitDoNotRemoveUnreadDef;
|
||||||
|
|
||||||
|
KEY LimitDoNotRemoveStarred;
|
||||||
|
VALUE(bool) LimitDoNotRemoveStarredDef;
|
||||||
|
|
||||||
|
KEY LimitRecycleInsteadOfPurging;
|
||||||
|
VALUE(bool) LimitRecycleInsteadOfPurgingDef;
|
||||||
|
|
||||||
|
KEY LimitCountOfArticles;
|
||||||
|
VALUE(int) LimitCountOfArticlesDef;
|
||||||
|
|
||||||
KEY AlwaysDisplayItemPreview;
|
KEY AlwaysDisplayItemPreview;
|
||||||
VALUE(bool) AlwaysDisplayItemPreviewDef;
|
VALUE(bool) AlwaysDisplayItemPreviewDef;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user