fixed #380 - search in feeds
This commit is contained in:
parent
0110590fa8
commit
f5b00e9186
24 changed files with 134 additions and 75 deletions
|
@ -13,11 +13,18 @@
|
||||||
FeedsProxyModel::FeedsProxyModel(FeedsModel* source_model, QObject* parent)
|
FeedsProxyModel::FeedsProxyModel(FeedsModel* source_model, QObject* parent)
|
||||||
: QSortFilterProxyModel(parent), m_sourceModel(source_model), m_selectedItem(nullptr), m_showUnreadOnly(false) {
|
: QSortFilterProxyModel(parent), m_sourceModel(source_model), m_selectedItem(nullptr), m_showUnreadOnly(false) {
|
||||||
setObjectName(QSL("FeedsProxyModel"));
|
setObjectName(QSL("FeedsProxyModel"));
|
||||||
|
|
||||||
setSortRole(Qt::ItemDataRole::EditRole);
|
setSortRole(Qt::ItemDataRole::EditRole);
|
||||||
setSortCaseSensitivity(Qt::CaseSensitivity::CaseInsensitive);
|
setSortCaseSensitivity(Qt::CaseSensitivity::CaseInsensitive);
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050A00 // Qt >= 5.10.0
|
||||||
|
setRecursiveFilteringEnabled(true);
|
||||||
|
#endif
|
||||||
|
|
||||||
setFilterCaseSensitivity(Qt::CaseSensitivity::CaseInsensitive);
|
setFilterCaseSensitivity(Qt::CaseSensitivity::CaseInsensitive);
|
||||||
setFilterKeyColumn(-1);
|
setFilterKeyColumn(-1);
|
||||||
setFilterRole(Qt::ItemDataRole::EditRole);
|
setFilterRole(Qt::ItemDataRole::EditRole);
|
||||||
|
|
||||||
setDynamicSortFilter(true);
|
setDynamicSortFilter(true);
|
||||||
setSourceModel(m_sourceModel);
|
setSourceModel(m_sourceModel);
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
#define HIGHLIGHTER_ACTION_NAME "highlighter"
|
#define HIGHLIGHTER_ACTION_NAME "highlighter"
|
||||||
#define SPACER_ACTION_NAME "spacer"
|
#define SPACER_ACTION_NAME "spacer"
|
||||||
#define SEPARATOR_ACTION_NAME "separator"
|
#define SEPARATOR_ACTION_NAME "separator"
|
||||||
#define FILTER_WIDTH 150
|
#define FILTER_WIDTH 125
|
||||||
#define FILTER_RIGHT_MARGIN 5
|
#define FILTER_RIGHT_MARGIN 5
|
||||||
#define FEEDS_VIEW_INDENTATION 10
|
#define FEEDS_VIEW_INDENTATION 10
|
||||||
#define MIME_TYPE_ITEM_POINTER "rssguard/itempointer"
|
#define MIME_TYPE_ITEM_POINTER "rssguard/itempointer"
|
||||||
|
|
|
@ -9,8 +9,6 @@ class BaseLineEdit : public QLineEdit {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors and destructors.
|
|
||||||
explicit BaseLineEdit(QWidget* parent = nullptr);
|
explicit BaseLineEdit(QWidget* parent = nullptr);
|
||||||
virtual ~BaseLineEdit() = default;
|
virtual ~BaseLineEdit() = default;
|
||||||
|
|
||||||
|
|
|
@ -12,16 +12,16 @@
|
||||||
#include "gui/dialogs/formsettings.h"
|
#include "gui/dialogs/formsettings.h"
|
||||||
#include "gui/dialogs/formupdate.h"
|
#include "gui/dialogs/formupdate.h"
|
||||||
#include "gui/feedmessageviewer.h"
|
#include "gui/feedmessageviewer.h"
|
||||||
#include "gui/feedstoolbar.h"
|
|
||||||
#include "gui/feedsview.h"
|
#include "gui/feedsview.h"
|
||||||
#include "gui/messagebox.h"
|
#include "gui/messagebox.h"
|
||||||
#include "gui/messagepreviewer.h"
|
#include "gui/messagepreviewer.h"
|
||||||
#include "gui/messagestoolbar.h"
|
|
||||||
#include "gui/messagesview.h"
|
#include "gui/messagesview.h"
|
||||||
#include "gui/plaintoolbutton.h"
|
#include "gui/plaintoolbutton.h"
|
||||||
#include "gui/statusbar.h"
|
|
||||||
#include "gui/systemtrayicon.h"
|
#include "gui/systemtrayicon.h"
|
||||||
#include "gui/tabbar.h"
|
#include "gui/tabbar.h"
|
||||||
|
#include "gui/toolbars/feedstoolbar.h"
|
||||||
|
#include "gui/toolbars/messagestoolbar.h"
|
||||||
|
#include "gui/toolbars/statusbar.h"
|
||||||
#include "miscellaneous/application.h"
|
#include "miscellaneous/application.h"
|
||||||
#include "miscellaneous/feedreader.h"
|
#include "miscellaneous/feedreader.h"
|
||||||
#include "miscellaneous/iconfactory.h"
|
#include "miscellaneous/iconfactory.h"
|
||||||
|
|
|
@ -10,14 +10,14 @@
|
||||||
#include "exceptions/applicationexception.h"
|
#include "exceptions/applicationexception.h"
|
||||||
#include "gui/dialogs/formdatabasecleanup.h"
|
#include "gui/dialogs/formdatabasecleanup.h"
|
||||||
#include "gui/dialogs/formmain.h"
|
#include "gui/dialogs/formmain.h"
|
||||||
#include "gui/feedstoolbar.h"
|
|
||||||
#include "gui/feedsview.h"
|
#include "gui/feedsview.h"
|
||||||
#include "gui/messagebox.h"
|
#include "gui/messagebox.h"
|
||||||
#include "gui/messagepreviewer.h"
|
#include "gui/messagepreviewer.h"
|
||||||
#include "gui/messagestoolbar.h"
|
|
||||||
#include "gui/messagesview.h"
|
#include "gui/messagesview.h"
|
||||||
#include "gui/statusbar.h"
|
|
||||||
#include "gui/systemtrayicon.h"
|
#include "gui/systemtrayicon.h"
|
||||||
|
#include "gui/toolbars/feedstoolbar.h"
|
||||||
|
#include "gui/toolbars/messagestoolbar.h"
|
||||||
|
#include "gui/toolbars/statusbar.h"
|
||||||
#include "miscellaneous/feedreader.h"
|
#include "miscellaneous/feedreader.h"
|
||||||
#include "miscellaneous/iconfactory.h"
|
#include "miscellaneous/iconfactory.h"
|
||||||
#include "miscellaneous/mutex.h"
|
#include "miscellaneous/mutex.h"
|
||||||
|
@ -215,6 +215,7 @@ void FeedMessageViewer::displayMessage(const Message& message, RootItem* root) {
|
||||||
void FeedMessageViewer::createConnections() {
|
void FeedMessageViewer::createConnections() {
|
||||||
// Filtering & searching.
|
// Filtering & searching.
|
||||||
connect(m_toolBarMessages, &MessagesToolBar::messageSearchPatternChanged, m_messagesView, &MessagesView::searchMessages);
|
connect(m_toolBarMessages, &MessagesToolBar::messageSearchPatternChanged, m_messagesView, &MessagesView::searchMessages);
|
||||||
|
connect(m_toolBarFeeds, &FeedsToolBar::feedsFilterPatternChanged, m_feedsView, &FeedsView::filterItems);
|
||||||
connect(m_toolBarMessages, &MessagesToolBar::messageFilterChanged, m_messagesView, &MessagesView::filterMessages);
|
connect(m_toolBarMessages, &MessagesToolBar::messageFilterChanged, m_messagesView, &MessagesView::filterMessages);
|
||||||
|
|
||||||
connect(m_messagesView, &MessagesView::currentMessageRemoved, m_messagesBrowser, &MessagePreviewer::clear);
|
connect(m_messagesView, &MessagesView::currentMessageRemoved, m_messagesBrowser, &MessagePreviewer::clear);
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
// For license of this file, see <project-root-folder>/LICENSE.md.
|
|
||||||
|
|
||||||
#ifndef FEEDSTOOLBAR_H
|
|
||||||
#define FEEDSTOOLBAR_H
|
|
||||||
|
|
||||||
#include "gui/basetoolbar.h"
|
|
||||||
|
|
||||||
class FeedsToolBar : public BaseToolBar {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit FeedsToolBar(const QString& title, QWidget* parent = nullptr);
|
|
||||||
|
|
||||||
QList<QAction*> availableActions() const;
|
|
||||||
QList<QAction*> activatedActions() const;
|
|
||||||
void saveAndSetActions(const QStringList& actions);
|
|
||||||
|
|
||||||
QList<QAction*> convertActions(const QStringList& actions);
|
|
||||||
void loadSpecificActions(const QList<QAction*>& actions, bool initial_load = false);
|
|
||||||
|
|
||||||
QStringList defaultActions() const;
|
|
||||||
QStringList savedActions() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // FEEDSTOOLBAR_H
|
|
|
@ -496,6 +496,18 @@ void FeedsView::switchVisibility() {
|
||||||
setVisible(!isVisible());
|
setVisible(!isVisible());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FeedsView::filterItems(const QString& pattern) {
|
||||||
|
#if QT_VERSION < 0x050C00 // Qt < 5.12.0
|
||||||
|
m_proxyModel->setFilterRegExp(pattern);
|
||||||
|
#else
|
||||||
|
m_proxyModel->setFilterRegularExpression(pattern);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (!pattern.simplified().isEmpty()) {
|
||||||
|
expandAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void FeedsView::drawBranches(QPainter* painter, const QRect& rect, const QModelIndex& index) const {
|
void FeedsView::drawBranches(QPainter* painter, const QRect& rect, const QModelIndex& index) const {
|
||||||
if (!rootIsDecorated()) {
|
if (!rootIsDecorated()) {
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
|
@ -75,6 +75,8 @@ class RSSGUARD_DLLSPEC FeedsView : public QTreeView {
|
||||||
// Switches visibility of the widget.
|
// Switches visibility of the widget.
|
||||||
void switchVisibility();
|
void switchVisibility();
|
||||||
|
|
||||||
|
void filterItems(const QString& pattern);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void itemSelected(RootItem* item);
|
void itemSelected(RootItem* item);
|
||||||
void requestViewNextUnreadMessage();
|
void requestViewNextUnreadMessage();
|
||||||
|
|
|
@ -580,7 +580,7 @@ void MessagesView::selectNextUnreadItem() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessagesView::searchMessages(const QString& pattern) {
|
void MessagesView::searchMessages(const QString& pattern) {
|
||||||
#if QT_VERSION_MAJOR <= 5
|
#if QT_VERSION < 0x050C00 // Qt < 5.12.0
|
||||||
m_proxyModel->setFilterRegExp(pattern);
|
m_proxyModel->setFilterRegExp(pattern);
|
||||||
#else
|
#else
|
||||||
m_proxyModel->setFilterRegularExpression(pattern);
|
m_proxyModel->setFilterRegularExpression(pattern);
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
#include "core/feedsmodel.h"
|
#include "core/feedsmodel.h"
|
||||||
#include "gui/dialogs/formmain.h"
|
#include "gui/dialogs/formmain.h"
|
||||||
#include "gui/feedmessageviewer.h"
|
#include "gui/feedmessageviewer.h"
|
||||||
#include "gui/feedstoolbar.h"
|
|
||||||
#include "gui/messagestoolbar.h"
|
|
||||||
#include "gui/statusbar.h"
|
|
||||||
#include "gui/systemtrayicon.h"
|
#include "gui/systemtrayicon.h"
|
||||||
#include "gui/tabwidget.h"
|
#include "gui/tabwidget.h"
|
||||||
|
#include "gui/toolbars/feedstoolbar.h"
|
||||||
|
#include "gui/toolbars/messagestoolbar.h"
|
||||||
|
#include "gui/toolbars/statusbar.h"
|
||||||
#include "miscellaneous/application.h"
|
#include "miscellaneous/application.h"
|
||||||
#include "miscellaneous/iconfactory.h"
|
#include "miscellaneous/iconfactory.h"
|
||||||
#include "miscellaneous/settings.h"
|
#include "miscellaneous/settings.h"
|
||||||
|
@ -36,6 +36,7 @@ SettingsGui::SettingsGui(Settings* settings, QWidget* parent) : SettingsPanel(se
|
||||||
m_ui->m_treeSkins->header()->setSectionResizeMode(1, QHeaderView::ResizeMode::ResizeToContents);
|
m_ui->m_treeSkins->header()->setSectionResizeMode(1, QHeaderView::ResizeMode::ResizeToContents);
|
||||||
m_ui->m_treeSkins->header()->setSectionResizeMode(2, QHeaderView::ResizeMode::ResizeToContents);
|
m_ui->m_treeSkins->header()->setSectionResizeMode(2, QHeaderView::ResizeMode::ResizeToContents);
|
||||||
m_ui->m_treeSkins->header()->setSectionResizeMode(3, QHeaderView::ResizeMode::ResizeToContents);
|
m_ui->m_treeSkins->header()->setSectionResizeMode(3, QHeaderView::ResizeMode::ResizeToContents);
|
||||||
|
|
||||||
connect(m_ui->m_cmbIconTheme, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &SettingsGui::requireRestart);
|
connect(m_ui->m_cmbIconTheme, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &SettingsGui::requireRestart);
|
||||||
connect(m_ui->m_cmbIconTheme, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
connect(m_ui->m_cmbIconTheme, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||||
&SettingsGui::dirtifySettings);
|
&SettingsGui::dirtifySettings);
|
||||||
|
|
2
src/librssguard/gui/basetoolbar.cpp → src/librssguard/gui/toolbars/basetoolbar.cpp
Normal file → Executable file
2
src/librssguard/gui/basetoolbar.cpp → src/librssguard/gui/toolbars/basetoolbar.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
// For license of this file, see <project-root-folder>/LICENSE.md.
|
// For license of this file, see <project-root-folder>/LICENSE.md.
|
||||||
|
|
||||||
#include "gui/basetoolbar.h"
|
#include "gui/toolbars/basetoolbar.h"
|
||||||
|
|
||||||
#include "definitions/definitions.h"
|
#include "definitions/definitions.h"
|
||||||
#include "gui/dialogs/formmain.h"
|
#include "gui/dialogs/formmain.h"
|
0
src/librssguard/gui/basetoolbar.h → src/librssguard/gui/toolbars/basetoolbar.h
Normal file → Executable file
0
src/librssguard/gui/basetoolbar.h → src/librssguard/gui/toolbars/basetoolbar.h
Normal file → Executable file
36
src/librssguard/gui/feedstoolbar.cpp → src/librssguard/gui/toolbars/feedstoolbar.cpp
Normal file → Executable file
36
src/librssguard/gui/feedstoolbar.cpp → src/librssguard/gui/toolbars/feedstoolbar.cpp
Normal file → Executable file
|
@ -1,7 +1,8 @@
|
||||||
// For license of this file, see <project-root-folder>/LICENSE.md.
|
// For license of this file, see <project-root-folder>/LICENSE.md.
|
||||||
|
|
||||||
#include "gui/feedstoolbar.h"
|
#include "gui/toolbars/feedstoolbar.h"
|
||||||
|
|
||||||
|
#include "gui/baselineedit.h"
|
||||||
#include "miscellaneous/application.h"
|
#include "miscellaneous/application.h"
|
||||||
#include "miscellaneous/iconfactory.h"
|
#include "miscellaneous/iconfactory.h"
|
||||||
#include "miscellaneous/settings.h"
|
#include "miscellaneous/settings.h"
|
||||||
|
@ -14,10 +15,16 @@ FeedsToolBar::FeedsToolBar(const QString& title, QWidget* parent) : BaseToolBar(
|
||||||
|
|
||||||
margins.setRight(margins.right() + FILTER_RIGHT_MARGIN);
|
margins.setRight(margins.right() + FILTER_RIGHT_MARGIN);
|
||||||
setContentsMargins(margins);
|
setContentsMargins(margins);
|
||||||
|
|
||||||
|
initializeSearchBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QAction*> FeedsToolBar::availableActions() const {
|
QList<QAction*> FeedsToolBar::availableActions() const {
|
||||||
return qApp->userActions();
|
QList<QAction*> available_actions = qApp->userActions();
|
||||||
|
|
||||||
|
available_actions.append(m_actionSearchMessages);
|
||||||
|
|
||||||
|
return available_actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QAction*> FeedsToolBar::activatedActions() const {
|
QList<QAction*> FeedsToolBar::activatedActions() const {
|
||||||
|
@ -27,6 +34,11 @@ QList<QAction*> FeedsToolBar::activatedActions() const {
|
||||||
void FeedsToolBar::saveAndSetActions(const QStringList& actions) {
|
void FeedsToolBar::saveAndSetActions(const QStringList& actions) {
|
||||||
qApp->settings()->setValue(GROUP(GUI), GUI::FeedsToolbarActions, actions.join(QSL(",")));
|
qApp->settings()->setValue(GROUP(GUI), GUI::FeedsToolbarActions, actions.join(QSL(",")));
|
||||||
loadSpecificActions(convertActions(actions));
|
loadSpecificActions(convertActions(actions));
|
||||||
|
|
||||||
|
// If user hidden search messages box, then remove the filter.
|
||||||
|
if (!activatedActions().contains(m_actionSearchMessages)) {
|
||||||
|
m_txtSearchMessages->clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QAction*> FeedsToolBar::convertActions(const QStringList& actions) {
|
QList<QAction*> FeedsToolBar::convertActions(const QStringList& actions) {
|
||||||
|
@ -48,6 +60,10 @@ QList<QAction*> FeedsToolBar::convertActions(const QStringList& actions) {
|
||||||
act->setSeparator(true);
|
act->setSeparator(true);
|
||||||
spec_actions.append(act);
|
spec_actions.append(act);
|
||||||
}
|
}
|
||||||
|
else if (action_name == SEARCH_BOX_ACTION_NAME) {
|
||||||
|
// Add search box.
|
||||||
|
spec_actions.append(m_actionSearchMessages);
|
||||||
|
}
|
||||||
else if (action_name == SPACER_ACTION_NAME) {
|
else if (action_name == SPACER_ACTION_NAME) {
|
||||||
// Add new spacer.
|
// Add new spacer.
|
||||||
auto* spacer = new QWidget(this);
|
auto* spacer = new QWidget(this);
|
||||||
|
@ -94,3 +110,19 @@ QStringList FeedsToolBar::savedActions() const {
|
||||||
QString::SplitBehavior::SkipEmptyParts);
|
QString::SplitBehavior::SkipEmptyParts);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FeedsToolBar::initializeSearchBox() {
|
||||||
|
m_txtSearchMessages = new BaseLineEdit(this);
|
||||||
|
m_txtSearchMessages->setFixedWidth(FILTER_WIDTH);
|
||||||
|
m_txtSearchMessages->setPlaceholderText(tr("Search feeds"));
|
||||||
|
|
||||||
|
// Setup wrapping action for search box.
|
||||||
|
m_actionSearchMessages = new QWidgetAction(this);
|
||||||
|
|
||||||
|
m_actionSearchMessages->setDefaultWidget(m_txtSearchMessages);
|
||||||
|
m_actionSearchMessages->setIcon(qApp->icons()->fromTheme(QSL("system-search")));
|
||||||
|
m_actionSearchMessages->setProperty("type", SEARCH_BOX_ACTION_NAME);
|
||||||
|
m_actionSearchMessages->setProperty("name", tr("Feeds search box"));
|
||||||
|
|
||||||
|
connect(m_txtSearchMessages, &BaseLineEdit::textChanged, this, &FeedsToolBar::feedsFilterPatternChanged);
|
||||||
|
}
|
36
src/librssguard/gui/toolbars/feedstoolbar.h
Executable file
36
src/librssguard/gui/toolbars/feedstoolbar.h
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
// For license of this file, see <project-root-folder>/LICENSE.md.
|
||||||
|
|
||||||
|
#ifndef FEEDSTOOLBAR_H
|
||||||
|
#define FEEDSTOOLBAR_H
|
||||||
|
|
||||||
|
#include "gui/toolbars/basetoolbar.h"
|
||||||
|
|
||||||
|
class BaseLineEdit;
|
||||||
|
class QWidgetAction;
|
||||||
|
|
||||||
|
class FeedsToolBar : public BaseToolBar {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit FeedsToolBar(const QString& title, QWidget* parent = nullptr);
|
||||||
|
|
||||||
|
virtual QList<QAction*> availableActions() const;
|
||||||
|
virtual QList<QAction*> activatedActions() const;
|
||||||
|
virtual void saveAndSetActions(const QStringList& actions);
|
||||||
|
virtual QList<QAction*> convertActions(const QStringList& actions);
|
||||||
|
virtual void loadSpecificActions(const QList<QAction*>& actions, bool initial_load = false);
|
||||||
|
virtual QStringList defaultActions() const;
|
||||||
|
virtual QStringList savedActions() const;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void feedsFilterPatternChanged(const QString& pattern);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void initializeSearchBox();
|
||||||
|
|
||||||
|
private:
|
||||||
|
BaseLineEdit* m_txtSearchMessages;
|
||||||
|
QWidgetAction* m_actionSearchMessages;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FEEDSTOOLBAR_H
|
6
src/librssguard/gui/messagestoolbar.cpp → src/librssguard/gui/toolbars/messagestoolbar.cpp
Normal file → Executable file
6
src/librssguard/gui/messagestoolbar.cpp → src/librssguard/gui/toolbars/messagestoolbar.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
// For license of this file, see <project-root-folder>/LICENSE.md.
|
// For license of this file, see <project-root-folder>/LICENSE.md.
|
||||||
|
|
||||||
#include "gui/messagestoolbar.h"
|
#include "gui/toolbars/messagestoolbar.h"
|
||||||
|
|
||||||
#include "definitions/definitions.h"
|
#include "definitions/definitions.h"
|
||||||
#include "gui/baselineedit.h"
|
#include "gui/baselineedit.h"
|
||||||
|
@ -11,8 +11,7 @@
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QWidgetAction>
|
#include <QWidgetAction>
|
||||||
|
|
||||||
MessagesToolBar::MessagesToolBar(const QString& title, QWidget* parent)
|
MessagesToolBar::MessagesToolBar(const QString& title, QWidget* parent) : BaseToolBar(title, parent) {
|
||||||
: BaseToolBar(title, parent) {
|
|
||||||
initializeSearchBox();
|
initializeSearchBox();
|
||||||
initializeHighlighter();
|
initializeHighlighter();
|
||||||
}
|
}
|
||||||
|
@ -22,6 +21,7 @@ QList<QAction*> MessagesToolBar::availableActions() const {
|
||||||
|
|
||||||
available_actions.append(m_actionSearchMessages);
|
available_actions.append(m_actionSearchMessages);
|
||||||
available_actions.append(m_actionMessageHighlighter);
|
available_actions.append(m_actionMessageHighlighter);
|
||||||
|
|
||||||
return available_actions;
|
return available_actions;
|
||||||
}
|
}
|
||||||
|
|
8
src/librssguard/gui/messagestoolbar.h → src/librssguard/gui/toolbars/messagestoolbar.h
Normal file → Executable file
8
src/librssguard/gui/messagestoolbar.h → src/librssguard/gui/toolbars/messagestoolbar.h
Normal file → Executable file
|
@ -3,7 +3,7 @@
|
||||||
#ifndef NEWSTOOLBAR_H
|
#ifndef NEWSTOOLBAR_H
|
||||||
#define NEWSTOOLBAR_H
|
#define NEWSTOOLBAR_H
|
||||||
|
|
||||||
#include "gui/basetoolbar.h"
|
#include "gui/toolbars/basetoolbar.h"
|
||||||
|
|
||||||
#include "core/messagesmodel.h"
|
#include "core/messagesmodel.h"
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ class MessagesToolBar : public BaseToolBar {
|
||||||
public:
|
public:
|
||||||
explicit MessagesToolBar(const QString& title, QWidget* parent = nullptr);
|
explicit MessagesToolBar(const QString& title, QWidget* parent = nullptr);
|
||||||
|
|
||||||
BaseLineEdit* searchLineEdit();
|
|
||||||
|
|
||||||
virtual QList<QAction*> availableActions() const;
|
virtual QList<QAction*> availableActions() const;
|
||||||
virtual QList<QAction*> activatedActions() const;
|
virtual QList<QAction*> activatedActions() const;
|
||||||
virtual void saveAndSetActions(const QStringList& actions);
|
virtual void saveAndSetActions(const QStringList& actions);
|
||||||
|
@ -47,8 +45,4 @@ class MessagesToolBar : public BaseToolBar {
|
||||||
BaseLineEdit* m_txtSearchMessages;
|
BaseLineEdit* m_txtSearchMessages;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline BaseLineEdit* MessagesToolBar::searchLineEdit() {
|
|
||||||
return m_txtSearchMessages;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // NEWSTOOLBAR_H
|
#endif // NEWSTOOLBAR_H
|
2
src/librssguard/gui/statusbar.cpp → src/librssguard/gui/toolbars/statusbar.cpp
Normal file → Executable file
2
src/librssguard/gui/statusbar.cpp → src/librssguard/gui/toolbars/statusbar.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
// For license of this file, see <project-root-folder>/LICENSE.md.
|
// For license of this file, see <project-root-folder>/LICENSE.md.
|
||||||
|
|
||||||
#include "gui/statusbar.h"
|
#include "gui/toolbars/statusbar.h"
|
||||||
|
|
||||||
#include "gui/dialogs/formmain.h"
|
#include "gui/dialogs/formmain.h"
|
||||||
#include "gui/plaintoolbutton.h"
|
#include "gui/plaintoolbutton.h"
|
16
src/librssguard/gui/statusbar.h → src/librssguard/gui/toolbars/statusbar.h
Normal file → Executable file
16
src/librssguard/gui/statusbar.h → src/librssguard/gui/toolbars/statusbar.h
Normal file → Executable file
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include <QStatusBar>
|
#include <QStatusBar>
|
||||||
|
|
||||||
#include "gui/basetoolbar.h"
|
#include "gui/toolbars/basetoolbar.h"
|
||||||
|
|
||||||
class QProgressBar;
|
class QProgressBar;
|
||||||
class QLabel;
|
class QLabel;
|
||||||
|
@ -18,13 +18,13 @@ class StatusBar : public QStatusBar, public BaseBar {
|
||||||
explicit StatusBar(QWidget* parent = nullptr);
|
explicit StatusBar(QWidget* parent = nullptr);
|
||||||
virtual ~StatusBar();
|
virtual ~StatusBar();
|
||||||
|
|
||||||
QList<QAction*> availableActions() const;
|
virtual QList<QAction*> availableActions() const;
|
||||||
QList<QAction*> activatedActions() const;
|
virtual QList<QAction*> activatedActions() const;
|
||||||
void saveAndSetActions(const QStringList& actions);
|
virtual void saveAndSetActions(const QStringList& actions);
|
||||||
QStringList defaultActions() const;
|
virtual QStringList defaultActions() const;
|
||||||
QStringList savedActions() const;
|
virtual QStringList savedActions() const;
|
||||||
QList<QAction*> convertActions(const QStringList& actions);
|
virtual QList<QAction*> convertActions(const QStringList& actions);
|
||||||
void loadSpecificActions(const QList<QAction*>& actions, bool initial_load = false);
|
virtual void loadSpecificActions(const QList<QAction*>& actions, bool initial_load = false);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void showProgressFeeds(int progress, const QString& label);
|
void showProgressFeeds(int progress, const QString& label);
|
4
src/librssguard/gui/toolbareditor.cpp → src/librssguard/gui/toolbars/toolbareditor.cpp
Normal file → Executable file
4
src/librssguard/gui/toolbareditor.cpp → src/librssguard/gui/toolbars/toolbareditor.cpp
Normal file → Executable file
|
@ -1,9 +1,9 @@
|
||||||
// For license of this file, see <project-root-folder>/LICENSE.md.
|
// For license of this file, see <project-root-folder>/LICENSE.md.
|
||||||
|
|
||||||
#include "gui/toolbareditor.h"
|
#include "gui/toolbars/toolbareditor.h"
|
||||||
|
|
||||||
#include "gui/basetoolbar.h"
|
|
||||||
#include "gui/dialogs/formmain.h"
|
#include "gui/dialogs/formmain.h"
|
||||||
|
#include "gui/toolbars/basetoolbar.h"
|
||||||
|
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
|
0
src/librssguard/gui/toolbareditor.h → src/librssguard/gui/toolbars/toolbareditor.h
Normal file → Executable file
0
src/librssguard/gui/toolbareditor.h → src/librssguard/gui/toolbars/toolbareditor.h
Normal file → Executable file
0
src/librssguard/gui/toolbareditor.ui → src/librssguard/gui/toolbars/toolbareditor.ui
Normal file → Executable file
0
src/librssguard/gui/toolbareditor.ui → src/librssguard/gui/toolbars/toolbareditor.ui
Normal file → Executable file
|
@ -61,7 +61,7 @@ HEADERS += core/feeddownloader.h \
|
||||||
exceptions/networkexception.h \
|
exceptions/networkexception.h \
|
||||||
exceptions/scriptexception.h \
|
exceptions/scriptexception.h \
|
||||||
gui/baselineedit.h \
|
gui/baselineedit.h \
|
||||||
gui/basetoolbar.h \
|
gui/toolbars/basetoolbar.h \
|
||||||
gui/colortoolbutton.h \
|
gui/colortoolbutton.h \
|
||||||
gui/comboboxwithstatus.h \
|
gui/comboboxwithstatus.h \
|
||||||
gui/dialogs/formabout.h \
|
gui/dialogs/formabout.h \
|
||||||
|
@ -76,7 +76,7 @@ HEADERS += core/feeddownloader.h \
|
||||||
gui/dialogs/formupdate.h \
|
gui/dialogs/formupdate.h \
|
||||||
gui/edittableview.h \
|
gui/edittableview.h \
|
||||||
gui/feedmessageviewer.h \
|
gui/feedmessageviewer.h \
|
||||||
gui/feedstoolbar.h \
|
gui/toolbars/feedstoolbar.h \
|
||||||
gui/feedsview.h \
|
gui/feedsview.h \
|
||||||
gui/guiutilities.h \
|
gui/guiutilities.h \
|
||||||
gui/labelsmenu.h \
|
gui/labelsmenu.h \
|
||||||
|
@ -85,7 +85,7 @@ HEADERS += core/feeddownloader.h \
|
||||||
gui/messagebox.h \
|
gui/messagebox.h \
|
||||||
gui/messagecountspinbox.h \
|
gui/messagecountspinbox.h \
|
||||||
gui/messagepreviewer.h \
|
gui/messagepreviewer.h \
|
||||||
gui/messagestoolbar.h \
|
gui/toolbars/messagestoolbar.h \
|
||||||
gui/messagesview.h \
|
gui/messagesview.h \
|
||||||
gui/networkproxydetails.h \
|
gui/networkproxydetails.h \
|
||||||
gui/newspaperpreviewer.h \
|
gui/newspaperpreviewer.h \
|
||||||
|
@ -102,14 +102,14 @@ HEADERS += core/feeddownloader.h \
|
||||||
gui/settings/settingspanel.h \
|
gui/settings/settingspanel.h \
|
||||||
gui/settings/settingsshortcuts.h \
|
gui/settings/settingsshortcuts.h \
|
||||||
gui/squeezelabel.h \
|
gui/squeezelabel.h \
|
||||||
gui/statusbar.h \
|
gui/toolbars/statusbar.h \
|
||||||
gui/styleditemdelegatewithoutfocus.h \
|
gui/styleditemdelegatewithoutfocus.h \
|
||||||
gui/systemtrayicon.h \
|
gui/systemtrayicon.h \
|
||||||
gui/tabbar.h \
|
gui/tabbar.h \
|
||||||
gui/tabcontent.h \
|
gui/tabcontent.h \
|
||||||
gui/tabwidget.h \
|
gui/tabwidget.h \
|
||||||
gui/timespinbox.h \
|
gui/timespinbox.h \
|
||||||
gui/toolbareditor.h \
|
gui/toolbars/toolbareditor.h \
|
||||||
gui/treeviewcolumnsmenu.h \
|
gui/treeviewcolumnsmenu.h \
|
||||||
gui/widgetwithstatus.h \
|
gui/widgetwithstatus.h \
|
||||||
miscellaneous/application.h \
|
miscellaneous/application.h \
|
||||||
|
@ -239,7 +239,7 @@ SOURCES += core/feeddownloader.cpp \
|
||||||
exceptions/networkexception.cpp \
|
exceptions/networkexception.cpp \
|
||||||
exceptions/scriptexception.cpp \
|
exceptions/scriptexception.cpp \
|
||||||
gui/baselineedit.cpp \
|
gui/baselineedit.cpp \
|
||||||
gui/basetoolbar.cpp \
|
gui/toolbars/basetoolbar.cpp \
|
||||||
gui/colortoolbutton.cpp \
|
gui/colortoolbutton.cpp \
|
||||||
gui/comboboxwithstatus.cpp \
|
gui/comboboxwithstatus.cpp \
|
||||||
gui/dialogs/formabout.cpp \
|
gui/dialogs/formabout.cpp \
|
||||||
|
@ -254,7 +254,7 @@ SOURCES += core/feeddownloader.cpp \
|
||||||
gui/dialogs/formupdate.cpp \
|
gui/dialogs/formupdate.cpp \
|
||||||
gui/edittableview.cpp \
|
gui/edittableview.cpp \
|
||||||
gui/feedmessageviewer.cpp \
|
gui/feedmessageviewer.cpp \
|
||||||
gui/feedstoolbar.cpp \
|
gui/toolbars/feedstoolbar.cpp \
|
||||||
gui/feedsview.cpp \
|
gui/feedsview.cpp \
|
||||||
gui/guiutilities.cpp \
|
gui/guiutilities.cpp \
|
||||||
gui/labelsmenu.cpp \
|
gui/labelsmenu.cpp \
|
||||||
|
@ -263,7 +263,7 @@ SOURCES += core/feeddownloader.cpp \
|
||||||
gui/messagebox.cpp \
|
gui/messagebox.cpp \
|
||||||
gui/messagecountspinbox.cpp \
|
gui/messagecountspinbox.cpp \
|
||||||
gui/messagepreviewer.cpp \
|
gui/messagepreviewer.cpp \
|
||||||
gui/messagestoolbar.cpp \
|
gui/toolbars/messagestoolbar.cpp \
|
||||||
gui/messagesview.cpp \
|
gui/messagesview.cpp \
|
||||||
gui/networkproxydetails.cpp \
|
gui/networkproxydetails.cpp \
|
||||||
gui/newspaperpreviewer.cpp \
|
gui/newspaperpreviewer.cpp \
|
||||||
|
@ -280,14 +280,14 @@ SOURCES += core/feeddownloader.cpp \
|
||||||
gui/settings/settingspanel.cpp \
|
gui/settings/settingspanel.cpp \
|
||||||
gui/settings/settingsshortcuts.cpp \
|
gui/settings/settingsshortcuts.cpp \
|
||||||
gui/squeezelabel.cpp \
|
gui/squeezelabel.cpp \
|
||||||
gui/statusbar.cpp \
|
gui/toolbars/statusbar.cpp \
|
||||||
gui/styleditemdelegatewithoutfocus.cpp \
|
gui/styleditemdelegatewithoutfocus.cpp \
|
||||||
gui/systemtrayicon.cpp \
|
gui/systemtrayicon.cpp \
|
||||||
gui/tabbar.cpp \
|
gui/tabbar.cpp \
|
||||||
gui/tabcontent.cpp \
|
gui/tabcontent.cpp \
|
||||||
gui/tabwidget.cpp \
|
gui/tabwidget.cpp \
|
||||||
gui/timespinbox.cpp \
|
gui/timespinbox.cpp \
|
||||||
gui/toolbareditor.cpp \
|
gui/toolbars/toolbareditor.cpp \
|
||||||
gui/treeviewcolumnsmenu.cpp \
|
gui/treeviewcolumnsmenu.cpp \
|
||||||
gui/widgetwithstatus.cpp \
|
gui/widgetwithstatus.cpp \
|
||||||
miscellaneous/application.cpp \
|
miscellaneous/application.cpp \
|
||||||
|
@ -405,7 +405,7 @@ FORMS += gui/dialogs/formabout.ui \
|
||||||
gui/settings/settingsgui.ui \
|
gui/settings/settingsgui.ui \
|
||||||
gui/settings/settingslocalization.ui \
|
gui/settings/settingslocalization.ui \
|
||||||
gui/settings/settingsshortcuts.ui \
|
gui/settings/settingsshortcuts.ui \
|
||||||
gui/toolbareditor.ui \
|
gui/toolbars/toolbareditor.ui \
|
||||||
network-web/downloaditem.ui \
|
network-web/downloaditem.ui \
|
||||||
network-web/downloadmanager.ui \
|
network-web/downloadmanager.ui \
|
||||||
services/abstract/gui/authenticationdetails.ui \
|
services/abstract/gui/authenticationdetails.ui \
|
||||||
|
@ -502,6 +502,7 @@ HEADERS += $$files(3rd-party/sc/*.h, false)
|
||||||
INCLUDEPATH += $$PWD/. \
|
INCLUDEPATH += $$PWD/. \
|
||||||
$$PWD/gui \
|
$$PWD/gui \
|
||||||
$$PWD/gui/dialogs \
|
$$PWD/gui/dialogs \
|
||||||
|
$$PWD/gui/toolbars \
|
||||||
$$PWD/dynamic-shortcuts
|
$$PWD/dynamic-shortcuts
|
||||||
|
|
||||||
TRANSLATIONS += $$files($$PWD/../../localization/rssguard_*.ts, false) \
|
TRANSLATIONS += $$files($$PWD/../../localization/rssguard_*.ts, false) \
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include "gui/feedmessageviewer.h"
|
#include "gui/feedmessageviewer.h"
|
||||||
#include "gui/feedsview.h"
|
#include "gui/feedsview.h"
|
||||||
#include "gui/messagebox.h"
|
#include "gui/messagebox.h"
|
||||||
#include "gui/statusbar.h"
|
#include "gui/toolbars/statusbar.h"
|
||||||
#include "miscellaneous/feedreader.h"
|
#include "miscellaneous/feedreader.h"
|
||||||
#include "miscellaneous/iconfactory.h"
|
#include "miscellaneous/iconfactory.h"
|
||||||
#include "miscellaneous/iofactory.h"
|
#include "miscellaneous/iofactory.h"
|
||||||
|
|
|
@ -133,7 +133,7 @@ DKEY GUI::HeightRowFeeds = "height_row_feeds";
|
||||||
DVALUE(int) GUI::HeightRowFeedsDef = -1;
|
DVALUE(int) GUI::HeightRowFeedsDef = -1;
|
||||||
|
|
||||||
DKEY GUI::FeedsToolbarActions = "feeds_toolbar";
|
DKEY GUI::FeedsToolbarActions = "feeds_toolbar";
|
||||||
DVALUE(char*) GUI::FeedsToolbarActionsDef = "m_actionUpdateAllItems,m_actionStopRunningItemsUpdate,m_actionMarkAllItemsRead";
|
DVALUE(char*) GUI::FeedsToolbarActionsDef = "m_actionUpdateAllItems,m_actionStopRunningItemsUpdate,m_actionMarkAllItemsRead,spacer,search";
|
||||||
|
|
||||||
DKEY GUI::StatusbarActions = "status_bar";
|
DKEY GUI::StatusbarActions = "status_bar";
|
||||||
DVALUE(char*) GUI::StatusbarActionsDef =
|
DVALUE(char*) GUI::StatusbarActionsDef =
|
||||||
|
|
Loading…
Add table
Reference in a new issue