Probably fixed #121.

This commit is contained in:
Martin Rotter 2015-08-25 07:09:10 +02:00
parent 5da26eee69
commit 6c36613da1
7 changed files with 30 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -24,6 +24,7 @@
Fixed:
<ul>
<li>Categories are now not expanded when selected using "Go to next/previous item" in feeds list. (bug #122)</li>
<li>Added action to expand/collapse currently selected item in feeds list. (enhancement #121)</li>
<ul>
<hr/>

View File

@ -278,6 +278,7 @@ void FormMain::setupIcons() {
m_ui->m_actionSelectPreviousMessage->setIcon(icon_theme_factory->fromTheme(QSL("go-up")));
m_ui->m_actionShowOnlyUnreadFeeds->setIcon(icon_theme_factory->fromTheme(QSL("mail-mark-unread")));
m_ui->m_actionFetchFeedMetadata->setIcon(icon_theme_factory->fromTheme(QSL("download-manager")));
m_ui->m_actionExpandCollapseFeedCategory->setIcon(icon_theme_factory->fromTheme(QSL("expand-collapse")));
// Setup icons for underlying components: opened web browsers...
foreach (WebBrowser *browser, WebBrowser::runningWebBrowsers()) {

View File

@ -146,6 +146,7 @@
<addaction name="m_actionFetchFeedMetadata"/>
<addaction name="separator"/>
<addaction name="m_actionShowOnlyUnreadFeeds"/>
<addaction name="m_actionExpandCollapseFeedCategory"/>
<addaction name="separator"/>
<addaction name="m_actionSelectNextFeedCategory"/>
<addaction name="m_actionSelectPreviousFeedCategory"/>
@ -671,6 +672,14 @@
<string notr="true">Ctrl+Shift+F</string>
</property>
</action>
<action name="m_actionExpandCollapseFeedCategory">
<property name="text">
<string>&amp;Expand/collapse selected feed/category</string>
</property>
<property name="shortcut">
<string notr="true">E</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

View File

@ -317,6 +317,7 @@ void FeedMessageViewer::updateFeedButtonsAvailability() {
form_main->m_ui->m_actionUpdateSelectedFeeds->setEnabled(!critical_action_running && feed_selected);
form_main->m_ui->m_actionViewSelectedItemsNewspaperMode->setEnabled(feed_selected);
form_main->m_ui->m_actionFetchFeedMetadata->setEnabled(feed_selected);
form_main->m_ui->m_actionExpandCollapseFeedCategory->setEnabled(feed_selected);
form_main->m_ui->m_menuAddItem->setEnabled(!critical_action_running);
}
@ -388,6 +389,8 @@ void FeedMessageViewer::createConnections() {
SIGNAL(triggered()), m_feedsView, SLOT(markAllFeedsRead()));
connect(form_main->m_ui->m_actionMarkSelectedFeedsAsRead,
SIGNAL(triggered()), m_feedsView, SLOT(markSelectedFeedsRead()));
connect(form_main->m_ui->m_actionExpandCollapseFeedCategory,
SIGNAL(triggered()), m_feedsView, SLOT(expandCollapseCurrentItem()));
connect(form_main->m_ui->m_actionFetchFeedMetadata, SIGNAL(triggered()),
m_feedsView, SLOT(fetchMetadataForSelectedFeed()));
connect(form_main->m_ui->m_actionMarkSelectedFeedsAsUnread,

View File

@ -143,6 +143,19 @@ void FeedsView::invalidateReadFeedsFilter(bool set_new_value, bool show_unread_o
QTimer::singleShot(0, m_proxyModel, SLOT(invalidateFilter()));
}
void FeedsView::expandCollapseCurrentItem() {
if (selectionModel()->selectedRows().size() == 1) {
QModelIndex index = selectionModel()->selectedRows().at(0);
if (!index.child(0, 0).isValid() && index.parent().isValid()) {
setCurrentIndex(index.parent());
index = index.parent();
}
isExpanded(index) ? collapse(index) : expand(index);
}
}
void FeedsView::updateAllFeeds() {
emit feedsUpdateRequested(allFeeds());
}
@ -480,7 +493,6 @@ void FeedsView::selectNextItem() {
if (index_next.isValid()) {
setCurrentIndex(index_next);
selectionModel()->select(index_next, QItemSelectionModel::Select | QItemSelectionModel::Rows);
setFocus();
}
}
@ -498,7 +510,6 @@ void FeedsView::selectPreviousItem() {
if (index_previous.isValid()) {
setCurrentIndex(index_previous);
selectionModel()->select(index_previous, QItemSelectionModel::Select | QItemSelectionModel::Rows);
setFocus();
}
}
@ -651,7 +662,7 @@ void FeedsView::validateItemAfterDragDrop(const QModelIndex &source_index) {
QModelIndex mapped = m_proxyModel->mapFromSource(source_index);
if (mapped.isValid()) {
setExpanded(mapped, true);
expand(mapped);
setCurrentIndex(mapped);
}
}

View File

@ -69,6 +69,8 @@ class FeedsView : public QTreeView {
public slots:
void invalidateReadFeedsFilter(bool set_new_value = false, bool show_unread_only = false);
void expandCollapseCurrentItem();
void fetchMetadataForSelectedFeed();
// Feed updating.
void updateAllFeeds();
@ -82,8 +84,6 @@ class FeedsView : public QTreeView {
void markAllFeedsReadStatus(int read);
void markAllFeedsRead();
void fetchMetadataForSelectedFeed();
// Newspaper accessors.
void openSelectedFeedsInNewspaperMode();