Commit 1698aa23 authored by Luigi Baldoni's avatar Luigi Baldoni Committed by Laurent Montel
Browse files

Fix bug 354983 - allow to lock feeds in place

BUG: 354983

(thanks @Jari Kuittinen)
parent e9e32213
......@@ -51,6 +51,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_LockFeedsInPlace">
<property name="text">
<string>Lock feeds in place</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_AutoExpandFolders">
<property name="text">
......
......@@ -10,6 +10,11 @@
<whatsthis>Hides feeds with no unread articles</whatsthis>
<default>false</default>
</entry>
<entry key="Lock Feeds In Place" type="Bool">
<label>Prevent feeds from being moved in the list</label>
<whatsthis>Locks feeds where they are</whatsthis>
<default>false</default>
</entry>
<entry key="Auto Expand Folders" type="Bool">
<label>Auto-Expand folders with unread articles</label>
<whatsthis>Auto-expand folders containing unread articles</whatsthis>
......
......@@ -117,6 +117,13 @@ void ActionManagerImpl::slotSettingsChanged()
}
a->setChecked(Settings::hideReadFeeds());
a = action(QStringLiteral("feed_lock_in_place"));
if (!a) {
qCCritical(AKREGATOR_LOG) << "Action not found";
return;
}
a->setChecked(Settings::lockFeedsInPlace());
a = action(QStringLiteral("auto_expand_folders"));
if (!a) {
qCCritical(AKREGATOR_LOG) << "Action not found";
......@@ -529,6 +536,12 @@ void ActionManagerImpl::initSubscriptionListView(SubscriptionListView *subscript
action->setChecked(Settings::hideReadFeeds());
connect(action, &QAction::triggered, subscriptionListView, &SubscriptionListView::slotSetHideReadFeeds);
action = coll->addAction(QStringLiteral("feed_lock_in_place"));
action->setCheckable(true);
action->setText(i18n("Lock Feeds In Place"));
action->setChecked(Settings::lockFeedsInPlace());
connect(action, &QAction::triggered, subscriptionListView, &SubscriptionListView::slotSetLockFeedsInPlace);
action = coll->addAction(QStringLiteral("auto_expand_folders"));
action->setCheckable(true);
action->setText(i18n("Auto-expand folders with unread articles"));
......
......@@ -26,6 +26,7 @@
<Action name="zoom_menu"/>
<Separator/>
<Action name="feed_hide_read"/>
<Action name="feed_lock_in_place"/>
<Action name="auto_expand_folders"/>
</Menu>
......
......@@ -393,6 +393,17 @@ void SubscriptionListView::slotSetHideReadFeeds(bool setting)
filter->setDoFilter(setting);
}
void SubscriptionListView::slotSetLockFeedsInPlace(bool setting)
{
if (!model()) {
return;
}
setDragDropMode(setting? QAbstractItemView::NoDragDrop : QAbstractItemView::InternalMove);
Settings::setLockFeedsInPlace(setting);
}
void Akregator::SubscriptionListView::slotSetAutoExpandFolders(bool setting)
{
Settings::setAutoExpandFolders(setting);
......
......@@ -53,6 +53,7 @@ public Q_SLOTS:
void slotItemDown();
void slotSetHideReadFeeds(bool setting);
void slotSetLockFeedsInPlace(bool setting);
void slotSetAutoExpandFolders(bool setting);
Q_SIGNALS:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment