diff --git a/resources/desktop/com.github.rssguard.appdata.xml b/resources/desktop/com.github.rssguard.appdata.xml index 370b129ea..f3d7ed266 100644 --- a/resources/desktop/com.github.rssguard.appdata.xml +++ b/resources/desktop/com.github.rssguard.appdata.xml @@ -26,7 +26,7 @@ https://github.com/sponsors/martinrotter - + none diff --git a/src/librssguard/core/messagesmodel.cpp b/src/librssguard/core/messagesmodel.cpp index 12d14a68f..42d938e7e 100644 --- a/src/librssguard/core/messagesmodel.cpp +++ b/src/librssguard/core/messagesmodel.cpp @@ -6,6 +6,7 @@ #include "database/databasefactory.h" #include "database/databasequeries.h" #include "definitions/definitions.h" +#include "gui/messagesview.h" #include "miscellaneous/application.h" #include "miscellaneous/iconfactory.h" #include "miscellaneous/skinfactory.h" @@ -21,8 +22,9 @@ #include MessagesModel::MessagesModel(QObject* parent) - : QSqlQueryModel(parent), m_cache(new MessagesModelCache(this)), m_messageHighlighter(MessageHighlighter::NoHighlighting), - m_customDateFormat(QString()), m_customTimeFormat(QString()), m_selectedItem(nullptr), m_displayFeedIcons(false) { + : QSqlQueryModel(parent), m_view(nullptr), m_cache(new MessagesModelCache(this)), m_messageHighlighter(MessageHighlighter::NoHighlighting), + m_customDateFormat(QString()), m_customTimeFormat(QString()), m_selectedItem(nullptr), m_displayFeedIcons(false), + m_multilineListItems(qApp->settings()->value(GROUP(Messages), SETTING(Messages::MultilineArticleList)).toBool()) { setupFonts(); setupIcons(); setupHeaderData(); @@ -79,6 +81,14 @@ QIcon MessagesModel::generateIconForScore(double score) { return pix; } +MessagesView* MessagesModel::view() const { + return m_view; +} + +void MessagesModel::setView(MessagesView* newView) { + m_view = newView; +} + MessagesModelCache* MessagesModel::cache() const { return m_cache; } @@ -418,6 +428,29 @@ QVariant MessagesModel::data(const QModelIndex& idx, int role) const { return QVariant(); } + case Qt::ItemDataRole::SizeHintRole: { + if (!m_multilineListItems || m_view == nullptr || m_view->isColumnHidden(idx.column())) { + return {}; + } + else { + auto wd = m_view->columnWidth(idx.column()); + QString str = data(idx, Qt::ItemDataRole::DisplayRole).toString(); + + if (str.simplified().isEmpty()) { + return {}; + } + + QFontMetrics fm(data(idx, Qt::ItemDataRole::FontRole).value()); + auto rct = fm.boundingRect(QRect(QPoint(0, 0), QPoint(wd - 20, 100000)), + Qt::TextFlag::TextWordWrap | + Qt::AlignmentFlag::AlignLeft | + Qt::AlignmentFlag::AlignVCenter, + str).size(); + + return rct; + } + } + case Qt::ItemDataRole::DecorationRole: { const int index_column = idx.column(); @@ -425,8 +458,8 @@ QVariant MessagesModel::data(const QModelIndex& idx, int role) const { if (m_displayFeedIcons && m_selectedItem != nullptr) { QModelIndex idx_feedid = index(idx.row(), MSG_DB_FEED_CUSTOM_ID_INDEX); QVariant dta = m_cache->containsData(idx_feedid.row()) - ? m_cache->data(idx_feedid) - : QSqlQueryModel::data(idx_feedid); + ? m_cache->data(idx_feedid) + : QSqlQueryModel::data(idx_feedid); QString feed_custom_id = dta.toString(); auto acc = m_selectedItem->getParentServiceRoot()->feedIconForMessage(feed_custom_id); diff --git a/src/librssguard/core/messagesmodel.h b/src/librssguard/core/messagesmodel.h index a3b077078..b03055a5f 100644 --- a/src/librssguard/core/messagesmodel.h +++ b/src/librssguard/core/messagesmodel.h @@ -13,6 +13,7 @@ #include #include +class MessagesView; class MessagesModelCache; class MessagesModel : public QSqlQueryModel, public MessagesModelSqlLayer { @@ -74,6 +75,9 @@ class MessagesModel : public QSqlQueryModel, public MessagesModelSqlLayer { // Loads messages of given feeds. void loadMessages(RootItem* item); + MessagesView* view() const; + void setView(MessagesView* newView); + public slots: // NOTE: These methods DO NOT actually change data in the DB, just in the model. @@ -88,6 +92,7 @@ class MessagesModel : public QSqlQueryModel, public MessagesModelSqlLayer { static QIcon generateIconForScore(double score); private: + MessagesView* m_view; MessagesModelCache* m_cache; MessageHighlighter m_messageHighlighter; QString m_customDateFormat; @@ -105,6 +110,7 @@ class MessagesModel : public QSqlQueryModel, public MessagesModelSqlLayer { QIcon m_enclosuresIcon; QList m_scoreIcons; bool m_displayFeedIcons; + bool m_multilineListItems; }; Q_DECLARE_METATYPE(MessagesModel::MessageHighlighter) diff --git a/src/librssguard/gui/dialogs/formsettings.cpp b/src/librssguard/gui/dialogs/formsettings.cpp index 5466bcdab..900fbf74e 100644 --- a/src/librssguard/gui/dialogs/formsettings.cpp +++ b/src/librssguard/gui/dialogs/formsettings.cpp @@ -16,6 +16,7 @@ #include "gui/settings/settingsgeneral.h" #include "gui/settings/settingsgui.h" #include "gui/settings/settingslocalization.h" +#include "gui/settings/settingsnodejs.h" #include "gui/settings/settingsnotifications.h" #include "gui/settings/settingsshortcuts.h" @@ -46,6 +47,7 @@ FormSettings::FormSettings(QWidget& parent) addSettingsPanel(new SettingsLocalization(&m_settings, this)); addSettingsPanel(new SettingsShortcuts(&m_settings, this)); addSettingsPanel(new SettingsBrowserMail(&m_settings, this)); + addSettingsPanel(new SettingsNodejs(&m_settings, this)); addSettingsPanel(new SettingsDownloads(&m_settings, this)); addSettingsPanel(new SettingsFeedsMessages(&m_settings, this)); diff --git a/src/librssguard/gui/messagesview.cpp b/src/librssguard/gui/messagesview.cpp index f84cef96c..cfe0ff13d 100644 --- a/src/librssguard/gui/messagesview.cpp +++ b/src/librssguard/gui/messagesview.cpp @@ -31,6 +31,7 @@ MessagesView::MessagesView(QWidget* parent) m_processingRightMouseButton(false) { m_sourceModel = qApp->feedReader()->messagesModel(); m_proxyModel = qApp->feedReader()->messagesProxyModel(); + m_sourceModel->setView(this); // Forward count changes to the view. createConnections(); @@ -202,8 +203,21 @@ void MessagesView::reloadSelections() { } void MessagesView::setupAppearance() { + if (qApp->settings()->value(GROUP(Messages), SETTING(Messages::MultilineArticleList)).toBool()) { + // Enable some word wrapping for multiline list items. + // + // NOTE: If user explicitly changed height of rows, then respect this even if he enabled multiline support. + setUniformRowHeights(qApp->settings()->value(GROUP(GUI), SETTING(GUI::HeightRowMessages)).toInt() > 0); + setWordWrap(true); + setTextElideMode(Qt::TextElideMode::ElideNone); + } + else { + setUniformRowHeights(true); + setWordWrap(false); + setTextElideMode(Qt::TextElideMode::ElideRight); + } + setFocusPolicy(Qt::FocusPolicy::StrongFocus); - setUniformRowHeights(true); setAcceptDrops(false); setDragEnabled(false); setDragDropMode(QAbstractItemView::DragDropMode::NoDragDrop); @@ -214,8 +228,8 @@ void MessagesView::setupAppearance() { setSortingEnabled(true); setAllColumnsShowFocus(false); setSelectionMode(QAbstractItemView::SelectionMode::ExtendedSelection); - setItemDelegate(new StyledItemDelegateWithoutFocus(GUI::HeightRowMessages, this)); + header()->setDefaultSectionSize(MESSAGES_VIEW_DEFAULT_COL); header()->setMinimumSectionSize(MESSAGES_VIEW_MINIMUM_COL); header()->setFirstSectionMovable(true); diff --git a/src/librssguard/gui/reusable/helpspoiler.cpp b/src/librssguard/gui/reusable/helpspoiler.cpp index 42952a807..26f7f3b02 100644 --- a/src/librssguard/gui/reusable/helpspoiler.cpp +++ b/src/librssguard/gui/reusable/helpspoiler.cpp @@ -33,7 +33,7 @@ HelpSpoiler::HelpSpoiler(QWidget* parent) : QWidget(parent), m_animation->addAnimation(new QPropertyAnimation(this, QSL("maximumHeight").toLocal8Bit())); m_animation->addAnimation(new QPropertyAnimation(m_content, QSL("maximumHeight").toLocal8Bit())); - // don't waste space + // Don't waste space. m_layout->setHorizontalSpacing(0); m_layout->setVerticalSpacing(0); m_layout->setContentsMargins(0, 0, 0, 0); @@ -48,6 +48,27 @@ HelpSpoiler::HelpSpoiler(QWidget* parent) : QWidget(parent), m_layout->addWidget(m_content, 1, 0, 1, 2); QObject::connect(m_btnToggle, &QToolButton::clicked, [this](const bool checked) { + const auto collapsed_height = sizeHint().height() - m_content->maximumHeight(); + auto content_height = m_text->fontMetrics().boundingRect(QRect(QPoint(0, 0), + QPoint(m_text->width(), 1000)), + Qt::TextFlag::TextWordWrap, + m_text->text()).height() + + (2 * m_text->fontMetrics().lineSpacing()); + + for (int i = 0; i < m_animation->animationCount() - 1; i++) { + QPropertyAnimation* spoiler_animation = static_cast(m_animation->animationAt(i)); + + spoiler_animation->setDuration(100); + spoiler_animation->setStartValue(collapsed_height); + spoiler_animation->setEndValue(collapsed_height + content_height); + } + + QPropertyAnimation* content_animation = static_cast(m_animation->animationAt(m_animation->animationCount() - 1)); + + content_animation->setDuration(100); + content_animation->setStartValue(0); + content_animation->setEndValue(content_height); + m_btnToggle->setArrowType(checked ? Qt::ArrowType::DownArrow : Qt::ArrowType::RightArrow); @@ -61,27 +82,15 @@ HelpSpoiler::HelpSpoiler(QWidget* parent) : QWidget(parent), auto* content_layout = new QVBoxLayout(m_content); - content_layout->addWidget(m_text); + content_layout->addWidget(m_text, 1); +} + +void HelpSpoiler::setHelpText(const QString& title, const QString& text, bool is_warning) { + m_btnToggle->setText(title); + setHelpText(text, is_warning); } void HelpSpoiler::setHelpText(const QString& text, bool is_warning) { m_text->setText(text); GuiUtilities::setLabelAsNotice(*m_text, is_warning, false); - - const auto collapsed_height = sizeHint().height() - m_content->maximumHeight(); - auto content_height = m_content->layout()->sizeHint().height(); - - for (int i = 0; i < m_animation->animationCount() - 1; i++) { - QPropertyAnimation* spoiler_animation = static_cast(m_animation->animationAt(i)); - - spoiler_animation->setDuration(100); - spoiler_animation->setStartValue(collapsed_height); - spoiler_animation->setEndValue(collapsed_height + content_height); - } - - QPropertyAnimation* content_animation = static_cast(m_animation->animationAt(m_animation->animationCount() - 1)); - - content_animation->setDuration(100); - content_animation->setStartValue(0); - content_animation->setEndValue(content_height); } diff --git a/src/librssguard/gui/reusable/helpspoiler.h b/src/librssguard/gui/reusable/helpspoiler.h index 2b7103124..5790ae43b 100644 --- a/src/librssguard/gui/reusable/helpspoiler.h +++ b/src/librssguard/gui/reusable/helpspoiler.h @@ -17,6 +17,7 @@ class HelpSpoiler : public QWidget { public: explicit HelpSpoiler(QWidget* parent = nullptr); + void setHelpText(const QString& title, const QString& text, bool is_warning); void setHelpText(const QString& text, bool is_warning); private: diff --git a/src/librssguard/gui/settings/settingsbrowsermail.ui b/src/librssguard/gui/settings/settingsbrowsermail.ui index 9c68b56f2..d11ea4b58 100644 --- a/src/librssguard/gui/settings/settingsbrowsermail.ui +++ b/src/librssguard/gui/settings/settingsbrowsermail.ui @@ -6,7 +6,7 @@ 0 0 - 481 + 537 330 @@ -337,7 +337,7 @@ - On this page, you can setup a list of external tools which can open URLs of selected messages. + On this page, you can setup a list of external tools which can open URLs. diff --git a/src/librssguard/gui/settings/settingsdatabase.cpp b/src/librssguard/gui/settings/settingsdatabase.cpp index 0bc1bbd3c..1b2cacc92 100644 --- a/src/librssguard/gui/settings/settingsdatabase.cpp +++ b/src/librssguard/gui/settings/settingsdatabase.cpp @@ -12,9 +12,34 @@ SettingsDatabase::SettingsDatabase(Settings* settings, QWidget* parent) : SettingsPanel(settings, parent), m_ui(new Ui::SettingsDatabase) { m_ui->setupUi(this); - GuiUtilities::setLabelAsNotice(*m_ui->m_lblDataStorageWarning, true); - GuiUtilities::setLabelAsNotice(*m_ui->m_lblMysqlInfo, false); - GuiUtilities::setLabelAsNotice(*m_ui->m_lblSqliteInMemoryWarnings, true); + m_ui->m_lblDataStorageWarning->setHelpText(tr("Note that switching to another data storage type will " + "NOT copy existing your data from currently active data " + "storage to newly selected one."), + true); + + m_ui->m_lblMysqlInfo->setHelpText(tr("Note that speed of used MySQL server and latency of used connection " + "medium HEAVILY influences the final performance of this application. " + "Using slow database connections leads to bad performance when browsing " + "feeds or messages."), + false); + + m_ui->m_lblSqliteInMemoryWarnings->setHelpText(tr("Usage of in-memory working database has several advantages " + "and pitfalls. Make sure that you are familiar with these " + "before you turn this feature on.\n" + "\n" + "Advantages:\n" + " • higher speed for feed/message manipulations " + "(especially with thousands of messages displayed),\n" + " • whole database stored in RAM, thus your hard drive can " + "rest more.\n" + "\n" + "Disadvantages:\n" + " • if application crashes, your changes from last session are lost,\n" + " • application startup and shutdown can take little longer " + "(max. 2 seconds).\n" + "\n" + "Authors of this application are NOT responsible for lost data."), + true); m_ui->m_txtMysqlPassword->lineEdit()->setPasswordMode(true); diff --git a/src/librssguard/gui/settings/settingsdatabase.ui b/src/librssguard/gui/settings/settingsdatabase.ui index 513b2181f..88bb21cad 100644 --- a/src/librssguard/gui/settings/settingsdatabase.ui +++ b/src/librssguard/gui/settings/settingsdatabase.ui @@ -22,22 +22,7 @@ - - - QLabel { - margin-top: 12px; -} - - - WARNING: Note that switching to another data storage type will NOT copy existing your data from currently active data storage to newly selected one. - - - Qt::AlignCenter - - - true - - + @@ -55,7 +40,7 @@ - 1 + 0 @@ -82,30 +67,7 @@ - - - Usage of in-memory working database has several advantages and pitfalls. Make sure that you are familiar with these before you turn this feature on. Advantages: -<ul> -<li>higher speed for feed/message manipulations (especially with thousands of messages displayed),</li> -<li>whole database stored in RAM, thus your hard drive can rest more.</li> -</ul> -Disadvantages: -<ul> -<li>if application crashes, your changes from last session are lost,</li> -<li>application startup and shutdown can take little longer (max. 2 seconds).</li> -</ul> -Authors of this application are NOT responsible for lost data. - - - Qt::RichText - - - true - - - 20 - - + @@ -236,17 +198,7 @@ Authors of this application are NOT responsible for lost data. - - - Note that speed of used MySQL server and latency of used connection medium HEAVILY influences the final performance of this application. Using slow database connections leads to bad performance when browsing feeds or messages. - - - Qt::AlignCenter - - - true - - + @@ -273,6 +225,12 @@ Authors of this application are NOT responsible for lost data. m_lblDataStorageWarning + + HelpSpoiler + QWidget +
helpspoiler.h
+ 1 +
LabelWithStatus QWidget diff --git a/src/librssguard/gui/settings/settingsfeedsmessages.cpp b/src/librssguard/gui/settings/settingsfeedsmessages.cpp index ff9b76111..de0267d7d 100644 --- a/src/librssguard/gui/settings/settingsfeedsmessages.cpp +++ b/src/librssguard/gui/settings/settingsfeedsmessages.cpp @@ -25,6 +25,10 @@ SettingsFeedsMessages::SettingsFeedsMessages(Settings* settings, QWidget* parent initializeMessageDateFormats(); GuiUtilities::setLabelAsNotice(*m_ui->label_9, false); + m_ui->m_helpMultilineArticleList->setHelpText(tr("Note that enabling this might have drastic consequences on " + "performance of article list with big number of articles."), + true); + #if defined(USE_WEBENGINE) m_ui->m_tabMessages->layout()->removeWidget(m_ui->m_checkDisplayPlaceholders); m_ui->m_checkDisplayPlaceholders->hide(); @@ -36,6 +40,9 @@ SettingsFeedsMessages::SettingsFeedsMessages(Settings* settings, QWidget* parent m_ui->m_tabMessages->layout()->removeWidget(m_ui->m_cbShowEnclosuresDirectly); m_ui->m_cbShowEnclosuresDirectly->hide(); + m_ui->m_tabMessages->layout()->removeWidget(m_ui->m_lblHeightImageAttachments); + m_ui->m_lblHeightImageAttachments->hide(); + m_ui->m_tabMessages->layout()->removeWidget(m_ui->m_spinHeightImageAttachments); m_ui->m_spinHeightImageAttachments->hide(); @@ -79,6 +86,8 @@ SettingsFeedsMessages::SettingsFeedsMessages(Settings* settings, QWidget* parent connect(m_ui->m_cmbCountsFeedList, static_cast(&QComboBox::currentIndexChanged), this, &SettingsFeedsMessages::dirtifySettings); connect(m_ui->m_checkShowTooltips, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings); + connect(m_ui->m_checkMultilineArticleList, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings); + connect(m_ui->m_checkMultilineArticleList, &QCheckBox::toggled, this, &SettingsFeedsMessages::requireRestart); connect(m_ui->m_btnChangeMessagesFont, &QPushButton::clicked, this, [&]() { changeFont(*m_ui->m_lblMessagesFont); @@ -168,6 +177,8 @@ void SettingsFeedsMessages::loadSettings() { m_ui->m_checkShowTooltips->setChecked(settings()->value(GROUP(Feeds), SETTING(Feeds::EnableTooltipsFeedsMessages)).toBool()); m_ui->m_cmbIgnoreContentsChanges->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::IgnoreContentsChanges)).toBool()); + m_ui->m_checkMultilineArticleList->setChecked(settings()->value(GROUP(Messages), + SETTING(Messages::MultilineArticleList)).toBool()); #if !defined (USE_WEBENGINE) m_ui->m_checkDisplayPlaceholders->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::DisplayImagePlaceholders)).toBool()); @@ -245,6 +256,7 @@ void SettingsFeedsMessages::saveSettings() { settings()->setValue(GROUP(Feeds), Feeds::CountFormat, m_ui->m_cmbCountsFeedList->currentText()); settings()->setValue(GROUP(Feeds), Feeds::EnableTooltipsFeedsMessages, m_ui->m_checkShowTooltips->isChecked()); settings()->setValue(GROUP(Messages), Messages::IgnoreContentsChanges, m_ui->m_cmbIgnoreContentsChanges->isChecked()); + settings()->setValue(GROUP(Messages), Messages::MultilineArticleList, m_ui->m_checkMultilineArticleList->isChecked()); #if !defined (USE_WEBENGINE) settings()->setValue(GROUP(Messages), Messages::DisplayImagePlaceholders, m_ui->m_checkDisplayPlaceholders->isChecked()); diff --git a/src/librssguard/gui/settings/settingsfeedsmessages.ui b/src/librssguard/gui/settings/settingsfeedsmessages.ui index ce354eda6..094c60916 100644 --- a/src/librssguard/gui/settings/settingsfeedsmessages.ui +++ b/src/librssguard/gui/settings/settingsfeedsmessages.ui @@ -6,15 +6,15 @@ 0 0 - 479 - 433 + 489 + 434 - 0 + 1 @@ -268,6 +268,13 @@ + + + + Ignore changes in article body when new articles are being fetched + + + @@ -303,7 +310,7 @@ - + Article list row height @@ -313,7 +320,7 @@ - + @@ -332,24 +339,18 @@ - - + + - Height of image attachments + Image attachments height m_spinHeightImageAttachments - + - - - 150 - 0 - - px @@ -361,7 +362,7 @@ - + Use custom date/time format @@ -374,7 +375,7 @@ - + @@ -384,7 +385,30 @@ - + + + + Show only time for today articles + + + true + + + true + + + + + + + + 150 + 0 + + + + + @@ -453,7 +477,7 @@ - + Qt::Vertical @@ -466,36 +490,23 @@ - - + + - Ignore changes in article body when new articles are being fetched + Enable multiline article list items - - + + - 150 + 50 0 - - - - Show only time for today articles - - - true - - - true - - - @@ -508,6 +519,12 @@ QDoubleSpinBox
timespinbox.h
+ + HelpSpoiler + QWidget +
helpspoiler.h
+ 1 +
m_tabFeedsMessages @@ -530,6 +547,7 @@ m_checkDisplayFeedIcons m_checkBringToForegroundAfterMsgOpened m_checkKeppMessagesInTheMiddle + m_checkMultilineArticleList m_spinHeightRowsMessages m_spinHeightImageAttachments m_checkMessagesDateTimeFormat diff --git a/src/librssguard/gui/settings/settingsnodejs.cpp b/src/librssguard/gui/settings/settingsnodejs.cpp new file mode 100755 index 000000000..9cc547949 --- /dev/null +++ b/src/librssguard/gui/settings/settingsnodejs.cpp @@ -0,0 +1,25 @@ +// For license of this file, see /LICENSE.md. + +#include "gui/settings/settingsnodejs.h" + +#include "definitions/definitions.h" + +SettingsNodejs::SettingsNodejs(Settings* settings, QWidget* parent) : SettingsPanel(settings, parent) { + m_ui.setupUi(this); + + m_ui.m_helpInfo->setHelpText(tr("What is Node.js?"), + tr("Node.js is asynchronous event-driven JavaScript runtime, designed to build " + "scalable network applications.\n\n" + "%1 integrates Node.js to bring some modern features like Adblock.").arg(APP_NAME), + false); +} + +QString SettingsNodejs::title() const { + return QSL("Node.js"); +} + +void SettingsNodejs::loadSettings() +{} + +void SettingsNodejs::saveSettings() +{} diff --git a/src/librssguard/gui/settings/settingsnodejs.h b/src/librssguard/gui/settings/settingsnodejs.h new file mode 100755 index 000000000..50a9b4152 --- /dev/null +++ b/src/librssguard/gui/settings/settingsnodejs.h @@ -0,0 +1,24 @@ +// For license of this file, see /LICENSE.md. + +#ifndef SETTINGSNODEJS_H +#define SETTINGSNODEJS_H + +#include "gui/settings/settingspanel.h" + +#include "ui_settingsnodejs.h" + +class SettingsNodejs : public SettingsPanel { + Q_OBJECT + + public: + explicit SettingsNodejs(Settings* settings, QWidget* parent = nullptr); + + virtual QString title() const; + virtual void loadSettings(); + virtual void saveSettings(); + + private: + Ui::SettingsNodejs m_ui; +}; + +#endif // SETTINGSNODEJS_H diff --git a/src/librssguard/gui/settings/settingsnodejs.ui b/src/librssguard/gui/settings/settingsnodejs.ui new file mode 100755 index 000000000..31d27b81a --- /dev/null +++ b/src/librssguard/gui/settings/settingsnodejs.ui @@ -0,0 +1,32 @@ + + + SettingsNodejs + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + + + + + + HelpSpoiler + QWidget +
helpspoiler.h
+ 1 +
+
+ + +
diff --git a/src/librssguard/gui/settings/settingsnotifications.cpp b/src/librssguard/gui/settings/settingsnotifications.cpp index f3dc34a0e..597bd5330 100644 --- a/src/librssguard/gui/settings/settingsnotifications.cpp +++ b/src/librssguard/gui/settings/settingsnotifications.cpp @@ -14,8 +14,9 @@ SettingsNotifications::SettingsNotifications(Settings* settings, QWidget* parent) : SettingsPanel(settings, parent) { m_ui.setupUi(this); - GuiUtilities::setLabelAsNotice(*m_ui.m_lblAvailableSounds, false); - GuiUtilities::setLabelAsNotice(*m_ui.m_lblInfo, true); + m_ui.m_lblInfo->setHelpText(tr("You must have \"tray icon\" activated to have balloon notifications working.\n\n" + "Also, there are some built-in sounds. Just start typing \":\" and they will show up."), + true); connect(m_ui.m_checkEnableNotifications, &QCheckBox::toggled, this, &SettingsNotifications::dirtifySettings); connect(m_ui.m_editor, &NotificationsEditor::someNotificationChanged, this, &SettingsNotifications::dirtifySettings); diff --git a/src/librssguard/gui/settings/settingsnotifications.ui b/src/librssguard/gui/settings/settingsnotifications.ui index 62e35b2e6..d2225494e 100644 --- a/src/librssguard/gui/settings/settingsnotifications.ui +++ b/src/librssguard/gui/settings/settingsnotifications.ui @@ -18,7 +18,10 @@ - + + + + false @@ -31,29 +34,15 @@ - - - - There are some built-in sounds. Just start typing ":" and they will show up. - - - true - - - - - - - You must have "tray icon" activated to have balloon notifications working. - - - true - - - + + HelpSpoiler + QWidget +
helpspoiler.h
+ 1 +
NotificationsEditor QWidget diff --git a/src/librssguard/librssguard.pro b/src/librssguard/librssguard.pro index f8d3d603a..06874b7d3 100644 --- a/src/librssguard/librssguard.pro +++ b/src/librssguard/librssguard.pro @@ -68,6 +68,7 @@ HEADERS += core/feeddownloader.h \ gui/reusable/helpspoiler.h \ gui/reusable/progressbarwithtext.h \ gui/reusable/resizablestackedwidget.h \ + gui/settings/settingsnodejs.h \ gui/settings/settingsnotifications.h \ gui/toolbars/basetoolbar.h \ gui/reusable/comboboxwithstatus.h \ @@ -128,6 +129,7 @@ HEADERS += core/feeddownloader.h \ miscellaneous/iofactory.h \ miscellaneous/localization.h \ miscellaneous/mutex.h \ + miscellaneous/nodejs.h \ miscellaneous/notification.h \ miscellaneous/notificationfactory.h \ miscellaneous/regexfactory.h \ @@ -259,6 +261,7 @@ SOURCES += core/feeddownloader.cpp \ gui/reusable/helpspoiler.cpp \ gui/reusable/progressbarwithtext.cpp \ gui/reusable/resizablestackedwidget.cpp \ + gui/settings/settingsnodejs.cpp \ gui/settings/settingsnotifications.cpp \ gui/toolbars/basetoolbar.cpp \ gui/reusable/comboboxwithstatus.cpp \ @@ -319,6 +322,7 @@ SOURCES += core/feeddownloader.cpp \ miscellaneous/iofactory.cpp \ miscellaneous/localization.cpp \ miscellaneous/mutex.cpp \ + miscellaneous/nodejs.cpp \ miscellaneous/notification.cpp \ miscellaneous/notificationfactory.cpp \ miscellaneous/regexfactory.cpp \ @@ -432,6 +436,7 @@ FORMS += gui/dialogs/formabout.ui \ gui/settings/settingsgeneral.ui \ gui/settings/settingsgui.ui \ gui/settings/settingslocalization.ui \ + gui/settings/settingsnodejs.ui \ gui/settings/settingsnotifications.ui \ gui/settings/settingsshortcuts.ui \ gui/toolbars/toolbareditor.ui \ diff --git a/src/librssguard/miscellaneous/application.cpp b/src/librssguard/miscellaneous/application.cpp index 4abe37414..dd45af093 100644 --- a/src/librssguard/miscellaneous/application.cpp +++ b/src/librssguard/miscellaneous/application.cpp @@ -15,6 +15,7 @@ #include "miscellaneous/iconfactory.h" #include "miscellaneous/iofactory.h" #include "miscellaneous/mutex.h" +#include "miscellaneous/nodejs.h" #include "miscellaneous/notificationfactory.h" #include "network-web/webfactory.h" #include "services/abstract/serviceroot.h" @@ -67,6 +68,7 @@ Application::Application(const QString& id, int& argc, char** argv) m_database = new DatabaseFactory(this); m_downloadManager = nullptr; m_notifications = new NotificationFactory(this); + m_nodejs = new NodeJs(this); m_shouldRestart = false; determineFirstRuns(); diff --git a/src/librssguard/miscellaneous/application.h b/src/librssguard/miscellaneous/application.h index c4bfb4d66..f8d4b6afe 100644 --- a/src/librssguard/miscellaneous/application.h +++ b/src/librssguard/miscellaneous/application.h @@ -33,6 +33,7 @@ class FormMain; class IconFactory; class QAction; class Mutex; +class NodeJs; #if QT_VERSION_MAJOR == 6 class QWebEngineDownloadRequest; @@ -224,6 +225,7 @@ class RSSGUARD_DLLSPEC Application : public SingleApplication { DatabaseFactory* m_database; DownloadManager* m_downloadManager; NotificationFactory* m_notifications; + NodeJs* m_nodejs; bool m_shouldRestart; bool m_firstRunEver; bool m_firstRunCurrentVersion; diff --git a/src/librssguard/miscellaneous/nodejs.cpp b/src/librssguard/miscellaneous/nodejs.cpp new file mode 100755 index 000000000..52bd2dc69 --- /dev/null +++ b/src/librssguard/miscellaneous/nodejs.cpp @@ -0,0 +1,5 @@ +// For license of this file, see /LICENSE.md. + +#include "miscellaneous/nodejs.h" + +NodeJs::NodeJs(QObject* parent) : QObject{parent} {} diff --git a/src/librssguard/miscellaneous/nodejs.h b/src/librssguard/miscellaneous/nodejs.h new file mode 100755 index 000000000..ede73475f --- /dev/null +++ b/src/librssguard/miscellaneous/nodejs.h @@ -0,0 +1,15 @@ +// For license of this file, see /LICENSE.md. + +#ifndef NODEJS_H +#define NODEJS_H + +#include + +class NodeJs : public QObject { + Q_OBJECT + + public: + explicit NodeJs(QObject* parent = nullptr); +}; + +#endif // NODEJS_H diff --git a/src/librssguard/miscellaneous/settings.cpp b/src/librssguard/miscellaneous/settings.cpp index cdef78ea7..06a43fa55 100644 --- a/src/librssguard/miscellaneous/settings.cpp +++ b/src/librssguard/miscellaneous/settings.cpp @@ -105,6 +105,9 @@ DVALUE(bool) Messages::UseCustomDateDef = false; DKEY Messages::CustomDateFormat = "custom_date_format"; DVALUE(char*) Messages::CustomDateFormatDef = ""; +DKEY Messages::MultilineArticleList = "multiline_article_list"; +DVALUE(bool) Messages::MultilineArticleListDef = false; + DKEY Messages::UseCustomTime = "use_custom_time"; DVALUE(bool) Messages::UseCustomTimeDef = false; diff --git a/src/librssguard/miscellaneous/settings.h b/src/librssguard/miscellaneous/settings.h index 9bf62ae7a..8481326ba 100644 --- a/src/librssguard/miscellaneous/settings.h +++ b/src/librssguard/miscellaneous/settings.h @@ -125,6 +125,9 @@ namespace Messages { KEY UseCustomTime; VALUE(bool) UseCustomTimeDef; + KEY MultilineArticleList; + VALUE(bool) MultilineArticleListDef; + KEY CustomTimeFormat; VALUE(QString) CustomTimeFormatDef; diff --git a/src/librssguard/network-web/cookiejar.cpp b/src/librssguard/network-web/cookiejar.cpp index 900753072..6dc477095 100644 --- a/src/librssguard/network-web/cookiejar.cpp +++ b/src/librssguard/network-web/cookiejar.cpp @@ -26,10 +26,10 @@ CookieJar::CookieJar(QObject* parent) : QNetworkCookieJar(parent) { // When cookies change in WebEngine, then change in main cookie jar too. connect(m_webEngineCookies, &QWebEngineCookieStore::cookieAdded, this, [=](const QNetworkCookie& cookie) { - //insertCookieInternal(cookie, false, true); + insertCookieInternal(cookie, false, true); }); connect(m_webEngineCookies, &QWebEngineCookieStore::cookieRemoved, this, [=](const QNetworkCookie& cookie) { - //deleteCookieInternal(cookie, false); + deleteCookieInternal(cookie, false); }); #endif @@ -80,6 +80,7 @@ void CookieJar::loadCookies() { << "Failed to load cookie" << QUOTE_W_SPACE(cookie_key) << "from settings."; + sett->remove(Cookies::ID, cookie_key); } } } @@ -124,7 +125,7 @@ bool CookieJar::insertCookieInternal(const QNetworkCookie& cookie, bool notify_o #if defined(USE_WEBENGINE) if (notify_others) { - m_webEngineCookies->setCookie(cookie); + //m_webEngineCookies->setCookie(cookie); } #else Q_UNUSED(notify_others) diff --git a/src/librssguard/services/standard/gui/standardfeeddetails.cpp b/src/librssguard/services/standard/gui/standardfeeddetails.cpp index 6e876b55f..c0966852f 100644 --- a/src/librssguard/services/standard/gui/standardfeeddetails.cpp +++ b/src/librssguard/services/standard/gui/standardfeeddetails.cpp @@ -108,7 +108,13 @@ StandardFeedDetails::StandardFeedDetails(QWidget* parent) : QWidget(parent) { setTabOrder(m_ui.m_txtPostProcessScript->textEdit(), m_ui.m_btnFetchMetadata); setTabOrder(m_ui.m_btnFetchMetadata, m_ui.m_btnIcon); - GuiUtilities::setLabelAsNotice(*m_ui.m_lblScriptInfo, false); + m_ui.m_lblScriptInfo->setHelpText(tr("What is post-processing script?"), + tr("You can use URL as a source of your feed or you can produce your feed with " + "custom script.\n\n" + "Also, you can post-process generated feed data with yet " + "another script if you wish. These are advanced features and make sure to " + "read the documentation before your use them."), + true); onTitleChanged({}); onDescriptionChanged({}); diff --git a/src/librssguard/services/standard/gui/standardfeeddetails.ui b/src/librssguard/services/standard/gui/standardfeeddetails.ui index 112b4219c..71fd4b116 100644 --- a/src/librssguard/services/standard/gui/standardfeeddetails.ui +++ b/src/librssguard/services/standard/gui/standardfeeddetails.ui @@ -132,7 +132,7 @@ - Post-process script + Post-processing script @@ -153,17 +153,7 @@
- - - You can use URL as a source of your feed or you can produce your feed with custom script. Also, you can post-process generated feed data with yet another script if you wish. These are advanced features and make sure to read the documentation before your use them. - - - Qt::AlignCenter - - - true - - + @@ -262,6 +252,12 @@ + + HelpSpoiler + QWidget +
helpspoiler.h
+ 1 +
LabelWithStatus QWidget