From 79c81fb5ac4b74ae4c6baa99d1e628a0a5684579 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Fri, 1 Dec 2023 08:17:00 +0100 Subject: [PATCH] docs update --- README.md | 2 ++ docs/source/features/browseradblock.md | 5 +---- docs/source/features/userdata.md | 1 + docs/source/index.rst | 1 + docs/source/what.md | 4 +++- src/librssguard/gui/dialogs/formmain.cpp | 16 ++++++++++++++++ src/librssguard/gui/dialogs/formmain.ui | 6 ++++++ src/librssguard/gui/messagesview.cpp | 22 ++++++++++++++++++++++ src/librssguard/gui/messagesview.h | 10 +++++++++- src/librssguard/gui/tabwidget.cpp | 3 +++ 10 files changed, 64 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b12adecc1..6af312076 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ RSS Guard is a simple RSS/ATOM feed reader for Windows, Linux, BSD, OS/2 or macO * [Nextcloud News](https://apps.nextcloud.com/apps/news) * [Tiny Tiny RSS](https://tt-rss.org) +RSS Guard is also podcast player as it can play everything via its built-in `mpv-based` media player. + ![RSS Guard](resources/graphics/official_pictures/main-window-linux.png) ## Contributing to RSS Guard diff --git a/docs/source/features/browseradblock.md b/docs/source/features/browseradblock.md index fa4487656..7acfc0804 100644 --- a/docs/source/features/browseradblock.md +++ b/docs/source/features/browseradblock.md @@ -1,9 +1,6 @@ Built-in Web Browser & AdBlock ============================== -RSS Guard is distributed in two variants: -* **Standard package with WebEngine-based bundled article viewer**: This variant displays articles with their full formatting and layout in embedded Chromium-based web browser. This variant of RSS Guard should be okay for everyone. Also, installation packages are relatively big. - -* **Lite package with simple text-based article viewer**: This variant displays article in a much simpler and much more lightweight web viewer component. All packages of this variant have `lite` keyword in their names. This flavor of RSS Guard does NOT have a JavaScript support and is meant for people who value their privacy. +Web browser capabilities differ depending on which RSS Guard [flavor](../variants) you install. ## AdBlock Both variants of RSS Guard offer ad-blocking functionality via [Adblocker](https://github.com/cliqz-oss/adblocker). Adblocker offers similar performance to [uBlock Origin](https://github.com/gorhill/uBlock). diff --git a/docs/source/features/userdata.md b/docs/source/features/userdata.md index 4fdb8909e..98b645bf7 100644 --- a/docs/source/features/userdata.md +++ b/docs/source/features/userdata.md @@ -16,6 +16,7 @@ User data folder can store your custom icon themes in `icons` subfolder, and cus ## `%data%` placeholder RSS Guard stores its data and settings in a single folder. How to find out the exact path, see here. RSS Guard allows using the folder programmatically in some special contexts via `%data%` placeholder. You can use this placeholder in following contexts: * Contents of your [article filters](filters) - you can, therefore, place some scripts under your user data folder and include them via JavaScript into your article filter. +* Path to your custom configuration directory for `libmpv`-based [media player](mediaplayer). * Contents of each file included in your custom [skins](skins). Note that in this case, the semantics of `%data%` are little changed and `%data%` points directly to base folder of your skin. * `source` and `post-process script` attributes for feed [scraping](scraping) - you can use the placeholder to load scripts to generate/process the feed from user's data folder. * [Notifications](notifications) also support the placeholder in path to audio files which are to be played when some event happens. For example, you could place audio files in your data folder and then use them in a notification with `%data%\audio\new-messages.wav`. See more about notifications. \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index 32c0e0e3e..2b6e15d53 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -8,6 +8,7 @@ RSS Guards Documentation! donations downloads supported-os + variants supported-readers .. toctree:: diff --git a/docs/source/what.md b/docs/source/what.md index aa7aff41b..916b034e3 100644 --- a/docs/source/what.md +++ b/docs/source/what.md @@ -1,3 +1,5 @@ What is RSS Guard? ================== -RSS Guard is an [open-source](https://en.wikipedia.org/wiki/Open_source) [cross-platform](#supported-os) [multi-protocol](#supported-readers) desktop feed reader. It is able to fetch feeds in RSS/RDF/ATOM/JSON formats and connect to multiple web-based feed readers. RSS Guard is developed on top of the [Qt library](http://qt-project.org). \ No newline at end of file +RSS Guard is an [open-source](https://en.wikipedia.org/wiki/Open_source) [cross-platform](#supported-os) [multi-protocol](#supported-readers) desktop feed reader and podcast [player](features/mediaplayer). It is able to fetch feeds in RSS/RDF/ATOM/JSON formats and connect to multiple web-based feed readers. It is also able to play most audio/video formats. + +RSS Guard is developed on top of the [Qt library](http://qt-project.org). \ No newline at end of file diff --git a/src/librssguard/gui/dialogs/formmain.cpp b/src/librssguard/gui/dialogs/formmain.cpp index b1939f94a..e10440adb 100644 --- a/src/librssguard/gui/dialogs/formmain.cpp +++ b/src/librssguard/gui/dialogs/formmain.cpp @@ -186,6 +186,7 @@ QList FormMain::allActions() const { actions << m_ui->m_actionSendMessageViaEmail; actions << m_ui->m_actionOpenSelectedSourceArticlesExternally; actions << m_ui->m_actionOpenSelectedMessagesInternally; + actions << m_ui->m_actionPlaySelectedArticlesInMediaPlayer; actions << m_ui->m_actionOpenSelectedMessagesInternallyNoTab; actions << m_ui->m_actionAlternateColorsInLists; actions << m_ui->m_actionMessagePreviewEnabled; @@ -465,6 +466,15 @@ void FormMain::updateMessageButtonsAvailability() { m_ui->m_actionMarkSelectedMessagesAsRead->setEnabled(atleast_one_message_selected); m_ui->m_actionMarkSelectedMessagesAsUnread->setEnabled(atleast_one_message_selected); m_ui->m_actionOpenSelectedMessagesInternallyNoTab->setEnabled(one_message_selected); + +#if !defined(ENABLE_MEDIAPLAYER) + m_ui->m_actionPlaySelectedArticlesInMediaPlayer->setText(tr("Play in media player") + QSL(" ") + + tr("(not supported)")); + m_ui->m_actionPlaySelectedArticlesInMediaPlayer->setEnabled(false); +#else + m_ui->m_actionPlaySelectedArticlesInMediaPlayer->setEnabled(one_message_selected); +#endif + m_ui->m_actionOpenSelectedMessagesInternally->setEnabled(one_message_selected); m_ui->m_actionOpenSelectedSourceArticlesExternally->setEnabled(atleast_one_message_selected); m_ui->m_actionCopyUrlSelectedArticles->setEnabled(atleast_one_message_selected); @@ -608,6 +618,8 @@ void FormMain::setupIcons() { m_ui->m_actionSwitchImportanceOfSelectedMessages->setIcon(icon_theme_factory->fromTheme(QSL("mail-mark-important"))); m_ui->m_actionOpenSelectedSourceArticlesExternally->setIcon(icon_theme_factory->fromTheme(QSL("document-open"))); m_ui->m_actionOpenSelectedMessagesInternally->setIcon(icon_theme_factory->fromTheme(QSL("document-open"))); + m_ui->m_actionPlaySelectedArticlesInMediaPlayer->setIcon(icon_theme_factory->fromTheme(QSL("player_play"), + QSL("media-playback-start"))); m_ui->m_actionOpenSelectedMessagesInternallyNoTab->setIcon(icon_theme_factory->fromTheme(QSL("document-open"))); m_ui->m_actionSendMessageViaEmail->setIcon(icon_theme_factory->fromTheme(QSL("mail-send"))); m_ui->m_actionSelectNextItem->setIcon(icon_theme_factory->fromTheme(QSL("arrow-down"))); @@ -856,6 +868,10 @@ void FormMain::createConnections() { &QAction::triggered, tabWidget()->feedMessageViewer()->messagesView(), &MessagesView::openSelectedSourceMessagesExternally); + connect(m_ui->m_actionOpenSelectedSourceArticlesExternally, + &QAction::triggered, + tabWidget()->feedMessageViewer()->messagesView(), + &MessagesView::playSelectedArticleInMediaPlayer); connect(m_ui->m_actionOpenSelectedMessagesInternally, &QAction::triggered, tabWidget()->feedMessageViewer()->messagesView(), diff --git a/src/librssguard/gui/dialogs/formmain.ui b/src/librssguard/gui/dialogs/formmain.ui index d26d331b5..4d3714291 100644 --- a/src/librssguard/gui/dialogs/formmain.ui +++ b/src/librssguard/gui/dialogs/formmain.ui @@ -161,6 +161,7 @@ + @@ -945,6 +946,11 @@ Edit child feeds (&recursive) + + + Play in &media player + + diff --git a/src/librssguard/gui/messagesview.cpp b/src/librssguard/gui/messagesview.cpp index 87bf6e296..83ea42aa9 100644 --- a/src/librssguard/gui/messagesview.cpp +++ b/src/librssguard/gui/messagesview.cpp @@ -466,6 +466,7 @@ void MessagesView::initializeContextMenu() { << qApp->mainForm()->m_ui->m_actionOpenSelectedSourceArticlesExternally << qApp->mainForm()->m_ui->m_actionOpenSelectedMessagesInternally << qApp->mainForm()->m_ui->m_actionOpenSelectedMessagesInternallyNoTab + << qApp->mainForm()->m_ui->m_actionPlaySelectedArticlesInMediaPlayer << qApp->mainForm()->m_ui->m_actionCopyUrlSelectedArticles << qApp->mainForm()->m_ui->m_actionMarkSelectedMessagesAsRead << qApp->mainForm()->m_ui->m_actionMarkSelectedMessagesAsUnread @@ -633,6 +634,27 @@ void MessagesView::openSelectedSourceMessagesExternally() { } } +#if defined(ENABLE_MEDIAPLAYER) +void MessagesView::playSelectedArticleInMediaPlayer() { + auto rws = selectionModel()->selectedRows(); + + if (!rws.isEmpty()) { + auto msg = m_sourceModel->messageAt(m_proxyModel->mapToSource(rws.first()).row()); + + if (msg.m_url.isEmpty()) { + qApp->showGuiMessage(Notification::Event::GeneralEvent, + GuiMessage(tr("No URL"), + tr("Article cannot be played in media player as it has no URL"), + QSystemTrayIcon::MessageIcon::Warning), + GuiMessageDestination(true, true)); + } + else { + emit playLinkInMediaPlayer(msg.m_url); + } + } +} +#endif + void MessagesView::openSelectedMessagesInternally() { auto rws = selectionModel()->selectedRows(); diff --git a/src/librssguard/gui/messagesview.h b/src/librssguard/gui/messagesview.h index 0344f0c0d..a15205785 100644 --- a/src/librssguard/gui/messagesview.h +++ b/src/librssguard/gui/messagesview.h @@ -41,7 +41,11 @@ class MessagesView : public BaseTreeView { // Loads un-deleted messages from selected feeds. void loadItem(RootItem* item); - // Message manipulators. +// Message manipulators. +#if defined(ENABLE_MEDIAPLAYER) + void playSelectedArticleInMediaPlayer(); +#endif + void openSelectedSourceMessagesExternally(); void openSelectedMessagesInternally(); void openSelectedMessageUrl(); @@ -83,6 +87,10 @@ class MessagesView : public BaseTreeView { void onSortIndicatorChanged(int column, Qt::SortOrder order); signals: +#if defined(ENABLE_MEDIAPLAYER) + void playLinkInMediaPlayer(const QString& link); +#endif + void openLinkNewTab(const QString& link); void openLinkMiniBrowser(const QString& link); void openSingleMessageInNewTab(RootItem* root, const Message& message); diff --git a/src/librssguard/gui/tabwidget.cpp b/src/librssguard/gui/tabwidget.cpp index 5cd3db648..1dd16d42b 100644 --- a/src/librssguard/gui/tabwidget.cpp +++ b/src/librssguard/gui/tabwidget.cpp @@ -130,6 +130,9 @@ void TabWidget::createConnections() { &MessagesView::openSingleMessageInNewTab, this, &TabWidget::addSingleMessageView); + connect(feedMessageViewer()->messagesView(), &MessagesView::playLinkInMediaPlayer, this, [this](const QString& url) { + addMediaPlayer(url, true); + }); } void TabWidget::initializeTabs() {