From 2e1c5e9d0a4c48f4036785b45783e27539f436d0 Mon Sep 17 00:00:00 2001 From: univrsal Date: Wed, 18 Sep 2019 04:29:37 +0200 Subject: [PATCH 1/2] added option to postpone auto updates, if window is focused --- .../gui/settings/settingsfeedsmessages.cpp | 3 +++ .../gui/settings/settingsfeedsmessages.ui | 17 ++++++++++++----- src/librssguard/miscellaneous/feedreader.cpp | 9 +++++++++ src/librssguard/miscellaneous/feedreader.h | 1 + src/librssguard/miscellaneous/settings.cpp | 4 ++++ src/librssguard/miscellaneous/settings.h | 4 ++++ 6 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/librssguard/gui/settings/settingsfeedsmessages.cpp b/src/librssguard/gui/settings/settingsfeedsmessages.cpp index b7a415dd0..d9fb905bc 100644 --- a/src/librssguard/gui/settings/settingsfeedsmessages.cpp +++ b/src/librssguard/gui/settings/settingsfeedsmessages.cpp @@ -37,6 +37,7 @@ SettingsFeedsMessages::SettingsFeedsMessages(Settings* settings, QWidget* parent connect(m_ui->m_checkAutoUpdateNotification, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings); connect(m_ui->m_checkAutoUpdate, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings); + connect(m_ui->m_checkAutoUpdateOnlyUnfocused, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings); connect(m_ui->m_checkKeppMessagesInTheMiddle, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings); connect(m_ui->m_checkMessagesDateTimeFormat, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings); connect(m_ui->m_checkRemoveReadMessagesOnExit, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings); @@ -121,6 +122,7 @@ void SettingsFeedsMessages::loadSettings() { m_ui->m_checkKeppMessagesInTheMiddle->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::KeepCursorInCenter)).toBool()); m_ui->m_checkRemoveReadMessagesOnExit->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::ClearReadOnExit)).toBool()); m_ui->m_checkAutoUpdate->setChecked(settings()->value(GROUP(Feeds), SETTING(Feeds::AutoUpdateEnabled)).toBool()); + m_ui->m_checkAutoUpdateOnlyUnfocused->setChecked(settings()->value(GROUP(Feeds), SETTING(Feeds::AutoUpdateOnlyUnfocused)).toBool()); m_ui->m_spinAutoUpdateInterval->setValue(settings()->value(GROUP(Feeds), SETTING(Feeds::AutoUpdateInterval)).toInt()); m_ui->m_spinFeedUpdateTimeout->setValue(settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt()); m_ui->m_checkUpdateAllFeedsOnStartup->setChecked(settings()->value(GROUP(Feeds), SETTING(Feeds::FeedsUpdateOnStartup)).toBool()); @@ -175,6 +177,7 @@ void SettingsFeedsMessages::saveSettings() { settings()->setValue(GROUP(Messages), Messages::KeepCursorInCenter, m_ui->m_checkKeppMessagesInTheMiddle->isChecked()); settings()->setValue(GROUP(Messages), Messages::ClearReadOnExit, m_ui->m_checkRemoveReadMessagesOnExit->isChecked()); settings()->setValue(GROUP(Feeds), Feeds::AutoUpdateEnabled, m_ui->m_checkAutoUpdate->isChecked()); + settings()->setValue(GROUP(Feeds), Feeds::AutoUpdateOnlyUnfocused, m_ui->m_checkAutoUpdateOnlyUnfocused->isChecked()); settings()->setValue(GROUP(Feeds), Feeds::AutoUpdateInterval, m_ui->m_spinAutoUpdateInterval->value()); settings()->setValue(GROUP(Feeds), Feeds::UpdateTimeout, m_ui->m_spinFeedUpdateTimeout->value()); settings()->setValue(GROUP(Feeds), Feeds::FeedsUpdateOnStartup, m_ui->m_checkUpdateAllFeedsOnStartup->isChecked()); diff --git a/src/librssguard/gui/settings/settingsfeedsmessages.ui b/src/librssguard/gui/settings/settingsfeedsmessages.ui index 4ad29c6d0..0da3ec6d0 100644 --- a/src/librssguard/gui/settings/settingsfeedsmessages.ui +++ b/src/librssguard/gui/settings/settingsfeedsmessages.ui @@ -77,7 +77,7 @@ - + Feed list font @@ -100,7 +100,7 @@ - + @@ -133,7 +133,7 @@ - + @@ -157,7 +157,7 @@ - + @@ -181,7 +181,7 @@ - + @@ -199,6 +199,13 @@ + + + + Only update when application is unfocused + + + diff --git a/src/librssguard/miscellaneous/feedreader.cpp b/src/librssguard/miscellaneous/feedreader.cpp index c794ec4bc..592987343 100644 --- a/src/librssguard/miscellaneous/feedreader.cpp +++ b/src/librssguard/miscellaneous/feedreader.cpp @@ -88,6 +88,7 @@ void FeedReader::updateAutoUpdateStatus() { m_globalAutoUpdateInitialInterval = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::AutoUpdateInterval)).toInt(); m_globalAutoUpdateRemainingInterval = m_globalAutoUpdateInitialInterval; m_globalAutoUpdateEnabled = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::AutoUpdateEnabled)).toBool(); + m_globalAutoUpdateOnlyUnfocused = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::AutoUpdateOnlyUnfocused)).toBool(); // Start global auto-update timer if it is not running yet. // NOTE: The timer must run even if global auto-update @@ -144,6 +145,14 @@ MessagesModel* FeedReader::messagesModel() const { } void FeedReader::executeNextAutoUpdate() { + if (qApp->mainFormWidget()->isActiveWindow() && m_globalAutoUpdateOnlyUnfocused) { + qDebug("Delaying scheduled feed auto-update for one minute since window is focused and updates" + "while focused are disabled by the user."); + + // Cannot update, quit. + return; + } + if (!qApp->feedUpdateLock()->tryLock()) { qDebug("Delaying scheduled feed auto-updates for one minute due to another running update."); diff --git a/src/librssguard/miscellaneous/feedreader.h b/src/librssguard/miscellaneous/feedreader.h index 16b1bb763..ae7303a95 100644 --- a/src/librssguard/miscellaneous/feedreader.h +++ b/src/librssguard/miscellaneous/feedreader.h @@ -79,6 +79,7 @@ class RSSGUARD_DLLSPEC FeedReader : public QObject { // Auto-update stuff. QTimer* m_autoUpdateTimer; bool m_globalAutoUpdateEnabled{}; + bool m_globalAutoUpdateOnlyUnfocused{}; int m_globalAutoUpdateInitialInterval{}; int m_globalAutoUpdateRemainingInterval{}; FeedDownloader* m_feedDownloader; diff --git a/src/librssguard/miscellaneous/settings.cpp b/src/librssguard/miscellaneous/settings.cpp index 830c2fd6a..1fe17cc32 100644 --- a/src/librssguard/miscellaneous/settings.cpp +++ b/src/librssguard/miscellaneous/settings.cpp @@ -47,6 +47,10 @@ DKEY Feeds::AutoUpdateEnabled = "auto_update_enabled"; DVALUE(bool) Feeds::AutoUpdateEnabledDef = false; +DKEY Feeds::AutoUpdateOnlyUnfocused = "auto_update_only_unfocused"; + +DVALUE(bool) Feeds::AutoUpdateOnlyUnfocusedDef = false; + DKEY Feeds::FeedsUpdateOnStartup = "feeds_update_on_startup"; DVALUE(bool) Feeds::FeedsUpdateOnStartupDef = false; diff --git a/src/librssguard/miscellaneous/settings.h b/src/librssguard/miscellaneous/settings.h index 536281270..1165e8595 100644 --- a/src/librssguard/miscellaneous/settings.h +++ b/src/librssguard/miscellaneous/settings.h @@ -68,6 +68,10 @@ namespace Feeds { VALUE(bool) AutoUpdateEnabledDef; + KEY AutoUpdateOnlyUnfocused; + + VALUE(bool) AutoUpdateOnlyUnfocusedDef; + KEY FeedsUpdateOnStartup; VALUE(bool) FeedsUpdateOnStartupDef; From ce810d28538c988e7290e397a94ac6312d8297ed Mon Sep 17 00:00:00 2001 From: univrsal Date: Wed, 18 Sep 2019 04:58:55 +0200 Subject: [PATCH 2/2] updated translation --- localization/rssguard_de.ts | 306 ++++++++++++++++-- localization/rssguard_en.ts | 202 +++++++++++- .../gui/settings/settingsfeedsmessages.ui | 2 +- 3 files changed, 479 insertions(+), 31 deletions(-) diff --git a/localization/rssguard_de.ts b/localization/rssguard_de.ts index 8e5a5cbf2..72e59d092 100644 --- a/localization/rssguard_de.ts +++ b/localization/rssguard_de.ts @@ -1,4 +1,6 @@ - + + + AccountCheckModel @@ -279,9 +281,12 @@ Click me to add feeds from this website. This website contains %n feed(s). - Zum Hinzufügen der Feeds auf dieser Webseite hier klicken. -Diese Webseite enhält %n Feed.Zum Hinzufügen der Feeds auf dieser Webseite hier klicken. -Diese Webseite enhält %n Feeds. + + Zum Hinzufügen der Feeds auf dieser Webseite hier klicken. +Diese Webseite enhält %n Feed. + Zum Hinzufügen der Feeds auf dieser Webseite hier klicken. +Diese Webseite enhält %n Feeds. + Not supported @@ -367,7 +372,7 @@ Diese Webseite enhält %n Feeds. Herunterladen abgeschlossen - File '%1' is downloaded. + File '%1' is downloaded. Click here to open parent directory. Datei '%1' wurde heruntergeladen. Zum Öffnen des übergeordneten Verzeichnisses hier klicken. @@ -392,11 +397,17 @@ Click here to open parent directory. %n minutes remaining - % Minute verbleibend%n Minuten verbleibend + + % Minute verbleibend + %n Minuten verbleibend + %n seconds remaining - %n Sekunde verbleibend%n Sekunden verbleibend + + %n Sekunde verbleibend + %n Sekunden verbleibend + bytes @@ -416,7 +427,29 @@ Click here to open parent directory. Downloading %n file(s)... - Lade %n Datei herunter...Lade %n Dateien herunter... + + Lade %n Datei herunter... + Lade %n Dateien herunter... + + + + + EmailRecipientControl + + To + + + + Cc + + + + Bcc + + + + Reply-to + @@ -429,12 +462,18 @@ Click here to open parent directory. uses global settings (%n minute(s) to next auto-update) Describes feed auto-update status. - verwendet globale Einstellungen (noch %n Minute(n) bis zur nächsten Auto-Aktualisierung)verwendet globale Einstellungen (noch %n Minute(n) bis zur nächsten Auto-Aktualisierung) + + verwendet globale Einstellungen (noch %n Minute(n) bis zur nächsten Auto-Aktualisierung) + verwendet globale Einstellungen (noch %n Minute(n) bis zur nächsten Auto-Aktualisierung) + uses specific settings (%n minute(s) to next auto-update) Describes feed auto-update status. - verwendet individuelle Einstellungen (noch %n Minute(n) bis zur nächsten Auto-Aktualisierung)verwendet individuelle Einstellungen (noch %n Minute(n) bis zur nächsten Auto-Aktualisierung) + + verwendet individuelle Einstellungen (noch %n Minute(n) bis zur nächsten Auto-Aktualisierung) + verwendet individuelle Einstellungen (noch %n Minute(n) bis zur nächsten Auto-Aktualisierung) + no errors @@ -490,7 +529,10 @@ Status: %2 I will auto-update %n feed(s). - 1 Feed wird automatisch aktualisiert.%n Feeds werden automatisch aktualisiert. + + 1 Feed wird automatisch aktualisiert. + %n Feeds werden automatisch aktualisiert. + @@ -712,7 +754,31 @@ or this functionality is not implemented yet. FormAddEditEmail Dialog - Dialog + Dialog + + + Write e-mail message + + + + From + + + + Name and address of this e-mail message sender + + + + Contents of your e-mail message + + + + ... + + + + Add new recipient. + @@ -802,7 +868,10 @@ or this functionality is not implemented yet. day(s) - Tag Tage + + Tag + Tage + Shrink database file @@ -1506,6 +1575,159 @@ or this functionality is not implemented yet. The URL is empty. Der URL ist leer. + + The URL does not meet standard pattern. Does your URL start with "http://" or "https://" prefix. + + + + Username is ok or it is not needed. + Benutzername ist in Ordnung oder wird nicht benötigt. + + + Username is empty. + Benutzername ist leer. + + + Password is ok or it is not needed. + Passwort ist in Ordnung oder wird nicht benötigt. + + + Password is empty. + Passwort ist leer. + + + Select icon file for the feed + + + + Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga) + Graphiken (*.bmp *.jpg *.jpeg *.png *.svg *.tga) + + + Select icon + Icon auswählen + + + Cancel + Abbrechen + + + Look in: + Label for field with icon file name textbox for selection dialog. + Suchen in: + + + Icon name: + Icon-Name: + + + Icon type: + Icon-Typ: + + + All metadata fetched successfully. + + + + Feed and icon metadata fetched. + + + + Result: %1. + + + + Feed or icon metadata not fetched. + + + + Error: %1. + Fehler: %1. + + + No metadata fetched. + + + + Icon fetched successfully. + + + + Icon metadata fetched. + + + + Icon metadata not fetched. + + + + No icon fetched. + + + + Feed title + + + + Set title for your feed. + + + + Feed description + + + + Set description for your feed. + + + + Full feed url including scheme + + + + Set url for your feed. + + + + Set username to access the feed. + + + + Set password to access the feed. + + + + Icon selection + Auswahl des Icons + + + Load icon from file... + Icon aus Datei laden... + + + Use default icon from icon theme + + + + Fetch icon from feed + + + + No metadata fetched so far. + + + + Auto-update using global interval + + + + Auto-update every + + + + Do not auto-update at all + + FormMain @@ -1904,7 +2126,7 @@ or this functionality is not implemented yet. &Donate... - + @@ -2143,7 +2365,7 @@ Dieser Neustart muss manuell ausgeführt werden. Use default icon from icon theme - + @@ -2289,11 +2511,11 @@ Dieser Neustart muss manuell ausgeführt werden. &Export to file - + &Import from file - + @@ -2948,7 +3170,10 @@ Ablauf des Login tokens: %2 Show more messages (%n remaining) - Weitere Nachrichten anzeigen (%n verbleibend)Weitere Nachrichten anzeigen (%n verbleibend) + + Weitere Nachrichten anzeigen (%n verbleibend) + Weitere Nachrichten anzeigen (%n verbleibend) + Cannot show more messages @@ -3031,7 +3256,10 @@ Ablauf des Login tokens: %2 + %n other feeds. - + %n anderer Feed.+ %n andere Feeds. + + + %n anderer Feed. + + %n andere Feeds. + Load initial set of feeds @@ -3095,7 +3323,10 @@ Das API muss mindestens in Stufe %1 verfügbar sein. %n deleted message(s). - %n gelöschte Nachricht.%n gelöschte Nachrichten. + + %n gelöschte Nachricht. + %n gelöschte Nachrichten. + Restore recycle bin @@ -3111,7 +3342,10 @@ Das API muss mindestens in Stufe %1 verfügbar sein. %n unread message(s). Tooltip for "unread" column of feed list. - %n ungelesene Nachricht.%n ungelesene Nachrichten. + + %n ungelesene Nachricht. + %n ungelesene Nachrichten. + @@ -3597,23 +3831,27 @@ Die Autoren dieser Anwendung sind NICHT für Datenverlust verantwortlich. Feed list font - + Display placeholders to indicate locations of pictures - + Message list font - + Internal message browser font - + Select new font - + + + + Only auto-update when application is unfocused + Nur automatisch Updaten, wenn RSS Guard nicht fokusiert ist @@ -3818,6 +4056,10 @@ Die Autoren dieser Anwendung sind NICHT für Datenverlust verantwortlich.This page was blocked by AdBlock Diese Seite wurde durch AdBlock blockiert + + Blocked by set: "%1"<br/>Blocked by filter: "%2" + + StandardFeed @@ -3984,11 +4226,17 @@ Ungelesene Nachrichten: %2 TimeSpinBox %n hour(s) - %n Stunde%n Stunden + + %n Stunde + %n Stunden + %n minute(s) - %n Minute%n Minuten + + %n Minute + %n Minuten + and @@ -4236,4 +4484,4 @@ Letzte Anmeldung am: %4 In externem Browser öffnen - \ No newline at end of file + diff --git a/localization/rssguard_en.ts b/localization/rssguard_en.ts index 3bc6e809b..1965398e3 100644 --- a/localization/rssguard_en.ts +++ b/localization/rssguard_en.ts @@ -433,6 +433,25 @@ Click here to open parent directory. + + EmailRecipientControl + + To + + + + Cc + + + + Bcc + + + + Reply-to + + + Feed @@ -734,7 +753,27 @@ or this functionality is not implemented yet. FormAddEditEmail - Dialog + Write e-mail message + + + + From + + + + Name and address of this e-mail message sender + + + + Contents of your e-mail message + + + + ... + + + + Add new recipient. @@ -1532,6 +1571,159 @@ or this functionality is not implemented yet. The URL is empty. The URL is empty. + + The URL does not meet standard pattern. Does your URL start with "http://" or "https://" prefix. + + + + Username is ok or it is not needed. + Username is ok or it is not needed. + + + Username is empty. + Username is empty. + + + Password is ok or it is not needed. + Password is ok or it is not needed. + + + Password is empty. + Password is empty. + + + Select icon file for the feed + + + + Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga) + Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga) + + + Select icon + Select icon + + + Cancel + Cancel + + + Look in: + Label for field with icon file name textbox for selection dialog. + Look in: + + + Icon name: + Icon name: + + + Icon type: + Icon type: + + + All metadata fetched successfully. + + + + Feed and icon metadata fetched. + + + + Result: %1. + + + + Feed or icon metadata not fetched. + + + + Error: %1. + Error: %1. + + + No metadata fetched. + + + + Icon fetched successfully. + + + + Icon metadata fetched. + + + + Icon metadata not fetched. + + + + No icon fetched. + + + + Feed title + + + + Set title for your feed. + + + + Feed description + + + + Set description for your feed. + + + + Full feed url including scheme + + + + Set url for your feed. + + + + Set username to access the feed. + + + + Set password to access the feed. + + + + Icon selection + Icon selection + + + Load icon from file... + Load icon from file... + + + Use default icon from icon theme + + + + Fetch icon from feed + + + + No metadata fetched so far. + + + + Auto-update using global interval + + + + Auto-update every + + + + Do not auto-update at all + + FormMain @@ -3562,6 +3754,10 @@ Authors of this application are NOT responsible for lost data. Auto-update all feeds every Auto-update all feeds every + + Only auto-update when application is unfocused + Only auto-update when application is unfocused + Feed connection timeout Feed connection timeout @@ -3849,6 +4045,10 @@ Authors of this application are NOT responsible for lost data. This page was blocked by AdBlock + + Blocked by set: "%1"<br/>Blocked by filter: "%2" + + StandardFeed diff --git a/src/librssguard/gui/settings/settingsfeedsmessages.ui b/src/librssguard/gui/settings/settingsfeedsmessages.ui index 0da3ec6d0..9488a540c 100644 --- a/src/librssguard/gui/settings/settingsfeedsmessages.ui +++ b/src/librssguard/gui/settings/settingsfeedsmessages.ui @@ -202,7 +202,7 @@ - Only update when application is unfocused + Only auto-update when application is unfocused