add all dropdown filters to keyboard shortcuts subsystem
This commit is contained in:
parent
f81f06ca3d
commit
4e9dc137f1
9 changed files with 99 additions and 36 deletions
|
@ -11,7 +11,9 @@ void DynamicShortcuts::save(const QList<QAction*>& actions) {
|
||||||
Settings* settings = qApp->settings();
|
Settings* settings = qApp->settings();
|
||||||
|
|
||||||
for (const QAction* action : actions) {
|
for (const QAction* action : actions) {
|
||||||
settings->setValue(GROUP(Keyboard), action->objectName(), action->shortcut().toString(QKeySequence::PortableText));
|
settings->setValue(GROUP(Keyboard),
|
||||||
|
action->objectName(),
|
||||||
|
action->shortcut().toString(QKeySequence::SequenceFormat::PortableText));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,10 +21,12 @@ void DynamicShortcuts::load(const QList<QAction*>& actions) {
|
||||||
Settings* settings = qApp->settings();
|
Settings* settings = qApp->settings();
|
||||||
|
|
||||||
for (QAction* action : actions) {
|
for (QAction* action : actions) {
|
||||||
QString shortcut_for_action =
|
QString shortcut_for_action = settings
|
||||||
settings->value(GROUP(Keyboard), action->objectName(), action->shortcut().toString(QKeySequence::PortableText))
|
->value(GROUP(Keyboard),
|
||||||
|
action->objectName(),
|
||||||
|
action->shortcut().toString(QKeySequence::SequenceFormat::PortableText))
|
||||||
.toString();
|
.toString();
|
||||||
|
|
||||||
action->setShortcut(QKeySequence::fromString(shortcut_for_action, QKeySequence::PortableText));
|
action->setShortcut(QKeySequence::fromString(shortcut_for_action, QKeySequence::SequenceFormat::PortableText));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,11 +73,12 @@ void DynamicShortcutsWidget::populate(QList<QAction*> actions) {
|
||||||
auto act_text = action->text().remove(QSL("&"));
|
auto act_text = action->text().remove(QSL("&"));
|
||||||
auto act_toolt = action->toolTip();
|
auto act_toolt = action->toolTip();
|
||||||
|
|
||||||
if (act_text == act_toolt) {
|
if (act_toolt.isEmpty() || act_text == act_toolt) {
|
||||||
action_label->setText(act_text);
|
action_label->setText(act_text);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
action_label->setText(QSL("%1 (%2)").arg(act_text, act_toolt));
|
action_label->setText(act_toolt);
|
||||||
|
// action_label->setText(QSL("%1 (%2)").arg(act_text, act_toolt));
|
||||||
}
|
}
|
||||||
|
|
||||||
action_label->setToolTip(action->toolTip());
|
action_label->setToolTip(action->toolTip());
|
||||||
|
|
|
@ -94,11 +94,12 @@ FormMain::FormMain(QWidget* parent, Qt::WindowFlags f)
|
||||||
m_ui->m_menuWebBrowserTabs->addAction(qApp->web()->engineSettingsAction());
|
m_ui->m_menuWebBrowserTabs->addAction(qApp->web()->engineSettingsAction());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
setStatusBar(m_statusBar = new StatusBar(this));
|
||||||
|
|
||||||
// Add these actions to the list of actions of the main window.
|
// Add these actions to the list of actions of the main window.
|
||||||
// This allows to use actions via shortcuts
|
// This allows to use actions via shortcuts
|
||||||
// even if main menu is not visible.
|
// even if main menu is not visible.
|
||||||
addActions(qApp->userActions());
|
addActions(qApp->userActions());
|
||||||
setStatusBar(m_statusBar = new StatusBar(this));
|
|
||||||
|
|
||||||
// Prepare main window and tabs.
|
// Prepare main window and tabs.
|
||||||
prepareMenus();
|
prepareMenus();
|
||||||
|
@ -243,6 +244,10 @@ QList<QAction*> FormMain::allActions() const {
|
||||||
actions << m_ui->m_actionBrowserScrollDown;
|
actions << m_ui->m_actionBrowserScrollDown;
|
||||||
actions << m_actionToolbarMainMenu;
|
actions << m_actionToolbarMainMenu;
|
||||||
|
|
||||||
|
actions << m_ui->m_tabWidget->feedMessageViewer()->feedsToolBar()->extraActions();
|
||||||
|
actions << m_ui->m_tabWidget->feedMessageViewer()->messagesToolBar()->extraActions();
|
||||||
|
actions << m_statusBar->extraActions();
|
||||||
|
|
||||||
return actions;
|
return actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,10 @@ BaseToolBar::~BaseToolBar() {
|
||||||
qDebugNN << LOGSEC_GUI << "Destroying BaseToolBar instance.";
|
qDebugNN << LOGSEC_GUI << "Destroying BaseToolBar instance.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<QAction*> BaseBar::extraActions() const {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
void BaseBar::loadSavedActions() {
|
void BaseBar::loadSavedActions() {
|
||||||
loadSpecificActions(convertActions(savedActions()), true);
|
loadSpecificActions(convertActions(savedActions()), true);
|
||||||
}
|
}
|
||||||
|
@ -39,13 +43,15 @@ QAction* BaseBar::findMatchingAction(const QString& action, const QList<QAction*
|
||||||
void BaseToolBar::addActionToMenu(QMenu* menu,
|
void BaseToolBar::addActionToMenu(QMenu* menu,
|
||||||
const QIcon& icon,
|
const QIcon& icon,
|
||||||
const QString& title,
|
const QString& title,
|
||||||
|
const QString& tooltip_suffix,
|
||||||
const QVariant& value,
|
const QVariant& value,
|
||||||
const QString& name) {
|
const QString& object_name) {
|
||||||
QAction* action = menu->addAction(icon, title);
|
QAction* action = menu->addAction(icon, title);
|
||||||
|
|
||||||
|
action->setToolTip(title + tooltip_suffix);
|
||||||
action->setCheckable(true);
|
action->setCheckable(true);
|
||||||
action->setData(value);
|
action->setData(value);
|
||||||
action->setObjectName(name);
|
action->setObjectName(object_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseToolBar::activateAction(const QString& action_name, QWidgetAction* widget_action) {
|
void BaseToolBar::activateAction(const QString& action_name, QWidgetAction* widget_action) {
|
||||||
|
|
|
@ -30,6 +30,11 @@ class BaseBar {
|
||||||
// Loads the toolbar state from settings.
|
// Loads the toolbar state from settings.
|
||||||
virtual void loadSavedActions();
|
virtual void loadSavedActions();
|
||||||
|
|
||||||
|
// Returns list of actions which are created solely by this toolbar.
|
||||||
|
// NOTE: These actions are added to global list of actions which can be
|
||||||
|
// bound to keyboard shortcuts.
|
||||||
|
virtual QList<QAction*> extraActions() const;
|
||||||
|
|
||||||
// Converts action names to actions.
|
// Converts action names to actions.
|
||||||
virtual QList<QAction*> convertActions(const QStringList& actions) = 0;
|
virtual QList<QAction*> convertActions(const QStringList& actions) = 0;
|
||||||
|
|
||||||
|
@ -60,8 +65,9 @@ class BaseToolBar : public QToolBar, public BaseBar {
|
||||||
void addActionToMenu(QMenu* menu,
|
void addActionToMenu(QMenu* menu,
|
||||||
const QIcon& icon,
|
const QIcon& icon,
|
||||||
const QString& title,
|
const QString& title,
|
||||||
|
const QString& tooltip_suffix,
|
||||||
const QVariant& value,
|
const QVariant& value,
|
||||||
const QString& name);
|
const QString& object_name);
|
||||||
void drawNumberOfCriterias(QToolButton* btn, int count);
|
void drawNumberOfCriterias(QToolButton* btn, int count);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -172,6 +172,10 @@ QStringList FeedsToolBar::savedActions() const {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<QAction*> FeedsToolBar::extraActions() const {
|
||||||
|
return m_menuMessageFilter->actions();
|
||||||
|
}
|
||||||
|
|
||||||
void FeedsToolBar::initializeSearchBox() {
|
void FeedsToolBar::initializeSearchBox() {
|
||||||
m_txtSearchMessages =
|
m_txtSearchMessages =
|
||||||
new SearchLineEdit(QSL("feed_list_searcher"),
|
new SearchLineEdit(QSL("feed_list_searcher"),
|
||||||
|
@ -200,46 +204,56 @@ SearchLineEdit* FeedsToolBar::searchBox() const {
|
||||||
void FeedsToolBar::initializeFilter() {
|
void FeedsToolBar::initializeFilter() {
|
||||||
m_menuMessageFilter = new NonClosableMenu(tr("Menu for filtering feeds"), this);
|
m_menuMessageFilter = new NonClosableMenu(tr("Menu for filtering feeds"), this);
|
||||||
|
|
||||||
|
QString fl = QSL(" ") + tr("(feed list)");
|
||||||
|
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("No extra filtering"),
|
tr("No extra filtering"),
|
||||||
|
fl,
|
||||||
QVariant::fromValue(FeedsProxyModel::FeedListFilter::NoFiltering),
|
QVariant::fromValue(FeedsProxyModel::FeedListFilter::NoFiltering),
|
||||||
QSL("no_filtering"));
|
QSL("feedlist_no_filtering"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("Show unread feeds"),
|
tr("Show unread items"),
|
||||||
|
fl,
|
||||||
QVariant::fromValue(FeedsProxyModel::FeedListFilter::ShowUnread),
|
QVariant::fromValue(FeedsProxyModel::FeedListFilter::ShowUnread),
|
||||||
QSL("show_unread"));
|
QSL("feedlist_show_unread"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("Show non-empty feeds"),
|
tr("Show non-empty items"),
|
||||||
|
fl,
|
||||||
QVariant::fromValue(FeedsProxyModel::FeedListFilter::ShowNonEmpty),
|
QVariant::fromValue(FeedsProxyModel::FeedListFilter::ShowNonEmpty),
|
||||||
QSL("non_empty"));
|
QSL("feedlist_non_empty"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("Show feeds with new articles"),
|
tr("Show feeds with new articles"),
|
||||||
|
fl,
|
||||||
QVariant::fromValue(FeedsProxyModel::FeedListFilter::ShowWithNewArticles),
|
QVariant::fromValue(FeedsProxyModel::FeedListFilter::ShowWithNewArticles),
|
||||||
QSL("new_articles"));
|
QSL("feedlist_new_articles"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("Show feeds with error"),
|
tr("Show feeds with error"),
|
||||||
|
fl,
|
||||||
QVariant::fromValue(FeedsProxyModel::FeedListFilter::ShowWithError),
|
QVariant::fromValue(FeedsProxyModel::FeedListFilter::ShowWithError),
|
||||||
QSL("with_error"));
|
QSL("feedlist_with_error"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("Show switched off feeds"),
|
tr("Show switched off feeds"),
|
||||||
|
fl,
|
||||||
QVariant::fromValue(FeedsProxyModel::FeedListFilter::ShowSwitchedOff),
|
QVariant::fromValue(FeedsProxyModel::FeedListFilter::ShowSwitchedOff),
|
||||||
QSL("switched_off"));
|
QSL("feedlist_switched_off"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("Show quiet feeds"),
|
tr("Show quiet feeds"),
|
||||||
|
fl,
|
||||||
QVariant::fromValue(FeedsProxyModel::FeedListFilter::ShowQuiet),
|
QVariant::fromValue(FeedsProxyModel::FeedListFilter::ShowQuiet),
|
||||||
QSL("quiet"));
|
QSL("feedlist_quiet"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("Show feeds with article filters"),
|
tr("Show feeds with article filters"),
|
||||||
|
fl,
|
||||||
QVariant::fromValue(FeedsProxyModel::FeedListFilter::ShowWithArticleFilters),
|
QVariant::fromValue(FeedsProxyModel::FeedListFilter::ShowWithArticleFilters),
|
||||||
QSL("with_filters"));
|
QSL("feedlist_with_filters"));
|
||||||
|
|
||||||
m_btnMessageFilter = new QToolButton(this);
|
m_btnMessageFilter = new QToolButton(this);
|
||||||
m_btnMessageFilter->setToolTip(tr("Display all feeds"));
|
m_btnMessageFilter->setToolTip(tr("Display all feeds"));
|
||||||
|
|
|
@ -22,6 +22,7 @@ class FeedsToolBar : public BaseToolBar {
|
||||||
virtual void loadSpecificActions(const QList<QAction*>& actions, bool initial_load = false);
|
virtual void loadSpecificActions(const QList<QAction*>& actions, bool initial_load = false);
|
||||||
virtual QStringList defaultActions() const;
|
virtual QStringList defaultActions() const;
|
||||||
virtual QStringList savedActions() const;
|
virtual QStringList savedActions() const;
|
||||||
|
virtual QList<QAction*> extraActions() const;
|
||||||
|
|
||||||
SearchLineEdit* searchBox() const;
|
SearchLineEdit* searchBox() const;
|
||||||
|
|
||||||
|
|
|
@ -224,84 +224,101 @@ void MessagesToolBar::initializeSearchBox() {
|
||||||
void MessagesToolBar::initializeHighlighter() {
|
void MessagesToolBar::initializeHighlighter() {
|
||||||
m_menuMessageHighlighter = new NonClosableMenu(tr("Menu for highlighting articles"), this);
|
m_menuMessageHighlighter = new NonClosableMenu(tr("Menu for highlighting articles"), this);
|
||||||
|
|
||||||
|
QString al = QSL(" ") + tr("(article list)");
|
||||||
|
|
||||||
addActionToMenu(m_menuMessageHighlighter,
|
addActionToMenu(m_menuMessageHighlighter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("No extra highlighting"),
|
tr("No extra highlighting"),
|
||||||
|
al,
|
||||||
QVariant::fromValue(MessagesModel::MessageHighlighter::NoHighlighting),
|
QVariant::fromValue(MessagesModel::MessageHighlighter::NoHighlighting),
|
||||||
QSL("no_highlighting"));
|
QSL("articlelist_no_highlighting"));
|
||||||
addActionToMenu(m_menuMessageHighlighter,
|
addActionToMenu(m_menuMessageHighlighter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-unread")),
|
qApp->icons()->fromTheme(QSL("mail-mark-unread")),
|
||||||
tr("Highlight unread articles"),
|
tr("Highlight unread articles"),
|
||||||
|
al,
|
||||||
QVariant::fromValue(MessagesModel::MessageHighlighter::HighlightUnread),
|
QVariant::fromValue(MessagesModel::MessageHighlighter::HighlightUnread),
|
||||||
QSL("highlight_unread"));
|
QSL("articlelist_highlight_unread"));
|
||||||
addActionToMenu(m_menuMessageHighlighter,
|
addActionToMenu(m_menuMessageHighlighter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-important")),
|
qApp->icons()->fromTheme(QSL("mail-mark-important")),
|
||||||
tr("Highlight important articles"),
|
tr("Highlight important articles"),
|
||||||
|
al,
|
||||||
QVariant::fromValue(MessagesModel::MessageHighlighter::HighlightImportant),
|
QVariant::fromValue(MessagesModel::MessageHighlighter::HighlightImportant),
|
||||||
QSL("highlight_important"));
|
QSL("articlelist_highlight_important"));
|
||||||
|
|
||||||
m_menuMessageFilter = new NonClosableMenu(tr("Menu for filtering articles"), this);
|
m_menuMessageFilter = new NonClosableMenu(tr("Menu for filtering articles"), this);
|
||||||
|
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("No extra filtering"),
|
tr("No extra filtering"),
|
||||||
|
al,
|
||||||
QVariant::fromValue(MessagesProxyModel::MessageListFilter::NoFiltering),
|
QVariant::fromValue(MessagesProxyModel::MessageListFilter::NoFiltering),
|
||||||
QSL("no_filtering"));
|
QSL("articlelist_no_filtering"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-unread")),
|
qApp->icons()->fromTheme(QSL("mail-mark-unread")),
|
||||||
tr("Show unread articles"),
|
tr("Show unread articles"),
|
||||||
|
al,
|
||||||
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowUnread),
|
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowUnread),
|
||||||
QSL("show_unread"));
|
QSL("articlelist_show_unread"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("Show read articles"),
|
tr("Show read articles"),
|
||||||
|
al,
|
||||||
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowRead),
|
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowRead),
|
||||||
QSL("show_read"));
|
QSL("articlelist_show_read"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-important")),
|
qApp->icons()->fromTheme(QSL("mail-mark-important")),
|
||||||
tr("Show important articles"),
|
tr("Show important articles"),
|
||||||
|
al,
|
||||||
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowImportant),
|
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowImportant),
|
||||||
QSL("show_important"));
|
QSL("articlelist_show_important"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("Show today's articles"),
|
tr("Show today's articles"),
|
||||||
|
al,
|
||||||
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowToday),
|
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowToday),
|
||||||
QSL("show_today"));
|
QSL("articlelist_show_today"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("Show yesterday's articles"),
|
tr("Show yesterday's articles"),
|
||||||
|
al,
|
||||||
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowYesterday),
|
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowYesterday),
|
||||||
QSL("show_yesterday"));
|
QSL("articlelist_show_yesterday"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("Show articles in last 24 hours"),
|
tr("Show articles in last 24 hours"),
|
||||||
|
al,
|
||||||
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowLast24Hours),
|
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowLast24Hours),
|
||||||
QSL("show_last24hours"));
|
QSL("articlelist_show_last24hours"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("Show articles in last 48 hours"),
|
tr("Show articles in last 48 hours"),
|
||||||
|
al,
|
||||||
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowLast48Hours),
|
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowLast48Hours),
|
||||||
QSL("show_last48hours"));
|
QSL("articlelist_show_last48hours"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("Show this week's articles"),
|
tr("Show this week's articles"),
|
||||||
|
al,
|
||||||
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowThisWeek),
|
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowThisWeek),
|
||||||
QSL("show_this_week"));
|
QSL("articlelist_show_this_week"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
qApp->icons()->fromTheme(QSL("mail-mark-read")),
|
||||||
tr("Show last week's articles"),
|
tr("Show last week's articles"),
|
||||||
|
al,
|
||||||
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowLastWeek),
|
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowLastWeek),
|
||||||
QSL("show_last_week"));
|
QSL("articlelist_show_last_week"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
qApp->icons()->fromTheme(QSL("mail-attachment")),
|
qApp->icons()->fromTheme(QSL("mail-attachment")),
|
||||||
tr("Show articles with attachments"),
|
tr("Show articles with attachments"),
|
||||||
|
al,
|
||||||
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowOnlyWithAttachments),
|
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowOnlyWithAttachments),
|
||||||
QSL("show_with_attachments"));
|
QSL("articlelist_show_with_attachments"));
|
||||||
addActionToMenu(m_menuMessageFilter,
|
addActionToMenu(m_menuMessageFilter,
|
||||||
MessagesModel::generateIconForScore(MSG_SCORE_MAX / 2.0),
|
MessagesModel::generateIconForScore(MSG_SCORE_MAX / 2.0),
|
||||||
tr("Show articles with some score"),
|
tr("Show articles with some score"),
|
||||||
|
al,
|
||||||
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowOnlyWithScore),
|
QVariant::fromValue(MessagesProxyModel::MessageListFilter::ShowOnlyWithScore),
|
||||||
QSL("show_with_score"));
|
QSL("articlelist_show_with_score"));
|
||||||
|
|
||||||
m_btnMessageHighlighter = new QToolButton(this);
|
m_btnMessageHighlighter = new QToolButton(this);
|
||||||
m_btnMessageHighlighter->setToolTip(tr("Display all articles"));
|
m_btnMessageHighlighter->setToolTip(tr("Display all articles"));
|
||||||
|
@ -362,3 +379,11 @@ QStringList MessagesToolBar::savedActions() const {
|
||||||
QString::SplitBehavior::SkipEmptyParts);
|
QString::SplitBehavior::SkipEmptyParts);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<QAction*> MessagesToolBar::extraActions() const {
|
||||||
|
QList<QAction*> act;
|
||||||
|
|
||||||
|
act << m_menuMessageHighlighter->actions() << m_menuMessageFilter->actions();
|
||||||
|
|
||||||
|
return act;
|
||||||
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ class MessagesToolBar : public BaseToolBar {
|
||||||
virtual QList<QAction*> convertActions(const QStringList& actions);
|
virtual QList<QAction*> convertActions(const QStringList& actions);
|
||||||
virtual QStringList defaultActions() const;
|
virtual QStringList defaultActions() const;
|
||||||
virtual QStringList savedActions() const;
|
virtual QStringList savedActions() const;
|
||||||
|
virtual QList<QAction*> extraActions() const;
|
||||||
|
|
||||||
SearchLineEdit* searchBox() const;
|
SearchLineEdit* searchBox() const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue