fix #424
This commit is contained in:
parent
9a25aceaa8
commit
083173c8c4
@ -87,6 +87,8 @@ set(SOURCES
|
||||
gui/feedsview.h
|
||||
gui/guiutilities.cpp
|
||||
gui/guiutilities.h
|
||||
gui/itemdetails.cpp
|
||||
gui/itemdetails.h
|
||||
gui/messagebox.cpp
|
||||
gui/messagebox.h
|
||||
gui/messagepreviewer.cpp
|
||||
@ -452,6 +454,7 @@ set(UI_FILES
|
||||
gui/notifications/notificationseditor.ui
|
||||
gui/notifications/singlenotificationeditor.ui
|
||||
gui/reusable/networkproxydetails.ui
|
||||
gui/itemdetails.ui
|
||||
gui/newspaperpreviewer.ui
|
||||
gui/reusable/searchtextwidget.ui
|
||||
gui/settings/settingsbrowsermail.ui
|
||||
|
@ -186,6 +186,7 @@
|
||||
|
||||
#define INTERNAL_URL_MESSAGE "http://rssguard.message"
|
||||
#define INTERNAL_URL_BLANK "http://rssguard.blank"
|
||||
#define INTERNAL_URL_INFO "http://rssguard.info"
|
||||
#define INTERNAL_URL_ADBLOCKED "http://rssguard.adblocked"
|
||||
#define INTERNAL_URL_MESSAGE_HOST "rssguard.message"
|
||||
|
||||
|
@ -224,7 +224,16 @@ void FeedMessageViewer::displayMessage(const Message& message, RootItem* root) {
|
||||
m_messagesBrowser->loadMessage(message, root);
|
||||
}
|
||||
else {
|
||||
m_messagesBrowser->hide();
|
||||
m_messagesBrowser->clear();
|
||||
}
|
||||
}
|
||||
|
||||
void FeedMessageViewer::onMessageRemoved(RootItem* root) {
|
||||
if (m_articleViewerAlwaysVisible) {
|
||||
m_messagesBrowser->showItemDetails(root);
|
||||
}
|
||||
else {
|
||||
m_messagesBrowser->clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -241,7 +250,7 @@ void FeedMessageViewer::createConnections() {
|
||||
connect(m_feedSplitter, &QSplitter::splitterMoved, this, &FeedMessageViewer::onFeedSplitterResized);
|
||||
connect(m_messageSplitter, &QSplitter::splitterMoved, this, &FeedMessageViewer::onMessageSplitterResized);
|
||||
|
||||
connect(m_messagesView, &MessagesView::currentMessageRemoved, m_messagesBrowser, &MessagePreviewer::clear);
|
||||
connect(m_messagesView, &MessagesView::currentMessageRemoved, this, &FeedMessageViewer::onMessageRemoved);
|
||||
connect(m_messagesBrowser,
|
||||
&MessagePreviewer::markMessageRead,
|
||||
m_messagesView->sourceModel(),
|
||||
@ -266,6 +275,11 @@ void FeedMessageViewer::createConnections() {
|
||||
&MessagesView::reloadSelections);
|
||||
}
|
||||
|
||||
void FeedMessageViewer::updateArticleViewerSettings() {
|
||||
m_articleViewerAlwaysVisible =
|
||||
qApp->settings()->value(GROUP(Messages), SETTING(Messages::AlwaysDisplayItemPreview)).toBool();
|
||||
}
|
||||
|
||||
MessagePreviewer* FeedMessageViewer::messagesBrowser() const {
|
||||
return m_messagesBrowser;
|
||||
}
|
||||
@ -279,7 +293,11 @@ void FeedMessageViewer::initialize() {
|
||||
m_toolBarMessages->setMovable(false);
|
||||
m_toolBarMessages->setAllowedAreas(Qt::ToolBarArea::TopToolBarArea);
|
||||
|
||||
// m_messagesBrowser->clear();
|
||||
updateArticleViewerSettings();
|
||||
|
||||
if (!m_articleViewerAlwaysVisible) {
|
||||
m_messagesBrowser->clear();
|
||||
}
|
||||
|
||||
// Now refresh visual setup.
|
||||
refreshVisualProperties();
|
||||
|
@ -21,7 +21,7 @@ class QSplitter;
|
||||
class QProgressBar;
|
||||
|
||||
class RSSGUARD_DLLSPEC FeedMessageViewer : public TabContent {
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FeedMessageViewer(QWidget* parent = nullptr);
|
||||
@ -54,6 +54,8 @@ class RSSGUARD_DLLSPEC FeedMessageViewer : public TabContent {
|
||||
// Reloads some changeable visual settings.
|
||||
void refreshVisualProperties();
|
||||
|
||||
void updateArticleViewerSettings();
|
||||
|
||||
// Switches visibility of feed list and related
|
||||
// toolbar.
|
||||
void switchFeedComponentVisibility();
|
||||
@ -69,19 +71,17 @@ class RSSGUARD_DLLSPEC FeedMessageViewer : public TabContent {
|
||||
void onFeedSplitterResized();
|
||||
void onMessageSplitterResized();
|
||||
void displayMessage(const Message& message, RootItem* root);
|
||||
void onMessageRemoved(RootItem* root);
|
||||
|
||||
protected:
|
||||
private:
|
||||
void initialize();
|
||||
|
||||
// Initializes both messages/feeds views.
|
||||
void initializeViews();
|
||||
|
||||
// Sets up connections.
|
||||
void createConnections();
|
||||
|
||||
private:
|
||||
bool m_toolBarsEnabled;
|
||||
bool m_listHeadersEnabled;
|
||||
bool m_articleViewerAlwaysVisible;
|
||||
FeedsToolBar* m_toolBarFeeds;
|
||||
MessagesToolBar* m_toolBarMessages;
|
||||
QSplitter* m_feedSplitter;
|
||||
|
35
src/librssguard/gui/itemdetails.cpp
Executable file
35
src/librssguard/gui/itemdetails.cpp
Executable file
@ -0,0 +1,35 @@
|
||||
// For license of this file, see <project-root-folder>/LICENSE.md.
|
||||
|
||||
#include "gui/itemdetails.h"
|
||||
|
||||
#include "definitions/definitions.h"
|
||||
#include "services/abstract/rootitem.h"
|
||||
|
||||
ItemDetails::ItemDetails(QWidget* parent) : QWidget(parent) {
|
||||
m_ui.setupUi(this);
|
||||
}
|
||||
|
||||
ItemDetails::~ItemDetails() {}
|
||||
|
||||
void ItemDetails::loadItemDetails(RootItem* item) {
|
||||
if (item == nullptr) {
|
||||
m_ui.m_lblIcon->setPixmap(QPixmap(APP_ICON_PATH).scaled(128, 128));
|
||||
m_ui.m_lblInfo->setText(QSL("<b>%1</b>").arg(QSL(APP_LONG_NAME)));
|
||||
}
|
||||
else {
|
||||
QString tool_tip = QSL("<b>%1</b>").arg(item->title());
|
||||
QString desc = item->description();
|
||||
QString extra_tooltip = item->additionalTooltip();
|
||||
|
||||
if (!desc.isEmpty()) {
|
||||
tool_tip += QL1S("<br/><br/>") + desc.replace(QSL("\n"), QSL("<br/>"));
|
||||
}
|
||||
|
||||
if (!extra_tooltip.isEmpty()) {
|
||||
tool_tip += QL1S("<br/><br/>") + extra_tooltip.replace(QSL("\n"), QSL("<br/>"));
|
||||
}
|
||||
|
||||
m_ui.m_lblIcon->setPixmap(item->fullIcon().pixmap({128, 128}));
|
||||
m_ui.m_lblInfo->setText(tool_tip);
|
||||
}
|
||||
}
|
25
src/librssguard/gui/itemdetails.h
Executable file
25
src/librssguard/gui/itemdetails.h
Executable file
@ -0,0 +1,25 @@
|
||||
// For license of this file, see <project-root-folder>/LICENSE.md.
|
||||
|
||||
#ifndef ITEMDETAILS_H
|
||||
#define ITEMDETAILS_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "ui_itemdetails.h"
|
||||
|
||||
class RootItem;
|
||||
|
||||
class ItemDetails : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ItemDetails(QWidget* parent = nullptr);
|
||||
virtual ~ItemDetails();
|
||||
|
||||
void loadItemDetails(RootItem* item);
|
||||
|
||||
private:
|
||||
Ui::ItemDetails m_ui;
|
||||
};
|
||||
|
||||
#endif // ITEMDETAILS_H
|
50
src/librssguard/gui/itemdetails.ui
Executable file
50
src/librssguard/gui/itemdetails.ui
Executable file
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ItemDetails</class>
|
||||
<widget class="QWidget" name="ItemDetails">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>557</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="m_lblIcon">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_lblInfo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "database/databasequeries.h"
|
||||
#include "gui/dialogs/formmain.h"
|
||||
#include "gui/itemdetails.h"
|
||||
#include "gui/messagebox.h"
|
||||
#include "gui/reusable/plaintoolbutton.h"
|
||||
#include "gui/reusable/searchtextwidget.h"
|
||||
@ -48,8 +49,8 @@ void MessagePreviewer::createConnections() {
|
||||
MessagePreviewer::MessagePreviewer(QWidget* parent)
|
||||
: QWidget(parent), m_mainLayout(new QGridLayout(this)), m_viewerLayout(new QStackedLayout()),
|
||||
m_toolBar(new QToolBar(this)), m_msgBrowser(new WebBrowser(nullptr, this)), m_separator(nullptr),
|
||||
m_btnLabels(QList<QPair<LabelButton*, QAction*>>()) {
|
||||
|
||||
m_btnLabels(QList<QPair<LabelButton*, QAction*>>()), m_itemDetails(new ItemDetails(this)),
|
||||
m_toolbarVisible(m_toolBar->isVisible()) {
|
||||
m_toolBar->setOrientation(Qt::Orientation::Vertical);
|
||||
|
||||
// NOTE: To make sure that if we have many labels and short message
|
||||
@ -59,6 +60,7 @@ MessagePreviewer::MessagePreviewer(QWidget* parent)
|
||||
// This layout holds standard article browser on index 0
|
||||
// and optional custom browser on index 1.
|
||||
m_viewerLayout->addWidget(m_msgBrowser);
|
||||
m_viewerLayout->addWidget(m_itemDetails);
|
||||
|
||||
m_mainLayout->setContentsMargins(3, 3, 3, 3);
|
||||
m_mainLayout->addLayout(m_viewerLayout, 0, 1, 1, 1);
|
||||
@ -67,18 +69,15 @@ MessagePreviewer::MessagePreviewer(QWidget* parent)
|
||||
createConnections();
|
||||
|
||||
m_actionSwitchImportance->setCheckable(true);
|
||||
|
||||
clear();
|
||||
}
|
||||
|
||||
MessagePreviewer::~MessagePreviewer() {
|
||||
if (m_viewerLayout->count() > 1) {
|
||||
// Make sure that previewer does not delete any custom article
|
||||
// viewers as those are responsibility to free by their accounts.
|
||||
auto* wdg = m_viewerLayout->widget(1);
|
||||
// Make sure that previewer does not delete any custom article
|
||||
// viewers as those are responsibility to free by their accounts.
|
||||
auto* wdg = m_viewerLayout->widget(INDEX_CUSTOM);
|
||||
|
||||
if (wdg != nullptr) {
|
||||
wdg->setParent(nullptr);
|
||||
|
||||
m_viewerLayout->removeWidget(wdg);
|
||||
}
|
||||
}
|
||||
@ -88,6 +87,8 @@ void MessagePreviewer::reloadFontSettings() {
|
||||
}
|
||||
|
||||
void MessagePreviewer::setToolbarsVisible(bool visible) {
|
||||
m_toolbarVisible = visible;
|
||||
|
||||
m_toolBar->setVisible(visible);
|
||||
m_msgBrowser->setNavigationBarVisible(visible);
|
||||
|
||||
@ -107,20 +108,28 @@ void MessagePreviewer::clear() {
|
||||
m_message = Message();
|
||||
}
|
||||
|
||||
void MessagePreviewer::showItemInfo(RootItem* item) {
|
||||
m_msgBrowser->setHtml(item->additionalTooltip());
|
||||
}
|
||||
void MessagePreviewer::showItemDetails(RootItem* item) {
|
||||
m_toolBar->setVisible(m_toolbarVisible);
|
||||
m_message = Message();
|
||||
m_root = item;
|
||||
|
||||
void MessagePreviewer::hideToolbar() {
|
||||
m_toolBar->setVisible(false);
|
||||
ensureItemDetailsVisible();
|
||||
m_itemDetails->loadItemDetails(item);
|
||||
show();
|
||||
}
|
||||
|
||||
void MessagePreviewer::loadUrl(const QString& url) {
|
||||
m_toolBar->setVisible(m_toolbarVisible);
|
||||
m_message = Message();
|
||||
m_root.clear();
|
||||
|
||||
ensureDefaultBrowserVisible();
|
||||
m_msgBrowser->loadUrl(url);
|
||||
}
|
||||
|
||||
void MessagePreviewer::loadMessage(const Message& message, RootItem* root) {
|
||||
m_toolBar->setVisible(m_toolbarVisible);
|
||||
|
||||
bool same_message = message.m_id == m_message.m_id && m_root == root;
|
||||
|
||||
m_message = message;
|
||||
@ -149,7 +158,7 @@ void MessagePreviewer::loadMessage(const Message& message, RootItem* root) {
|
||||
CustomMessagePreviewer* custom_previewer = root->getParentServiceRoot()->customMessagePreviewer();
|
||||
|
||||
if (custom_previewer != nullptr) {
|
||||
auto* current_custom_previewer = m_viewerLayout->widget(1);
|
||||
auto* current_custom_previewer = m_viewerLayout->widget(INDEX_CUSTOM);
|
||||
|
||||
if (current_custom_previewer != nullptr) {
|
||||
if (current_custom_previewer != custom_previewer) {
|
||||
@ -161,7 +170,7 @@ void MessagePreviewer::loadMessage(const Message& message, RootItem* root) {
|
||||
m_viewerLayout->addWidget(custom_previewer);
|
||||
}
|
||||
|
||||
m_viewerLayout->setCurrentIndex(1);
|
||||
m_viewerLayout->setCurrentIndex(INDEX_CUSTOM);
|
||||
custom_previewer->loadMessage(message, root);
|
||||
}
|
||||
else {
|
||||
@ -295,12 +304,20 @@ void MessagePreviewer::updateLabels(bool only_clear) {
|
||||
}
|
||||
}
|
||||
|
||||
void MessagePreviewer::ensureDefaultBrowserVisible() {
|
||||
if (m_viewerLayout->count() > 1) {
|
||||
m_viewerLayout->removeWidget(m_viewerLayout->widget(1));
|
||||
void MessagePreviewer::ensureItemDetailsVisible() {
|
||||
if (m_viewerLayout->count() > INDEX_CUSTOM) {
|
||||
m_viewerLayout->removeWidget(m_viewerLayout->widget(INDEX_CUSTOM));
|
||||
}
|
||||
|
||||
m_viewerLayout->setCurrentIndex(0);
|
||||
m_viewerLayout->setCurrentIndex(INDEX_ITEMS);
|
||||
}
|
||||
|
||||
void MessagePreviewer::ensureDefaultBrowserVisible() {
|
||||
if (m_viewerLayout->count() > INDEX_CUSTOM) {
|
||||
m_viewerLayout->removeWidget(m_viewerLayout->widget(INDEX_CUSTOM));
|
||||
}
|
||||
|
||||
m_viewerLayout->setCurrentIndex(INDEX_DEFAULT);
|
||||
}
|
||||
|
||||
LabelButton::LabelButton(QWidget* parent) : QToolButton(parent), m_label(nullptr) {}
|
||||
|
@ -10,11 +10,13 @@
|
||||
#include "services/abstract/rootitem.h"
|
||||
|
||||
#include <QPointer>
|
||||
#include <QUrl>
|
||||
|
||||
class QGridLayout;
|
||||
class QStackedLayout;
|
||||
class QToolBar;
|
||||
class WebBrowser;
|
||||
class ItemDetails;
|
||||
|
||||
class LabelButton : public QToolButton {
|
||||
Q_OBJECT
|
||||
@ -38,13 +40,13 @@ class MessagePreviewer : public QWidget {
|
||||
|
||||
void reloadFontSettings();
|
||||
|
||||
virtual WebBrowser* webBrowser() const;
|
||||
WebBrowser* webBrowser() const;
|
||||
|
||||
public slots:
|
||||
void setToolbarsVisible(bool visible);
|
||||
void clear();
|
||||
void showItemInfo(RootItem* item);
|
||||
void hideToolbar();
|
||||
|
||||
void showItemDetails(RootItem* item);
|
||||
void loadUrl(const QString& url);
|
||||
void loadMessage(const Message& message, RootItem* root);
|
||||
|
||||
@ -63,6 +65,8 @@ class MessagePreviewer : public QWidget {
|
||||
void createConnections();
|
||||
void updateButtons();
|
||||
void updateLabels(bool only_clear);
|
||||
|
||||
void ensureItemDetailsVisible();
|
||||
void ensureDefaultBrowserVisible();
|
||||
|
||||
QGridLayout* m_mainLayout;
|
||||
@ -76,6 +80,12 @@ class MessagePreviewer : public QWidget {
|
||||
QAction* m_actionSwitchImportance;
|
||||
QAction* m_separator;
|
||||
QList<QPair<LabelButton*, QAction*>> m_btnLabels;
|
||||
ItemDetails* m_itemDetails;
|
||||
bool m_toolbarVisible;
|
||||
|
||||
static const int INDEX_DEFAULT = 0;
|
||||
static const int INDEX_ITEMS = 1;
|
||||
static const int INDEX_CUSTOM = 2;
|
||||
};
|
||||
|
||||
#endif // MESSAGEPREVIEWER_H
|
||||
|
@ -237,7 +237,7 @@ void MessagesView::reloadSelections() {
|
||||
else {
|
||||
// Messages were probably removed from the model, nothing can
|
||||
// be selected and no message can be displayed.
|
||||
emit currentMessageRemoved();
|
||||
emit currentMessageRemoved(m_sourceModel->loadedItem());
|
||||
}
|
||||
|
||||
const QDateTime dt2 = QDateTime::currentDateTime();
|
||||
@ -386,7 +386,7 @@ void MessagesView::initializeContextMenu() {
|
||||
m_sourceModel->loadedItem());
|
||||
}
|
||||
else {
|
||||
emit currentMessageRemoved();
|
||||
emit currentMessageRemoved(m_sourceModel->loadedItem());
|
||||
}
|
||||
});
|
||||
|
||||
@ -493,7 +493,7 @@ void MessagesView::selectionChanged(const QItemSelection& selected, const QItemS
|
||||
emit currentMessageChanged(message, m_sourceModel->loadedItem());
|
||||
}
|
||||
else {
|
||||
emit currentMessageRemoved();
|
||||
emit currentMessageRemoved(m_sourceModel->loadedItem());
|
||||
}
|
||||
|
||||
if (selected_rows.isEmpty()) {
|
||||
@ -518,7 +518,7 @@ void MessagesView::loadItem(RootItem* item) {
|
||||
|
||||
// Messages are loaded, make sure that previously
|
||||
// active message is not shown in browser.
|
||||
emit currentMessageRemoved();
|
||||
emit currentMessageRemoved(m_sourceModel->loadedItem());
|
||||
}
|
||||
|
||||
void MessagesView::changeFilter(MessagesProxyModel::MessageListFilter filter) {
|
||||
@ -614,7 +614,7 @@ void MessagesView::setSelectedMessagesReadStatus(RootItem::ReadStatus read) {
|
||||
m_sourceModel->loadedItem());
|
||||
}
|
||||
else {
|
||||
emit currentMessageRemoved();
|
||||
emit currentMessageRemoved(m_sourceModel->loadedItem());
|
||||
}
|
||||
}
|
||||
|
||||
@ -636,7 +636,7 @@ void MessagesView::deleteSelectedMessages() {
|
||||
setCurrentIndex(current_index);
|
||||
}
|
||||
else {
|
||||
emit currentMessageRemoved();
|
||||
emit currentMessageRemoved(m_sourceModel->loadedItem());
|
||||
}
|
||||
}
|
||||
|
||||
@ -658,7 +658,7 @@ void MessagesView::restoreSelectedMessages() {
|
||||
m_sourceModel->loadedItem());
|
||||
}
|
||||
else {
|
||||
emit currentMessageRemoved();
|
||||
emit currentMessageRemoved(m_sourceModel->loadedItem());
|
||||
}
|
||||
}
|
||||
|
||||
@ -681,7 +681,7 @@ void MessagesView::switchSelectedMessagesImportance() {
|
||||
else {
|
||||
// Messages were probably removed from the model, nothing can
|
||||
// be selected and no message can be displayed.
|
||||
emit currentMessageRemoved();
|
||||
emit currentMessageRemoved(m_sourceModel->loadedItem());
|
||||
}
|
||||
}
|
||||
|
||||
@ -786,7 +786,7 @@ void MessagesView::searchMessages(SearchLineEdit::SearchMode mode,
|
||||
: -1);
|
||||
|
||||
if (selectionModel()->selectedRows().isEmpty()) {
|
||||
emit currentMessageRemoved();
|
||||
emit currentMessageRemoved(m_sourceModel->loadedItem());
|
||||
}
|
||||
else {
|
||||
// Scroll to selected message, it could become scrolled out due to filter change.
|
||||
@ -858,5 +858,5 @@ void MessagesView::onSortIndicatorChanged(int column, Qt::SortOrder order) {
|
||||
// Repopulate the shit.
|
||||
sort(column, order, true, false, false, false);
|
||||
|
||||
emit currentMessageRemoved();
|
||||
emit currentMessageRemoved(m_sourceModel->loadedItem());
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ class MessagesView : public BaseTreeView {
|
||||
|
||||
// Notify others about message selections.
|
||||
void currentMessageChanged(const Message& message, RootItem* root);
|
||||
void currentMessageRemoved();
|
||||
void currentMessageRemoved(RootItem* root);
|
||||
void willReselectSameMessage();
|
||||
|
||||
private:
|
||||
|
@ -67,7 +67,7 @@ SettingsFeedsMessages::SettingsFeedsMessages(Settings* settings, QWidget* parent
|
||||
connect(m_ui->m_checkAutoUpdateOnlyUnfocused, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
||||
connect(m_ui->m_checkDisplayFeedIcons, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
||||
connect(m_ui->m_checkKeppMessagesInTheMiddle, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
||||
|
||||
connect(m_ui->m_cbArticleViewerAlwaysVisible, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
||||
connect(m_ui->m_checkMessagesDateTimeFormat, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
||||
connect(m_ui->m_checkMessagesDateTimeFormat,
|
||||
&QCheckBox::toggled,
|
||||
@ -255,6 +255,8 @@ void SettingsFeedsMessages::loadSettings() {
|
||||
m_ui->m_checkMultilineArticleList
|
||||
->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::MultilineArticleList)).toBool());
|
||||
|
||||
m_ui->m_cbArticleViewerAlwaysVisible
|
||||
->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::AlwaysDisplayItemPreview)).toBool());
|
||||
m_ui->m_spinHeightImageAttachments
|
||||
->setValue(settings()->value(GROUP(Messages), SETTING(Messages::MessageHeadImageHeight)).toInt());
|
||||
m_ui->m_cbShowEnclosuresDirectly
|
||||
@ -339,6 +341,9 @@ void SettingsFeedsMessages::saveSettings() {
|
||||
Messages::FixupFutureArticleDateTimes,
|
||||
m_ui->m_cbFixupArticleDatetime->isChecked());
|
||||
|
||||
settings()->setValue(GROUP(Messages),
|
||||
Messages::AlwaysDisplayItemPreview,
|
||||
m_ui->m_cbArticleViewerAlwaysVisible->isChecked());
|
||||
settings()->setValue(GROUP(Messages), Messages::UseCustomDate, m_ui->m_checkMessagesDateTimeFormat->isChecked());
|
||||
settings()->setValue(GROUP(Messages), Messages::UseCustomTime, m_ui->m_checkMessagesTimeFormat->isChecked());
|
||||
|
||||
@ -353,6 +358,7 @@ void SettingsFeedsMessages::saveSettings() {
|
||||
settings()->setValue(GROUP(Messages), Messages::CustomizeListFont, m_ui->m_gbArticleListFont->isChecked());
|
||||
settings()->setValue(GROUP(Feeds), Feeds::CustomizeListFont, m_ui->m_gbFeedListFont->isChecked());
|
||||
|
||||
qApp->mainForm()->tabWidget()->feedMessageViewer()->updateArticleViewerSettings();
|
||||
qApp->mainForm()->tabWidget()->feedMessageViewer()->loadMessageViewerFonts();
|
||||
|
||||
qApp->feedReader()->updateAutoUpdateStatus();
|
||||
|
@ -270,28 +270,28 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="m_cmbIgnoreContentsChanges">
|
||||
<property name="text">
|
||||
<string>Ignore changes in article body when new articles are being fetched</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="m_cbFixupArticleDatetime">
|
||||
<property name="text">
|
||||
<string>Fixup date/time of articles which are in the future</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="m_checkBringToForegroundAfterMsgOpened">
|
||||
<property name="text">
|
||||
<string>Bring application window to front once article is opened in external web browser</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Internal article viewer</string>
|
||||
@ -390,6 +390,13 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="m_cbArticleViewerAlwaysVisible">
|
||||
<property name="text">
|
||||
<string>Keep article viewer always visible</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="m_tabArticlesList">
|
||||
@ -620,6 +627,7 @@
|
||||
<tabstop>m_cbListsRestrictedShortcuts</tabstop>
|
||||
<tabstop>m_checkShowTooltips</tabstop>
|
||||
<tabstop>m_checkRemoveReadMessagesOnExit</tabstop>
|
||||
<tabstop>m_cbArticleViewerAlwaysVisible</tabstop>
|
||||
<tabstop>m_cmbIgnoreContentsChanges</tabstop>
|
||||
<tabstop>m_cbFixupArticleDatetime</tabstop>
|
||||
<tabstop>m_checkBringToForegroundAfterMsgOpened</tabstop>
|
||||
@ -638,6 +646,8 @@
|
||||
<tabstop>m_spinRelativeArticleTime</tabstop>
|
||||
<tabstop>m_btnChangeMessageListFont</tabstop>
|
||||
<tabstop>m_tabFeedsMessages</tabstop>
|
||||
<tabstop>m_gbFeedListFont</tabstop>
|
||||
<tabstop>m_gbArticleListFont</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
@ -103,10 +103,6 @@ void WebBrowser::loadUrl(const QUrl& url) {
|
||||
}
|
||||
}
|
||||
|
||||
void WebBrowser::setHtml(const QString& html, const QUrl& base_url) {
|
||||
m_webView->setHtml(html, base_url);
|
||||
}
|
||||
|
||||
WebBrowser::~WebBrowser() {}
|
||||
|
||||
double WebBrowser::verticalScrollBarPosition() const {
|
||||
@ -143,6 +139,10 @@ void WebBrowser::loadUrl(const QString& url) {
|
||||
return loadUrl(QUrl::fromUserInput(url));
|
||||
}
|
||||
|
||||
void WebBrowser::setHtml(const QString& html, const QUrl& base_url) {
|
||||
m_webView->setHtml(html, base_url);
|
||||
}
|
||||
|
||||
void WebBrowser::loadMessages(const QList<Message>& messages, RootItem* root) {
|
||||
m_messages = messages;
|
||||
m_root = root;
|
||||
|
@ -127,6 +127,9 @@ DVALUE(int) Messages::MessageHeadImageHeightDef = 36;
|
||||
DKEY Messages::DisplayEnclosuresInMessage = "show_enclosures_in_message";
|
||||
DVALUE(bool) Messages::DisplayEnclosuresInMessageDef = false;
|
||||
|
||||
DKEY Messages::AlwaysDisplayItemPreview = "always_display_preview";
|
||||
DVALUE(bool) Messages::AlwaysDisplayItemPreviewDef = true;
|
||||
|
||||
DKEY Messages::EnableMessagePreview = "enable_message_preview";
|
||||
DVALUE(bool) Messages::EnableMessagePreviewDef = true;
|
||||
|
||||
|
@ -126,6 +126,9 @@ namespace Messages {
|
||||
KEY DisplayEnclosuresInMessage;
|
||||
VALUE(bool) DisplayEnclosuresInMessageDef;
|
||||
|
||||
KEY AlwaysDisplayItemPreview;
|
||||
VALUE(bool) AlwaysDisplayItemPreviewDef;
|
||||
|
||||
KEY EnableMessagePreview;
|
||||
VALUE(bool) EnableMessagePreviewDef;
|
||||
|
||||
|
@ -562,7 +562,7 @@ RootItem* ServiceRoot::obtainNewTreeForSyncIn() const {
|
||||
QStringList ServiceRoot::customIDSOfMessagesForItem(RootItem* item) {
|
||||
if (item->getParentServiceRoot() != this) {
|
||||
// Not item from this account.
|
||||
return QStringList();
|
||||
return {};
|
||||
}
|
||||
else {
|
||||
QStringList list;
|
||||
@ -625,7 +625,7 @@ QStringList ServiceRoot::customIDSOfMessagesForItem(RootItem* item) {
|
||||
break;
|
||||
}
|
||||
|
||||
qDebug() << "Custom IDs of messages for some operation are:" << list;
|
||||
qDebugNN << LOGSEC_CORE << "Custom IDs of messages for some operation are:" << QUOTE_W_SPACE_DOT(list);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user