From 1c7650d20baf243b102442d29d2edbf6411d2522 Mon Sep 17 00:00:00 2001 From: Thilo Kogge Date: Sun, 13 Nov 2022 22:22:42 +0100 Subject: [PATCH] Added setting for episode image actions --- qml/components/EpisodeImage.qml | 35 ++++++-- qml/components/QueueHandlerPython.qml | 10 +++ qml/harbour-podqast.qml | 10 ++- qml/pages/Settings.qml | 30 +++++++ translations/harbour-podqast-de.ts | 118 ++++++++++++++++---------- translations/harbour-podqast-es.ts | 116 +++++++++++++++---------- translations/harbour-podqast-fr.ts | 116 +++++++++++++++---------- translations/harbour-podqast-sv.ts | 116 +++++++++++++++---------- translations/harbour-podqast-zh_CN.ts | 116 +++++++++++++++---------- translations/harbour-podqast.ts | 116 +++++++++++++++---------- 10 files changed, 516 insertions(+), 267 deletions(-) diff --git a/qml/components/EpisodeImage.qml b/qml/components/EpisodeImage.qml index 926dbf3..0c693ad 100644 --- a/qml/components/EpisodeImage.qml +++ b/qml/components/EpisodeImage.qml @@ -15,12 +15,35 @@ Thumbnail { MouseArea { anchors.fill: parent onClicked: { - if (model.id === playerHandler.firstid) { - playerHandler.playpause() - } else { - queuehandler.queueInsertTop(model.id, function () { - playerHandler.play() - }) + switch (episodeImageClickActionConf.value) { + case 0: + queuehandler.playAndSetPositionInQueue(model.id) + break + case 1: + pageStack.push(Qt.resolvedUrl("../pages/PodpostList.qml"), { + "url": model.podcast_url + }) + break + case 2: + pageStack.push(Qt.resolvedUrl("../pages/PostDescription.qml"), { + "title": model.title, + "detail": model.detail, + "length": model.length, + "date": model.date, + "duration": model.duration, + "href": model.link + }) + break + case 3: + queuehandler.queueInsertNext(model.id) + break + case 4: + queuehandler.queueInsertBottom(model.id) + break + default: + console.error( + "unexpected config value for episodeImageClickActionConf: " + + episodeImageClickActionConf.value) } } } diff --git a/qml/components/QueueHandlerPython.qml b/qml/components/QueueHandlerPython.qml index bdbd3cf..a9ee02c 100644 --- a/qml/components/QueueHandlerPython.qml +++ b/qml/components/QueueHandlerPython.qml @@ -107,6 +107,16 @@ Python { function () {}) } + function playAndSetPositionInQueue(episodeid) { + if (episodeid === playerHandler.firstid && !playerHandler.isPlaying) { + playerHandler.play() + } else { + queueInsertTop(episodeid, function () { + playerHandler.play() + }) + } + } + onError: { console.log('python error: ' + traceback) } diff --git a/qml/harbour-podqast.qml b/qml/harbour-podqast.qml index 851b2b4..84f2315 100644 --- a/qml/harbour-podqast.qml +++ b/qml/harbour-podqast.qml @@ -265,6 +265,12 @@ ApplicationWindow { defaultValue: true } + ConfigurationValue { + id: episodeImageClickActionConf + key: "/apps/ControlPanel/podqast/episodeImageClickAction" + defaultValue: 0 + } + function refresh() { connmanWifi.getProperties() } @@ -317,7 +323,7 @@ ApplicationWindow { feedparserhandler.refreshPodcasts() } - getProperties() + connmanWifi.getProperties() } DBusAdaptor { @@ -522,7 +528,7 @@ ApplicationWindow { artUrl: playerHandler.playicon } - loopStatus: Mpris.None + loopStatus: Mpris.LoopNone shuffle: false onPauseRequested: playerHandler.pause() onPlayPauseRequested: playerHandler.playpause() diff --git a/qml/pages/Settings.qml b/qml/pages/Settings.qml index 555b361..e694569 100644 --- a/qml/pages/Settings.qml +++ b/qml/pages/Settings.qml @@ -34,6 +34,34 @@ Dialog { color: Theme.highlightColor } + ComboBox { + anchors { + left: parent.left + right: parent.right + margins: Theme.paddingMedium + } + id: imageClickAction + width: parent.width + label: qsTr("When touching episode image...") + menu: ContextMenu { + MenuItem { + text: qsTr("Play Episode") + } + MenuItem { + text: qsTr("Show Podcast Episodes") + } + MenuItem { + text: qsTr("Show Episode Info") + } + MenuItem { + text: qsTr("Add To Queue Top") + } + MenuItem { + text: qsTr("Add To Queue Bottom") + } + } + } + ComboBox { anchors { left: parent.left @@ -365,6 +393,7 @@ Dialog { autoPlayQueue.checked = autoPlayNextInQueue.value // downLimit.value = downLimitConf.value // refreshTime = refreshTimeConf.value + imageClickAction.currentIndex = episodeImageClickActionConf.value } onAccepted: { // useGpodderConf.value = useGpodder.checked @@ -388,5 +417,6 @@ Dialog { markListenedEndThresholdConf.value = listenedThreshold.value // downLimitConf.value = downLimit.value // refreshTimeConf.value = refreshTime + episodeImageClickActionConf.value = imageClickAction.currentIndex } } diff --git a/translations/harbour-podqast-de.ts b/translations/harbour-podqast-de.ts index d5c97f5..2fd4409 100644 --- a/translations/harbour-podqast-de.ts +++ b/translations/harbour-podqast-de.ts @@ -761,154 +761,184 @@ + When touching episode image... + Beim tippen auf ein Episodenbild... + + + + Show Podcast Episodes + Zeige andere Episoden des Podcasts + + + Move new post to Neuen Beitrag - - + + Inbox in den Eingang - - + + Archive in das Archiv - + Automatic post limit Höchstgrenze automatisierter Beiträge - + Refresh time Aktualisierungs-Intervall - + Audio playrate Abspielgeschwindigkeit - + off aus - + Time left to ignore for listened-mark - + Download/Streaming Laden/Stream - + Development Entwicklung - + Experimental features Experimentelle Funktionen - - + + Top of Playlist an den Anfang der Playlist + + + Play Episode + Spiele die Episode + - + Show Episode Info + Zeige die Episodenbeschreibung + + + + Add To Queue Top + An den Anfang der Playlist + + + + Add To Queue Bottom + An das Ende der Playlist + + + + Bottom of Playlist ans Ende der Playlist - + All - + Alle - + s - + Sleep timer Schlummer-Uhr - + min min - + External Audio Fremde Audiodateien - + Allow external audio Erlaube fremde Audiodateien - + Will take data from Hole Daten von - + Move external audio to Externe Audiodateien - + Download Playlist Posts Herunterladen von Playlist-Beiträgen - + Download on Mobile Bei Mobilfunk laden - + Keep Favorites downloaded Favoriten speichern - + Will save data in Speicher Daten in - + System System - + Audio viewable in system Audio im System sichbar - + Auto-play next episode in queue - + Force refresh of old episodes @@ -1021,50 +1051,50 @@ harbour-podqast - + New posts available Neue Beiträge verfügbar - + Click to view updates Klicken um Aktualisierungen anzusehen - + New Posts are available. Click to view. Neue Beiträge verfügbar. Klicke zum Betrachten. - - + + PodQast message PodQast-Nachricht - + New PodQast message Neue PodQast-Nachricht - + Podcasts imported Podcasts importiert - - + + Podcasts imported from OPML Podcasts vom OPML importiert - + Error Fehler - - + + Audio File not existing Audiodatei existiert nicht diff --git a/translations/harbour-podqast-es.ts b/translations/harbour-podqast-es.ts index 1837e03..e7eb02b 100644 --- a/translations/harbour-podqast-es.ts +++ b/translations/harbour-podqast-es.ts @@ -761,152 +761,182 @@ + When touching episode image... + + + + + Show Podcast Episodes + + + + Move new post to Mover nueva publicación a - - + + Inbox Entradas - - + + Archive Almacén - + Automatic post limit Límite de publicaciones automáticas - + Refresh time Tiempo de actualización - + Audio playrate Velocidad de reproducción - + off apagado - + Time left to ignore for listened-mark - + Download/Streaming Descarga/Transmisión - + Development Desarrollo - + Experimental features Funciones experimentales - - + + Top of Playlist Al principio de la lista + + + Play Episode + + - + Show Episode Info + + + + + Add To Queue Top + + + + + Add To Queue Bottom + + + + + Bottom of Playlist Al final de la lista - + All - + s - + Sleep timer - + min - + External Audio Audio externo - + Allow external audio Permitir audio externo - + Will take data from Cogerá datos de - + Move external audio to Mover audio externo a - + Download Playlist Posts Descargar publicaciones de la lista - + Download on Mobile Descargar en el móvil - + Keep Favorites downloaded Conservar favoritos descargados - + Will save data in Guardará los datos en - + System Sistema - + Audio viewable in system Audio visible en el sistema - + Auto-play next episode in queue - + Force refresh of old episodes @@ -1019,50 +1049,50 @@ harbour-podqast - + New posts available Nuevas publicaciones disponibles - + Click to view updates Haz clic para ver actualizaciones - + New Posts are available. Click to view. Hay nuevas publicaciones. Haz clic para verlas. - - + + PodQast message Mensaje de PodQast - + New PodQast message Nuevo mensaje de PodQast - + Podcasts imported podcasts importados - - + + Podcasts imported from OPML podcasts importados desde OPML - + Error Error - - + + Audio File not existing El archivo de audio no existe diff --git a/translations/harbour-podqast-fr.ts b/translations/harbour-podqast-fr.ts index 92810dc..fc9a287 100644 --- a/translations/harbour-podqast-fr.ts +++ b/translations/harbour-podqast-fr.ts @@ -762,154 +762,184 @@ + When touching episode image... + + + + + Show Podcast Episodes + + + + Move new post to Transférer les nouveaux articles - - + + Inbox Boîte aux lettres - - + + Archive Archives - + Automatic post limit Limite automatique du nombre d'articles - + Refresh time Temps de rafraîchissement - + Audio playrate Vitesse de lecture - + off Désactivé - + Time left to ignore for listened-mark - + Download/Streaming Téléchargement/Streaming - + Development Développement - + Experimental features Fonctionnalités expérimentales - - + + Top of Playlist En début de Playlist + + + Play Episode + + - + Show Episode Info + + + + + Add To Queue Top + + + + + Add To Queue Bottom + + + + + Bottom of Playlist En fin de la Playlist - + All - + s - + Sleep timer Minuterie avant coupure - + min - + External Audio Fichiers Audios Externes - + Allow external audio Autoriser les fichiers externes - + Will take data from Prendra les données depuis - + Move external audio to Transférer les fichiers externes - + Download Playlist Posts Télécharger les Playlists d'Articles - + Download on Mobile Télécharger hors Wifi - + Keep Favorites downloaded Conserver les favoris déjà téléchargés - + Will save data in Sauvegardera les données dans - + System Système - + Audio viewable in system Audio visible dans le système - + Auto-play next episode in queue - + Force refresh of old episodes @@ -1022,50 +1052,50 @@ harbour-podqast - + New posts available Nouveaux articles disponibles - + Click to view updates Cliquez pour voir les mises à jour - + New Posts are available. Click to view. De nouveaux articles sont diponibles. Cliquez pour voir. - - + + PodQast message Message PodQast - + New PodQast message Nouveau message PodQast - + Podcasts imported Podcasts importés - - + + Podcasts imported from OPML Podcasts importés depuis OPML - + Error Erreur - - + + Audio File not existing Le fichier audio n'existe pas diff --git a/translations/harbour-podqast-sv.ts b/translations/harbour-podqast-sv.ts index 36e2a48..7e0186d 100644 --- a/translations/harbour-podqast-sv.ts +++ b/translations/harbour-podqast-sv.ts @@ -761,154 +761,184 @@ + When touching episode image... + + + + + Show Podcast Episodes + + + + Move new post to Flytta ny post till - - + + Inbox Inkorg - - + + Archive Arkiv - + Automatic post limit Automatisk postbegränsning - + Refresh time Uppdateringstid - + Audio playrate Spelningsfrekvens - + off av - + Time left to ignore for listened-mark - + Download/Streaming Nerladdning/Strömmning - + Development Utveckling - + Experimental features Experimentella funktioner - - + + Top of Playlist Först i spelningslistan + + + Play Episode + + - + Show Episode Info + + + + + Add To Queue Top + + + + + Add To Queue Bottom + + + + + Bottom of Playlist Sist i spelningslistan - + All - + s - + Sleep timer Insomningsur - + min min - + External Audio Externt ljud - + Allow external audio Tillåt externt ljud - + Will take data from Hämtar data från - + Move external audio to Flytta externt ljud till - + Download Playlist Posts Ladda ner spelningslistans poster - + Download on Mobile Ladda ner på mobilanslutning - + Keep Favorites downloaded Behåll favoriter nerladdade - + Will save data in Sparar data i - + System System - + Audio viewable in system Ljud som visas i systemet - + Auto-play next episode in queue - + Force refresh of old episodes @@ -1021,50 +1051,50 @@ harbour-podqast - + New posts available Nya poster tillgängliga - + Click to view updates Tryck för att visa uppdateringar - + New Posts are available. Click to view. Det finns nya poster. Tryck för att visa. - - + + PodQast message PodQast-meddelande - + New PodQast message Nytt PodQast-meddelande - + Podcasts imported poddar importerade - - + + Podcasts imported from OPML poddar importerade från OPML - + Error Fel - - + + Audio File not existing Ljudfilen finns inte diff --git a/translations/harbour-podqast-zh_CN.ts b/translations/harbour-podqast-zh_CN.ts index 0f9ece3..e513614 100644 --- a/translations/harbour-podqast-zh_CN.ts +++ b/translations/harbour-podqast-zh_CN.ts @@ -761,152 +761,182 @@ + When touching episode image... + + + + + Show Podcast Episodes + + + + Move new post to 移动新内容到 - - + + Inbox 收件箱 - - + + Archive 存档 - + Automatic post limit 自动限制内容 - + Refresh time 刷新时间 - + Audio playrate 音频播放比率 - + off 关闭 - + Time left to ignore for listened-mark - + Download/Streaming 下载流媒体 - + Development 开发 - + Experimental features 实验功能 - - + + Top of Playlist 播放列表顶部 + + + Play Episode + + - + Show Episode Info + + + + + Add To Queue Top + + + + + Add To Queue Bottom + + + + + Bottom of Playlist 播放列表底部 - + All - + s - + Sleep timer 睡眠计时器 - + min 分钟 - + External Audio 外部音频 - + Allow external audio 允许外部音频 - + Will take data from 将会获取数据自 - + Move external audio to 移动外部音频到 - + Download Playlist Posts 下载播放列表内容 - + Download on Mobile 通过移动网络下载 - + Keep Favorites downloaded 保留下载的收藏 - + Will save data in 将会保存数据到 - + System 系统 - + Audio viewable in system 音频在系统可见 - + Auto-play next episode in queue - + Force refresh of old episodes @@ -1019,50 +1049,50 @@ harbour-podqast - + New posts available 有可获取的新内容 - + Click to view updates 点击以查看更新 - + New Posts are available. Click to view. 有可用新内容,点击以查看。 - - + + PodQast message PodQast 消息 - + New PodQast message 新 PodQast 消息 - + Podcasts imported 播客已导入 - - + + Podcasts imported from OPML 已从 OPML 导入播客 - + Error 错误 - - + + Audio File not existing 音频文件不存在 diff --git a/translations/harbour-podqast.ts b/translations/harbour-podqast.ts index 4a59c7a..948c445 100644 --- a/translations/harbour-podqast.ts +++ b/translations/harbour-podqast.ts @@ -761,154 +761,184 @@ + When touching episode image... + + + + + Show Podcast Episodes + + + + Move new post to Move new post to - - + + Inbox Inbox - - + + Archive Archive - + Automatic post limit Automatic post limit - + Refresh time Refresh time - + Audio playrate Audio playrate - + off off - + Time left to ignore for listened-mark - + Download/Streaming Download/Streaming - + Development Development - + Experimental features Experimental features - - + + Top of Playlist Top of Playlist + + + Play Episode + + - + Show Episode Info + + + + + Add To Queue Top + + + + + Add To Queue Bottom + + + + + Bottom of Playlist Bottom of Playlist - + All - + s - + Sleep timer Sleep timer - + min min - + External Audio External Audio - + Allow external audio Allow external audio - + Will take data from Will take data from - + Move external audio to Move external audio to - + Download Playlist Posts Download Playlist Posts - + Download on Mobile Download on Mobile - + Keep Favorites downloaded Keep Favorites downloaded - + Will save data in Will save data in - + System System - + Audio viewable in system Audio viewable in system - + Auto-play next episode in queue - + Force refresh of old episodes @@ -1021,50 +1051,50 @@ harbour-podqast - + New posts available New posts available - + Click to view updates Click to view updates - + New Posts are available. Click to view. New Posts are available. Click to view. - - + + PodQast message PodQast message - + New PodQast message New PodQast message - + Podcasts imported Podcasts imported - - + + Podcasts imported from OPML Podcasts imported from OPML - + Error Error - - + + Audio File not existing Audio File not existing -- GitLab