Fixed #291.
This commit is contained in:
parent
b42f328e14
commit
910bfd0ecb
7 changed files with 32 additions and 0 deletions
|
@ -159,6 +159,7 @@ QList<QAction*> FormMain::allActions() const {
|
||||||
actions << m_ui->m_actionClearAllItems;
|
actions << m_ui->m_actionClearAllItems;
|
||||||
actions << m_ui->m_actionShowOnlyUnreadItems;
|
actions << m_ui->m_actionShowOnlyUnreadItems;
|
||||||
actions << m_ui->m_actionShowTreeBranches;
|
actions << m_ui->m_actionShowTreeBranches;
|
||||||
|
actions << m_ui->m_actionAutoExpandItemsWhenSelected;
|
||||||
actions << m_ui->m_actionShowOnlyUnreadMessages;
|
actions << m_ui->m_actionShowOnlyUnreadMessages;
|
||||||
actions << m_ui->m_actionMarkSelectedMessagesAsRead;
|
actions << m_ui->m_actionMarkSelectedMessagesAsRead;
|
||||||
actions << m_ui->m_actionMarkSelectedMessagesAsUnread;
|
actions << m_ui->m_actionMarkSelectedMessagesAsUnread;
|
||||||
|
@ -596,6 +597,8 @@ void FormMain::loadSize() {
|
||||||
SETTING(Feeds::ShowOnlyUnreadFeeds)).toBool());
|
SETTING(Feeds::ShowOnlyUnreadFeeds)).toBool());
|
||||||
m_ui->m_actionShowTreeBranches->setChecked(settings->value(GROUP(Feeds),
|
m_ui->m_actionShowTreeBranches->setChecked(settings->value(GROUP(Feeds),
|
||||||
SETTING(Feeds::ShowTreeBranches)).toBool());
|
SETTING(Feeds::ShowTreeBranches)).toBool());
|
||||||
|
m_ui->m_actionAutoExpandItemsWhenSelected->setChecked(settings->value(GROUP(Feeds),
|
||||||
|
SETTING(Feeds::AutoExpandOnSelection)).toBool());
|
||||||
m_ui->m_actionShowOnlyUnreadMessages->setChecked(settings->value(GROUP(Messages),
|
m_ui->m_actionShowOnlyUnreadMessages->setChecked(settings->value(GROUP(Messages),
|
||||||
SETTING(Messages::ShowOnlyUnreadMessages)).toBool());
|
SETTING(Messages::ShowOnlyUnreadMessages)).toBool());
|
||||||
m_ui->m_actionAlternateColorsInLists->setChecked(settings->value(GROUP(GUI),
|
m_ui->m_actionAlternateColorsInLists->setChecked(settings->value(GROUP(GUI),
|
||||||
|
@ -763,6 +766,8 @@ void FormMain::createConnections() {
|
||||||
tabWidget()->feedMessageViewer(), &FeedMessageViewer::toggleShowOnlyUnreadFeeds);
|
tabWidget()->feedMessageViewer(), &FeedMessageViewer::toggleShowOnlyUnreadFeeds);
|
||||||
connect(m_ui->m_actionShowTreeBranches, &QAction::toggled,
|
connect(m_ui->m_actionShowTreeBranches, &QAction::toggled,
|
||||||
tabWidget()->feedMessageViewer(), &FeedMessageViewer::toggleShowFeedTreeBranches);
|
tabWidget()->feedMessageViewer(), &FeedMessageViewer::toggleShowFeedTreeBranches);
|
||||||
|
connect(m_ui->m_actionAutoExpandItemsWhenSelected, &QAction::toggled,
|
||||||
|
tabWidget()->feedMessageViewer(), &FeedMessageViewer::toggleItemsAutoExpandingOnSelection);
|
||||||
connect(m_ui->m_actionAlternateColorsInLists, &QAction::toggled,
|
connect(m_ui->m_actionAlternateColorsInLists, &QAction::toggled,
|
||||||
tabWidget()->feedMessageViewer(), &FeedMessageViewer::alternateRowColorsInLists);
|
tabWidget()->feedMessageViewer(), &FeedMessageViewer::alternateRowColorsInLists);
|
||||||
connect(m_ui->m_actionShowOnlyUnreadMessages, &QAction::toggled,
|
connect(m_ui->m_actionShowOnlyUnreadMessages, &QAction::toggled,
|
||||||
|
|
|
@ -116,6 +116,7 @@
|
||||||
<addaction name="m_actionDeleteSelectedItem"/>
|
<addaction name="m_actionDeleteSelectedItem"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="m_actionShowOnlyUnreadItems"/>
|
<addaction name="m_actionShowOnlyUnreadItems"/>
|
||||||
|
<addaction name="m_actionAutoExpandItemsWhenSelected"/>
|
||||||
<addaction name="m_actionShowTreeBranches"/>
|
<addaction name="m_actionShowTreeBranches"/>
|
||||||
<addaction name="m_actionExpandCollapseItem"/>
|
<addaction name="m_actionExpandCollapseItem"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
|
@ -784,6 +785,14 @@
|
||||||
<string>Alternate row colors in lists</string>
|
<string>Alternate row colors in lists</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="m_actionAutoExpandItemsWhenSelected">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Automatically &expand items when selected</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
|
|
@ -188,6 +188,12 @@ void FeedMessageViewer::toggleShowFeedTreeBranches() {
|
||||||
qApp->settings()->setValue(GROUP(Feeds), Feeds::ShowTreeBranches, origin->isChecked());
|
qApp->settings()->setValue(GROUP(Feeds), Feeds::ShowTreeBranches, origin->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FeedMessageViewer::toggleItemsAutoExpandingOnSelection() {
|
||||||
|
const QAction* origin = qobject_cast<QAction*>(sender());
|
||||||
|
|
||||||
|
qApp->settings()->setValue(GROUP(Feeds), Feeds::AutoExpandOnSelection, origin->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
void FeedMessageViewer::alternateRowColorsInLists() {
|
void FeedMessageViewer::alternateRowColorsInLists() {
|
||||||
const QAction* origin = qobject_cast<QAction*>(sender());
|
const QAction* origin = qobject_cast<QAction*>(sender());
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,7 @@ class RSSGUARD_DLLSPEC FeedMessageViewer : public TabContent {
|
||||||
void toggleShowOnlyUnreadMessages();
|
void toggleShowOnlyUnreadMessages();
|
||||||
void toggleShowOnlyUnreadFeeds();
|
void toggleShowOnlyUnreadFeeds();
|
||||||
void toggleShowFeedTreeBranches();
|
void toggleShowFeedTreeBranches();
|
||||||
|
void toggleItemsAutoExpandingOnSelection();
|
||||||
void alternateRowColorsInLists();
|
void alternateRowColorsInLists();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
|
@ -713,6 +713,11 @@ void FeedsView::selectionChanged(const QItemSelection& selected, const QItemSele
|
||||||
emit itemSelected(selected_item);
|
emit itemSelected(selected_item);
|
||||||
|
|
||||||
m_proxyModel->invalidateReadFeedsFilter();
|
m_proxyModel->invalidateReadFeedsFilter();
|
||||||
|
|
||||||
|
if (!selectedIndexes().isEmpty() &&
|
||||||
|
qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::AutoExpandOnSelection)).toBool()) {
|
||||||
|
expand(selectedIndexes().first());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsView::keyPressEvent(QKeyEvent* event) {
|
void FeedsView::keyPressEvent(QKeyEvent* event) {
|
||||||
|
|
|
@ -60,6 +60,9 @@ DVALUE(bool) Feeds::ShowOnlyUnreadFeedsDef = false;
|
||||||
DKEY Feeds::ShowTreeBranches = "show_tree_branches";
|
DKEY Feeds::ShowTreeBranches = "show_tree_branches";
|
||||||
DVALUE(bool) Feeds::ShowTreeBranchesDef = true;
|
DVALUE(bool) Feeds::ShowTreeBranchesDef = true;
|
||||||
|
|
||||||
|
DKEY Feeds::AutoExpandOnSelection = "auto_expand_on_selection";
|
||||||
|
DVALUE(bool) Feeds::AutoExpandOnSelectionDef = false;
|
||||||
|
|
||||||
DKEY Feeds::ListFont = "list_font";
|
DKEY Feeds::ListFont = "list_font";
|
||||||
|
|
||||||
// Messages.
|
// Messages.
|
||||||
|
|
|
@ -79,6 +79,9 @@ namespace Feeds {
|
||||||
KEY ShowTreeBranches;
|
KEY ShowTreeBranches;
|
||||||
VALUE(bool) ShowTreeBranchesDef;
|
VALUE(bool) ShowTreeBranchesDef;
|
||||||
|
|
||||||
|
KEY AutoExpandOnSelection;
|
||||||
|
VALUE(bool) AutoExpandOnSelectionDef;
|
||||||
|
|
||||||
KEY ListFont;
|
KEY ListFont;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue