Skip to content

Commit

Permalink
feat: Fetch new articles after 'Read all'
Browse files Browse the repository at this point in the history
  • Loading branch information
korapp committed Feb 25, 2024
1 parent 7700710 commit 4f9da0c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions package/contents/config/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
<entry name="fetchUnreadOnly" type="bool">
<default>true</default>
</entry>
<entry name="readAndFetch" type="bool">
<default>false</default>
</entry>
<entry name="plasmoidHeightFull" type="bool">
<default>true</default>
</entry>
Expand Down
6 changes: 6 additions & 0 deletions package/contents/ui/ConfigGeneral.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Kirigami.FormLayout {
property alias cfg_itemsDownloadLimit: itemsDownloadLimit.value
property alias cfg_autoRead: autoRead.checked
property alias cfg_fetchUnreadOnly: fetchUnreadOnly.checked
property alias cfg_readAndFetch: readAndFetch.checked

signal configurationChanged

Expand Down Expand Up @@ -78,6 +79,11 @@ Kirigami.FormLayout {
Kirigami.FormData.label: i18n("Fetch unread only")
}

CheckBox {
id: readAndFetch
Kirigami.FormData.label: i18n("Fetch articles after 'Read all'")
}

CheckBox {
id: autoRead
Kirigami.FormData.label: i18n("Automatically mark an article as read")
Expand Down
1 change: 1 addition & 0 deletions package/contents/ui/InoreaderModel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ BaseObject {

onSetArticleRead: _.setArticleRead(article, read)
onSetAllArticlesRead: _.setAllArticlesRead(read)
onSetAllArticlesReadAndFetch: _.callPending(() => _.setAllArticlesRead(read).then(_.loadData), 'fetchStream')
onSetArticleStarred: _.setArticleStarred(article, starred)
}

Expand Down
9 changes: 8 additions & 1 deletion package/contents/ui/Logic.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ QtObject {
signal fetchStreamContinuation()

signal setAllArticlesRead(bool read)
signal setAllArticlesReadAndFetch(bool read)
signal setArticleRead(var article, bool read)
signal setArticleStarred(var article, bool starred)

Expand Down Expand Up @@ -52,7 +53,13 @@ QtObject {
icon.name: "checkbox"
text: i18n("Read all")
onTriggered: setAllArticlesRead(true)
}
}

readonly property Action readAllAndFetchAction: Action {
icon.name: "checkbox"
text: i18n("Read all and fetch")
onTriggered: setAllArticlesReadAndFetch(true)
}

readonly property Action starAction: Action {
readonly property var icons: ({ false: "non-starred-symbolic", true: "starred-symbolic" })
Expand Down
2 changes: 1 addition & 1 deletion package/contents/ui/StreamView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ FocusScope {
Layout.fillWidth: true
}
ToolButton {
action: logic.readAllAction
action: plasmoid.configuration.readAndFetch ? logic.readAllAndFetchAction : logic.readAllAction
}
ToolButton {
action: logic.reloadAction
Expand Down

0 comments on commit 4f9da0c

Please sign in to comment.