diff --git a/README.md b/README.md index 4700354ef..34371fbc9 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,14 @@ RSS Guard ### [Discord server](https://discord.gg/7xbVMPPNqH) | [Downloads](https://github.com/martinrotter/rssguard/releases) | [Development builds](https://github.com/martinrotter/rssguard/releases/tag/devbuild) | [Documentation](https://github.com/martinrotter/rssguard/blob/master/resources/docs/Documentation.md) RSS Guard is simple RSS/ATOM feed reader for Windows, Linux, BSD, OS/2 or macOS which can work with RSS/ATOM/JSON feeds and also supports many online feed services: -* [Tiny Tiny RSS](https://tt-rss.org), -* [Inoreader](https://www.inoreader.com) (via Google Reader API plugin), -* [Nextcloud News](https://apps.nextcloud.com/apps/news), +* [Feedly](https://feedly.com), * [Gmail](https://developers.google.com/gmail/api), -* [FreshRSS](https://freshrss.org) (via Google Reader API plugin), -* [The Old Reader](https://theoldreader.com) (via Google Reader API plugin), -* [Bazqux](https://bazqux.com) (via Google Reader API plugin), -* [Reedah](http://reedah.com) (via Google Reader API plugin), -* [Feedly](https://feedly.com). +* Google Reader API ([Bazqux](https://bazqux.com), [FreshRSS](https://freshrss.org), [Inoreader](https://www.inoreader.com), [Reedah](http://reedah.com), [The Old Reader](https://theoldreader.com) and others), +* [Nextcloud News](https://apps.nextcloud.com/apps/news), +* [Tiny Tiny RSS](https://tt-rss.org). ![RSS Guard](resources/docs/videos/rssguard.gif) -Application icon was kindly contributed by Siddharth Yadav - @Siddharth_yd (Instagram), illustrationdesignsid@gmail.com (e-mail). Flag icons were provided by [IconDrawer](http://www.icondrawer.com). +Contributed graphics: +* RSS Guard logo - [Siddharth Yadav](mailto:illustrationdesignsid@gmail.com), [@Siddharth_yd](https://www.instagram.com/siddharth_yd/). +* Flag icons - [IconDrawer](http://www.icondrawer.com). diff --git a/resources/desktop/com.github.rssguard.appdata.xml b/resources/desktop/com.github.rssguard.appdata.xml index fad4d8d1a..9edaf09d6 100644 --- a/resources/desktop/com.github.rssguard.appdata.xml +++ b/resources/desktop/com.github.rssguard.appdata.xml @@ -26,7 +26,7 @@ https://github.com/sponsors/martinrotter - + none diff --git a/src/librssguard/services/gmail/gui/emailpreviewer.cpp b/src/librssguard/services/gmail/gui/emailpreviewer.cpp index 16be2deb8..e9828c14e 100644 --- a/src/librssguard/services/gmail/gui/emailpreviewer.cpp +++ b/src/librssguard/services/gmail/gui/emailpreviewer.cpp @@ -10,6 +10,7 @@ #include "services/gmail/definitions.h" #include "services/gmail/gmailnetworkfactory.h" #include "services/gmail/gmailserviceroot.h" +#include "services/gmail/gui/formaddeditemail.h" #include @@ -29,6 +30,8 @@ EmailPreviewer::EmailPreviewer(GmailServiceRoot* account, QWidget* parent) m_webView->setNavigationBarVisible(false); connect(menu_attachments, &QMenu::triggered, this, &EmailPreviewer::downloadAttachment); + connect(m_ui.m_btnReply, &QToolButton::clicked, this, &EmailPreviewer::replyToEmail); + connect(m_ui.m_btnForward, &QToolButton::clicked, this, &EmailPreviewer::forwardEmail); } EmailPreviewer::~EmailPreviewer() { @@ -60,6 +63,14 @@ void EmailPreviewer::loadMessage(const Message& msg, RootItem* selected_item) { m_ui.m_btnAttachments->setDisabled(m_ui.m_btnAttachments->menu()->isEmpty()); } +void EmailPreviewer::replyToEmail() { + FormAddEditEmail(m_account, window()).execForReply(&m_message); +} + +void EmailPreviewer::forwardEmail() { + FormAddEditEmail(m_account, window()).execForForward(&m_message); +} + void EmailPreviewer::downloadAttachment(QAction* act) { const QString attachment_id = act->data().toStringList().at(1); const QString file_name = act->data().toStringList().at(0); diff --git a/src/librssguard/services/gmail/gui/emailpreviewer.h b/src/librssguard/services/gmail/gui/emailpreviewer.h index b63a5075a..5ccfa1d36 100644 --- a/src/librssguard/services/gmail/gui/emailpreviewer.h +++ b/src/librssguard/services/gmail/gui/emailpreviewer.h @@ -22,6 +22,8 @@ class EmailPreviewer : public CustomMessagePreviewer { virtual void loadMessage(const Message& msg, RootItem* selected_item); private slots: + void replyToEmail(); + void forwardEmail(); void downloadAttachment(QAction* act); private: diff --git a/src/librssguard/services/gmail/gui/formaddeditemail.cpp b/src/librssguard/services/gmail/gui/formaddeditemail.cpp index 0af21ff43..054a2b00d 100644 --- a/src/librssguard/services/gmail/gui/formaddeditemail.cpp +++ b/src/librssguard/services/gmail/gui/formaddeditemail.cpp @@ -54,10 +54,36 @@ void FormAddEditEmail::execForAdd() { void FormAddEditEmail::execForReply(Message* original_message) { m_originalMessage = original_message; - addRecipientRow(m_originalMessage->m_author); m_ui.m_txtSubject->setText(QSL("Re: %1").arg(m_originalMessage->m_title)); m_ui.m_txtSubject->setEnabled(false); m_ui.m_txtMessage->setFocus(); + + addRecipientRow(m_originalMessage->m_author); + exec(); +} + +void FormAddEditEmail::execForForward(Message* original_message) { + m_originalMessage = original_message; + + m_ui.m_txtSubject->setText(QSL("Fwd: %1").arg(m_originalMessage->m_title)); + m_ui.m_txtSubject->setEnabled(false); + m_ui.m_txtMessage->setFocus(); + + // TODO: Obtain "To" header from Gmail API and fill it in too. + const QString forward_header = QSL("
"
+                                     "---------- Forwarded message ---------
" + "From: %1
" + "Date: %2
" + "Subject: %3
" + "To: -" + "

").arg(m_originalMessage->m_author, + m_originalMessage->m_created.toString(), + m_originalMessage->m_title); + + m_ui.m_txtMessage->setHtml(forward_header + m_originalMessage->m_contents); + m_ui.m_txtMessage->moveCursor(QTextCursor::MoveOperation::Start); + + addRecipientRow()->setFocus(); exec(); } diff --git a/src/librssguard/services/gmail/gui/formaddeditemail.h b/src/librssguard/services/gmail/gui/formaddeditemail.h index 7c45dfb1b..1eed7e412 100644 --- a/src/librssguard/services/gmail/gui/formaddeditemail.h +++ b/src/librssguard/services/gmail/gui/formaddeditemail.h @@ -24,6 +24,7 @@ class FormAddEditEmail : public QDialog { public slots: void execForAdd(); void execForReply(Message* original_message); + void execForForward(Message* original_message); private slots: void removeRecipientRow();