Skip to content
Open
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
4 changes: 4 additions & 0 deletions rss-feed/BarWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ Item {
property var defaults: pluginApi?.manifest?.metadata?.defaultSettings || ({})

readonly property var feeds: cfg.feeds || defaults.feeds || []
readonly property bool showOnlyWhenUnread: cfg.showOnlyWhenUnread ?? defaults.showOnlyWhenUnread ?? false
readonly property int updateInterval: cfg.updateInterval ?? defaults.updateInterval ?? 600
readonly property int maxItemsPerFeed: cfg.maxItemsPerFeed ?? defaults.maxItemsPerFeed ?? 10
readonly property bool showOnlyUnread: cfg.showOnlyUnread ?? defaults.showOnlyUnread ?? false
readonly property bool markAsReadOnClick: cfg.markAsReadOnClick ?? defaults.markAsReadOnClick ?? true
readonly property var readItems: cfg.readItems || defaults.readItems || []

readonly property bool isVisible: !showOnlyWhenUnread || unreadCount > 0
visible: root.isVisible

// Watch for changes in readItems and cfg to update unread count
onCfgChanged: {
Logger.d("RSS Feed", "RSS Feed BarWidget: Config changed");
Expand Down
20 changes: 10 additions & 10 deletions rss-feed/Panel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ Item {
spacing: Style.marginM

NText {
text: pluginApi?.tr("widget.title", "RSS Feeds") || "RSS Feeds"
text: pluginApi?.tr("widget.title")
pointSize: Style.fontSizeL
font.bold: true
color: Color.mOnSurface
Expand Down Expand Up @@ -435,7 +435,7 @@ Item {
}

NButton {
text: pluginApi?.tr("widget.markAllRead", "Mark all as read") || "Mark all as read"
text: pluginApi?.tr("widget.markAllRead")
enabled: displayItems.length > 0
onClicked: markAllAsRead()
}
Expand Down Expand Up @@ -533,7 +533,7 @@ Item {

// Feed name
NText {
text: modelData.feedName || "Unknown Feed"
text: modelData.feedName || (pluginApi ? pluginApi.tr("widget.unknownFeed") : "")
pointSize: Style.fontSizeS
font.bold: true
color: Color.mPrimary
Expand All @@ -543,7 +543,7 @@ Item {

// Title
NText {
text: modelData.title || "Untitled"
text: modelData.title || (pluginApi ? pluginApi.tr("widget.untitled") : "")
pointSize: Style.fontSizeM
font.bold: isUnread
color: Color.mOnSurface
Expand Down Expand Up @@ -590,7 +590,7 @@ Item {
NText {
visible: displayItems.length === 0
anchors.centerIn: parent
text: pluginApi?.tr("widget.noItems", "No items to display") || "No items to display"
text: pluginApi?.tr("widget.noItems")
pointSize: Style.fontSizeM
color: Color.mSecondary
}
Expand All @@ -606,7 +606,7 @@ Item {
Layout.fillWidth: true

NText {
text: allItems.length + " total items"
text: pluginApi ? pluginApi.tr("widget.totalItems").replace("%1", allItems.length) : ""
pointSize: Style.fontSizeS
color: Color.mSecondary
Layout.fillWidth: true
Expand All @@ -623,10 +623,10 @@ Item {
const diffHours = Math.floor(diffMs / 3600000);
const diffDays = Math.floor(diffMs / 86400000);

if (diffMins < 1) return pluginApi?.tr("widget.timeNow", "now") || "now";
if (diffMins < 60) return (pluginApi?.tr("widget.timeMinutes", "%1min ago") || "%1min ago").replace("%1", diffMins);
if (diffHours < 24) return (pluginApi?.tr("widget.timeHours", "%1h ago") || "%1h ago").replace("%1", diffHours);
if (diffDays < 7) return (pluginApi?.tr("widget.timeDays", "%1d ago") || "%1d ago").replace("%1", diffDays);
if (diffMins < 1) return pluginApi ? pluginApi.tr("widget.timeNow") : "";
if (diffMins < 60) return pluginApi ? pluginApi.tr("widget.timeMinutes").replace("%1", diffMins) : "";
if (diffHours < 24) return pluginApi ? pluginApi.tr("widget.timeHours").replace("%1", diffHours) : "";
if (diffDays < 7) return pluginApi ? pluginApi.tr("widget.timeDays").replace("%1", diffDays) : "";

return date.toLocaleDateString();
}
Expand Down
57 changes: 39 additions & 18 deletions rss-feed/Settings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ColumnLayout {
property var defaults: pluginApi?.manifest?.metadata?.defaultSettings || ({})

property var feeds: cfg.feeds || defaults.feeds || []
property bool showOnlyWhenUnread: cfg.showOnlyWhenUnread ?? defaults.showOnlyWhenUnread ?? false
property int updateInterval: (cfg.updateInterval ?? defaults.updateInterval ?? 600)
property int maxItemsPerFeed: cfg.maxItemsPerFeed ?? defaults.maxItemsPerFeed ?? 10
property bool showOnlyUnread: cfg.showOnlyUnread ?? defaults.showOnlyUnread ?? false
Expand All @@ -35,6 +36,7 @@ ColumnLayout {
}

pluginApi.pluginSettings.feeds = feeds;
pluginApi.pluginSettings.showOnlyWhenUnread = showOnlyWhenUnread;
pluginApi.pluginSettings.updateInterval = updateInterval;
pluginApi.pluginSettings.maxItemsPerFeed = maxItemsPerFeed;
pluginApi.pluginSettings.showOnlyUnread = showOnlyUnread;
Expand Down Expand Up @@ -83,8 +85,8 @@ ColumnLayout {
spacing: Style.marginS

NLabel {
label: pluginApi?.tr("settings.updateInterval", "Update Interval") || "Update Interval"
description: pluginApi?.tr("settings.updateIntervalDesc", "How often to check for new items (seconds)") || "How often to check for new items (seconds)"
label: pluginApi?.tr("settings.updateInterval")
description: pluginApi?.tr("settings.updateIntervalDesc")
}

RowLayout {
Expand All @@ -101,7 +103,7 @@ ColumnLayout {
}

Text {
text: pluginApi?.tr("settings.seconds", "seconds") || "seconds"
text: pluginApi?.tr("settings.seconds")
color: Style.textColorSecondary || "#FFFFFF"
font.pixelSize: Style.fontSizeM || 14
}
Expand All @@ -114,8 +116,8 @@ ColumnLayout {
spacing: Style.marginS

NLabel {
label: pluginApi?.tr("settings.maxItems", "Max Items Per Feed") || "Max Items Per Feed"
description: pluginApi?.tr("settings.maxItemsDesc", "Maximum number of items to fetch from each feed") || "Maximum number of items to fetch from each feed"
label: pluginApi?.tr("settings.maxItems")
description: pluginApi?.tr("settings.maxItemsDesc")
}

NSpinBox {
Expand All @@ -135,8 +137,8 @@ ColumnLayout {
spacing: Style.marginS

NLabel {
label: pluginApi?.tr("settings.showOnlyUnread", "Show Only Unread") || "Show Only Unread"
description: pluginApi?.tr("settings.showOnlyUnreadDesc", "Display only unread items in the panel") || "Display only unread items in the panel"
label: pluginApi?.tr("settings.showOnlyUnread")
description: pluginApi?.tr("settings.showOnlyUnreadDesc")
}

NToggle {
Expand All @@ -148,14 +150,33 @@ ColumnLayout {
}
}

// Show When Unread Only
ColumnLayout {
Layout.fillWidth: true
spacing: Style.marginS

NLabel {
label: pluginApi?.tr("settings.showOnlyWhenUnread")
description: pluginApi?.tr("settings.showOnlyWhenUnreadDesc")
}

NToggle {
checked: showOnlyWhenUnread
onToggled: {
showOnlyWhenUnread = checked;
saveSettings();
}
}
}

// Mark as Read on Click
ColumnLayout {
Layout.fillWidth: true
spacing: Style.marginS

NLabel {
label: pluginApi?.tr("settings.markOnClick", "Mark as Read on Click") || "Mark as Read on Click"
description: pluginApi?.tr("settings.markOnClickDesc", "Automatically mark items as read when opening them") || "Automatically mark items as read when opening them"
label: pluginApi?.tr("settings.markOnClick")
description: pluginApi?.tr("settings.markOnClickDesc")
}

NToggle {
Expand All @@ -175,7 +196,7 @@ ColumnLayout {

// Feeds Management
Text {
text: pluginApi?.tr("settings.feeds", "RSS Feeds") || "RSS Feeds"
text: pluginApi?.tr("settings.feeds")
font.pixelSize: Style.fontSizeL || 18
font.bold: true
color: Style.textColor || "#FFFFFF"
Expand All @@ -187,7 +208,7 @@ ColumnLayout {
spacing: Style.marginS

Text {
text: pluginApi?.tr("settings.addFeed", "Add New Feed") || "Add New Feed"
text: pluginApi?.tr("settings.addFeed")
font.bold: true
color: Style.textColor || "#FFFFFF"
font.pixelSize: Style.fontSizeM || 14
Expand All @@ -202,14 +223,14 @@ ColumnLayout {
spacing: 4

Text {
text: pluginApi?.tr("settings.feedName", "Feed Name") || "Feed Name"
text: pluginApi?.tr("settings.feedName")
font.pixelSize: Style.fontSizeS || 12
color: Style.textColorSecondary || "#FFFFFF"
}

NTextInput {
Layout.fillWidth: true
placeholderText: "Example Blog"
placeholderText: pluginApi?.tr("settings.feedNamePlaceholder")
text: newFeedName
onTextChanged: newFeedName = text
}
Expand All @@ -220,21 +241,21 @@ ColumnLayout {
spacing: 4

Text {
text: pluginApi?.tr("settings.feedUrl", "Feed URL") || "Feed URL"
text: pluginApi?.tr("settings.feedUrl")
font.pixelSize: Style.fontSizeS || 12
color: Style.textColorSecondary || "#FFFFFF"
}

NTextInput {
Layout.fillWidth: true
placeholderText: "https://example.com/feed.xml"
placeholderText: pluginApi?.tr("settings.feedUrlPlaceholder")
text: newFeedUrl
onTextChanged: newFeedUrl = text
}
}

NButton {
text: pluginApi?.tr("settings.add", "Add") || "Add"
text: pluginApi?.tr("settings.add")
enabled: newFeedName.trim() !== "" && newFeedUrl.trim() !== ""
onClicked: addFeed()
}
Expand Down Expand Up @@ -289,7 +310,7 @@ ColumnLayout {
}

NButton {
text: pluginApi?.tr("settings.remove", "Remove") || "Remove"
text: pluginApi?.tr("settings.remove")
onClicked: removeFeed(index)
}
}
Expand All @@ -298,7 +319,7 @@ ColumnLayout {
Text {
visible: feeds.length === 0
anchors.centerIn: parent
text: pluginApi?.tr("settings.noFeeds", "No feeds configured. Add one above!") || "No feeds configured. Add one above!"
text: pluginApi?.tr("settings.noFeeds")
font.pixelSize: Style.fontSizeM || 14
color: Style.textColorSecondary || "#888888"
}
Expand Down
9 changes: 8 additions & 1 deletion rss-feed/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"settings": {
"add": "Hinzufügen",
"addFeed": "Neuen Feed hinzufügen",
"feedNamePlaceholder": "Beispiel-Blog",
"feedName": "Feed-Name",
"feedUrlPlaceholder": "https://beispiel.de/feed.xml",
"feedUrl": "Feed-URL",
"feeds": "RSS-Feeds",
"markOnClick": "Als gelesen markieren beim Klicken",
Expand All @@ -14,17 +16,22 @@
"seconds": "Sekunden",
"showOnlyUnread": "Nur ungelesene anzeigen",
"showOnlyUnreadDesc": "Nur ungelesene Einträge im Panel anzeigen",
"showOnlyWhenUnread": "Nur bei ungelesenen anzeigen",
"showOnlyWhenUnreadDesc": "Widget nur anzeigen, wenn ungelesene Artikel vorhanden sind",
"title": "RSS-Feed-Reader-Einstellungen",
"updateInterval": "Aktualisierungsintervall",
"updateIntervalDesc": "Wie oft nach neuen Einträgen gesucht werden soll (Sekunden)"
},
"widget": {
"markAllRead": "Alle als gelesen markieren",
"noItems": "Keine Einträge zum Anzeigen",
"totalItems": "%1 Einträge insgesamt",
"timeDays": "vor %1T.",
"timeHours": "vor %1Std.",
"timeMinutes": "vor %1Min.",
"timeNow": "jetzt",
"title": "RSS-Feeds"
"title": "RSS-Feeds",
"unknownFeed": "Unbekannter Feed",
"untitled": "Ohne Titel"
}
}
9 changes: 8 additions & 1 deletion rss-feed/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"settings": {
"add": "Add",
"addFeed": "Add New Feed",
"feedNamePlaceholder": "Example Blog",
"feedName": "Feed Name",
"feedUrlPlaceholder": "https://example.com/feed.xml",
"feedUrl": "Feed URL",
"feeds": "RSS Feeds",
"markOnClick": "Mark as Read on Click",
Expand All @@ -14,17 +16,22 @@
"seconds": "seconds",
"showOnlyUnread": "Show Only Unread",
"showOnlyUnreadDesc": "Display only unread items in the panel",
"showOnlyWhenUnread": "Show Only When Unread",
"showOnlyWhenUnreadDesc": "Only show the widget when there are unread articles",
"title": "RSS Feed Reader Settings",
"updateInterval": "Update Interval",
"updateIntervalDesc": "How often to check for new items (seconds)"
},
"widget": {
"markAllRead": "Mark all as read",
"noItems": "No items to display",
"totalItems": "%1 total items",
"timeDays": "%1d ago",
"timeHours": "%1h ago",
"timeMinutes": "%1min ago",
"timeNow": "now",
"title": "RSS Feeds"
"title": "RSS Feeds",
"unknownFeed": "Unknown Feed",
"untitled": "Untitled"
}
}
9 changes: 8 additions & 1 deletion rss-feed/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"settings": {
"add": "Agregar",
"addFeed": "Agregar Nuevo Feed",
"feedNamePlaceholder": "Blog de ejemplo",
"feedName": "Nombre del Feed",
"feedUrlPlaceholder": "https://ejemplo.com/feed.xml",
"feedUrl": "URL del Feed",
"feeds": "Feeds RSS",
"markOnClick": "Marcar Como Leído al Hacer Clic",
Expand All @@ -14,17 +16,22 @@
"seconds": "segundos",
"showOnlyUnread": "Mostrar Solo No Leídos",
"showOnlyUnreadDesc": "Mostrar solo elementos no leídos en el panel",
"showOnlyWhenUnread": "Mostrar solo cuando haya no leídos",
"showOnlyWhenUnreadDesc": "Mostrar el widget solo cuando haya artículos no leídos",
"title": "Configuración del Lector RSS",
"updateInterval": "Intervalo de Actualización",
"updateIntervalDesc": "Cada cuánto tiempo buscar nuevos elementos (segundos)"
},
"widget": {
"markAllRead": "Marcar todos como leídos",
"noItems": "No hay elementos para mostrar",
"totalItems": "%1 elementos en total",
"timeDays": "hace %1d",
"timeHours": "hace %1h",
"timeMinutes": "hace %1min",
"timeNow": "ahora",
"title": "Feeds RSS"
"title": "Feeds RSS",
"unknownFeed": "Feed desconocido",
"untitled": "Sin título"
}
}
9 changes: 8 additions & 1 deletion rss-feed/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"settings": {
"add": "Ajouter",
"addFeed": "Ajouter un Nouveau Flux",
"feedNamePlaceholder": "Blog d'exemple",
"feedName": "Nom du Flux",
"feedUrlPlaceholder": "https://exemple.com/feed.xml",
"feedUrl": "URL du Flux",
"feeds": "Flux RSS",
"markOnClick": "Marquer Comme Lu au Clic",
Expand All @@ -14,17 +16,22 @@
"seconds": "secondes",
"showOnlyUnread": "Afficher Uniquement Non Lus",
"showOnlyUnreadDesc": "Afficher uniquement les éléments non lus dans le panneau",
"showOnlyWhenUnread": "Afficher uniquement s'il y a des non lus",
"showOnlyWhenUnreadDesc": "Afficher le widget uniquement lorsqu'il y a des articles non lus",
"title": "Paramètres du Lecteur RSS",
"updateInterval": "Intervalle de Mise à Jour",
"updateIntervalDesc": "Fréquence de vérification des nouveaux éléments (secondes)"
},
"widget": {
"markAllRead": "Tout marquer comme lu",
"noItems": "Aucun élément à afficher",
"totalItems": "%1 éléments au total",
"timeDays": "il y a %1j",
"timeHours": "il y a %1h",
"timeMinutes": "il y a %1min",
"timeNow": "maintenant",
"title": "Flux RSS"
"title": "Flux RSS",
"unknownFeed": "Flux inconnu",
"untitled": "Sans titre"
}
}
Loading