Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #9

Merged
merged 10 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
github: [korapp]
ko_fi: korapp
liberapay: korapp
liberapay: korapp
custom: ["revolut.me/korapp"]
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
changelog: ${{ steps.tag_version.outputs.changelog }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Bump version and push tag
id: tag_version
Expand All @@ -30,7 +30,9 @@ jobs:
if: ${{ needs.bump.outputs.new_tag != null }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

- name: Set env
run: |
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt install -y qtdeclarative5-dev-tools qml-module-qttest libxcb-xinerama0
run: |
sudo apt update
sudo apt install -y qtdeclarative5-dev-tools qml-module-qttest libxcb-xinerama0
- name: QmlTestRunner
run: |
export DISPLAY=:99
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
Xvfb :99 &
qmltestrunner
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "package/contents/lib/secrets"]
path = package/contents/lib/secrets
url = https://github.com/korapp/plasma-lib-secrets
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Innoreader Plasmoid
# Inoreader Plasmoid

[![plasma](https://img.shields.io/static/v1?message=KDE%20Store&color=54a3d8&logo=kde&logoColor=FFFFFF&label=)][kdestore]
[![downloads](https://img.shields.io/github/downloads/korapp/plasma-inoreader/total)][releases]
[![release](https://img.shields.io/github/v/release/korapp/plasma-inoreader)][releases]

Plasma applet for [Inoreader](https://innoreader.com).

Expand Down Expand Up @@ -27,7 +31,7 @@ The preferred and easiest way to install is to use Plasma Discover or KDE Get Ne

### From file

Download the latest version of plasmoid from [KDE Store](https://store.kde.org/p/1829436/) or [release page](https://github.com/korapp/plasma-inoreader/releases)
Download the latest version of plasmoid from [KDE Store][kdestore] or [release page][releases]

#### A) Plasma UI

Expand All @@ -46,7 +50,7 @@ plasmapkg2 -i plasma-inoreader-*.plasmoid
Clone repository and go to the project directory

```sh
git clone https://github.com/korapp/plasma-inoreader.git
git clone --recurse-submodules https://github.com/korapp/plasma-inoreader.git
cd plasma-inoreader
```

Expand All @@ -62,3 +66,7 @@ Say thank you with coffee ☕ if you'd like.

[![liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/korapp/donate)
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/korapp)
[<img src="https://img.shields.io/badge/Revolut-white?logo=Revolut&logoColor=black" height="30"/>](https://revolut.me/korapp)

[kdestore]: https://store.kde.org/p/1829436/
[releases]: https://github.com/korapp/plasma-inoreader/releases
100 changes: 0 additions & 100 deletions package/contents/code/qByteArray.mjs

This file was deleted.

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
1 change: 1 addition & 0 deletions package/contents/lib/secrets
Submodule secrets added at 9589dd
24 changes: 21 additions & 3 deletions package/contents/ui/ConfigGeneral.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ import QtQuick.Controls 2.0

import org.kde.kirigami 2.3 as Kirigami

import "../lib/secrets"

Kirigami.FormLayout {

property alias cfg_appId: appId.text
property alias cfg_updateInterval: updateInterval.value
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

Item {
Kirigami.FormData.isSection: true
Expand All @@ -27,23 +32,27 @@ Kirigami.FormLayout {

Secrets {
id: secrets
appId: "Inoreader"
onReady: getAppKey()

property string appKey

function getAppKey() {
return get(appId.text).then(r => appKey.text = r)
return get(appId.text).then(r => this.appKey = r)
}
}

TextField {
id: appId
validator: IntValidator {}
onEditingFinished: secrets.getAppKey(appId.text)
onEditingFinished: secrets.getAppKey()
Kirigami.FormData.label: i18n("App id")
}

TextField {
id: appKey
onEditingFinished: secrets.set(appId.text, text)
text: secrets.appKey
onTextChanged: text !== secrets.appKey && configurationChanged()
Kirigami.FormData.label: i18n("App key")
}

Expand All @@ -70,9 +79,18 @@ 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")
}

function saveConfig() {
secrets.set(appId.text, appKey.text)
}

}
4 changes: 4 additions & 0 deletions package/contents/ui/InoreaderModel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ BaseObject {
readonly property int unreadCount: Math.max(_.unreadCount, 0)
readonly property string unreadCountFormatted: _.kNumber(unreadCount) + (_.unreadMaxReached ? "+" : "")

signal reloaded()

Connections {
target: dispatcher

Expand All @@ -25,6 +27,7 @@ BaseObject {

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

Expand Down Expand Up @@ -110,6 +113,7 @@ BaseObject {

if (!continuation) {
_.articles.clear()
reloaded()
}
_.articles.append(stream.items)
_.unreadNewCount = 0
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
35 changes: 0 additions & 35 deletions package/contents/ui/Secrets.qml

This file was deleted.

Loading