fix notifications enabled/disabled
This commit is contained in:
parent
50e1d79c42
commit
ab1011bebc
|
@ -38,7 +38,6 @@ SettingsFeedsMessages::SettingsFeedsMessages(Settings* settings, QWidget* parent
|
||||||
this, &SettingsFeedsMessages::requireRestart);
|
this, &SettingsFeedsMessages::requireRestart);
|
||||||
|
|
||||||
connect(m_ui->m_cbHideCountsIfNoUnread, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
connect(m_ui->m_cbHideCountsIfNoUnread, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
||||||
connect(m_ui->m_checkAutoUpdateNotification, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
|
||||||
connect(m_ui->m_checkAutoUpdate, &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_checkAutoUpdateOnlyUnfocused, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
||||||
connect(m_ui->m_checkDisplayFeedIcons, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
connect(m_ui->m_checkDisplayFeedIcons, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
||||||
|
@ -133,7 +132,6 @@ void SettingsFeedsMessages::loadSettings() {
|
||||||
m_ui->m_checkDisplayFeedIcons->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::DisplayFeedIconsInList)).toBool());
|
m_ui->m_checkDisplayFeedIcons->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::DisplayFeedIconsInList)).toBool());
|
||||||
m_ui->m_checkBringToForegroundAfterMsgOpened->setChecked(settings()->value(GROUP(Messages),
|
m_ui->m_checkBringToForegroundAfterMsgOpened->setChecked(settings()->value(GROUP(Messages),
|
||||||
SETTING(Messages::BringAppToFrontAfterMessageOpenedExternally)).toBool());
|
SETTING(Messages::BringAppToFrontAfterMessageOpenedExternally)).toBool());
|
||||||
m_ui->m_checkAutoUpdateNotification->setChecked(settings()->value(GROUP(Feeds), SETTING(Feeds::EnableAutoUpdateNotification)).toBool());
|
|
||||||
m_ui->m_checkKeppMessagesInTheMiddle->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::KeepCursorInCenter)).toBool());
|
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_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_checkAutoUpdate->setChecked(settings()->value(GROUP(Feeds), SETTING(Feeds::AutoUpdateEnabled)).toBool());
|
||||||
|
@ -194,7 +192,6 @@ void SettingsFeedsMessages::saveSettings() {
|
||||||
settings()->setValue(GROUP(Messages), Messages::DisplayFeedIconsInList, m_ui->m_checkDisplayFeedIcons->isChecked());
|
settings()->setValue(GROUP(Messages), Messages::DisplayFeedIconsInList, m_ui->m_checkDisplayFeedIcons->isChecked());
|
||||||
settings()->setValue(GROUP(Messages), Messages::BringAppToFrontAfterMessageOpenedExternally,
|
settings()->setValue(GROUP(Messages), Messages::BringAppToFrontAfterMessageOpenedExternally,
|
||||||
m_ui->m_checkBringToForegroundAfterMsgOpened->isChecked());
|
m_ui->m_checkBringToForegroundAfterMsgOpened->isChecked());
|
||||||
settings()->setValue(GROUP(Feeds), Feeds::EnableAutoUpdateNotification, m_ui->m_checkAutoUpdateNotification->isChecked());
|
|
||||||
settings()->setValue(GROUP(Messages), Messages::KeepCursorInCenter, m_ui->m_checkKeppMessagesInTheMiddle->isChecked());
|
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(Messages), Messages::ClearReadOnExit, m_ui->m_checkRemoveReadMessagesOnExit->isChecked());
|
||||||
settings()->setValue(GROUP(Feeds), Feeds::AutoUpdateEnabled, m_ui->m_checkAutoUpdate->isChecked());
|
settings()->setValue(GROUP(Feeds), Feeds::AutoUpdateEnabled, m_ui->m_checkAutoUpdate->isChecked());
|
||||||
|
|
|
@ -73,7 +73,14 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="m_checkAutoUpdateOnlyUnfocused">
|
||||||
|
<property name="text">
|
||||||
|
<string>Only auto-download messages when application is unfocused</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
<widget class="QGroupBox" name="groupBox_6">
|
<widget class="QGroupBox" name="groupBox_6">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||||
|
@ -105,7 +112,17 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Feed connection timeout</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>m_spinFeedUpdateTimeout</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
<widget class="QSpinBox" name="m_spinFeedUpdateTimeout">
|
<widget class="QSpinBox" name="m_spinFeedUpdateTimeout">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Connection timeout is time interval which is reserved for downloading new messages for the feed. If this time interval elapses, then download process is aborted.</string>
|
<string>Connection timeout is time interval which is reserved for downloading new messages for the feed. If this time interval elapses, then download process is aborted.</string>
|
||||||
|
@ -124,7 +141,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Height or rows in feed list (-1 = default height)</string>
|
<string>Height or rows in feed list (-1 = default height)</string>
|
||||||
|
@ -134,7 +151,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QSpinBox" name="m_spinHeightRowsFeeds">
|
<widget class="QSpinBox" name="m_spinHeightRowsFeeds">
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>-1</number>
|
<number>-1</number>
|
||||||
|
@ -144,7 +161,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
<item row="6" column="0">
|
||||||
<widget class="QLabel" name="label_8">
|
<widget class="QLabel" name="label_8">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Message count format in feed list</string>
|
<string>Message count format in feed list</string>
|
||||||
|
@ -154,7 +171,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="1">
|
<item row="6" column="1">
|
||||||
<widget class="QComboBox" name="m_cmbCountsFeedList">
|
<widget class="QComboBox" name="m_cmbCountsFeedList">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
|
@ -164,7 +181,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0" colspan="2">
|
<item row="7" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="label_9">
|
<widget class="QLabel" name="label_9">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
|
@ -182,7 +199,21 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="0" colspan="2">
|
<item row="8" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="m_cbHideCountsIfNoUnread">
|
||||||
|
<property name="text">
|
||||||
|
<string>Hide message counts if there are no unread messages</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="m_checkShowTooltips">
|
||||||
|
<property name="text">
|
||||||
|
<string>Display tooltips for feeds and messages</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="0" colspan="2">
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -195,44 +226,6 @@
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>Feed connection timeout</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>m_spinFeedUpdateTimeout</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="9" column="0" colspan="2">
|
|
||||||
<widget class="QCheckBox" name="m_cbHideCountsIfNoUnread">
|
|
||||||
<property name="text">
|
|
||||||
<string>Hide message counts if there are no unread messages</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="10" column="0" colspan="2">
|
|
||||||
<widget class="QCheckBox" name="m_checkShowTooltips">
|
|
||||||
<property name="text">
|
|
||||||
<string>Display tooltips for feeds and messages</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="2">
|
|
||||||
<widget class="QCheckBox" name="m_checkAutoUpdateOnlyUnfocused">
|
|
||||||
<property name="text">
|
|
||||||
<string>Only auto-download messages when application is unfocused</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" colspan="2">
|
|
||||||
<widget class="QCheckBox" name="m_checkAutoUpdateNotification">
|
|
||||||
<property name="text">
|
|
||||||
<string>Enable "auto-download started" notification</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="m_tabMessages">
|
<widget class="QWidget" name="m_tabMessages">
|
||||||
|
@ -432,7 +425,6 @@
|
||||||
<tabstop>m_spinStartupUpdateDelay</tabstop>
|
<tabstop>m_spinStartupUpdateDelay</tabstop>
|
||||||
<tabstop>m_checkAutoUpdate</tabstop>
|
<tabstop>m_checkAutoUpdate</tabstop>
|
||||||
<tabstop>m_spinAutoUpdateInterval</tabstop>
|
<tabstop>m_spinAutoUpdateInterval</tabstop>
|
||||||
<tabstop>m_checkAutoUpdateNotification</tabstop>
|
|
||||||
<tabstop>m_checkAutoUpdateOnlyUnfocused</tabstop>
|
<tabstop>m_checkAutoUpdateOnlyUnfocused</tabstop>
|
||||||
<tabstop>m_btnChangeFeedListFont</tabstop>
|
<tabstop>m_btnChangeFeedListFont</tabstop>
|
||||||
<tabstop>m_spinFeedUpdateTimeout</tabstop>
|
<tabstop>m_spinFeedUpdateTimeout</tabstop>
|
||||||
|
|
|
@ -34,7 +34,7 @@ void SettingsNotifications::loadSettings() {
|
||||||
m_ui.m_lblAvailableSounds->setText(QSL("Built-in sounds:\n%1").arg(descs));
|
m_ui.m_lblAvailableSounds->setText(QSL("Built-in sounds:\n%1").arg(descs));
|
||||||
|
|
||||||
// Load fancy notification settings.
|
// Load fancy notification settings.
|
||||||
m_ui.m_checkEnableNotifications->setChecked(settings()->value(GROUP(Notifications), SETTING(Notifications::EnableNotifications)).toBool());
|
m_ui.m_checkEnableNotifications->setChecked(settings()->value(GROUP(GUI), SETTING(GUI::EnableNotifications)).toBool());
|
||||||
m_ui.m_editor->loadNotifications(qApp->notifications()->allNotifications());
|
m_ui.m_editor->loadNotifications(qApp->notifications()->allNotifications());
|
||||||
|
|
||||||
onEndLoadSettings();
|
onEndLoadSettings();
|
||||||
|
@ -44,7 +44,7 @@ void SettingsNotifications::saveSettings() {
|
||||||
onBeginSaveSettings();
|
onBeginSaveSettings();
|
||||||
|
|
||||||
// Save notifications.
|
// Save notifications.
|
||||||
settings()->setValue(GROUP(Notifications), Notifications::EnableNotifications, m_ui.m_checkEnableNotifications->isChecked());
|
settings()->setValue(GROUP(GUI), GUI::EnableNotifications, m_ui.m_checkEnableNotifications->isChecked());
|
||||||
qApp->notifications()->save(m_ui.m_editor->allNotifications(), settings());
|
qApp->notifications()->save(m_ui.m_editor->allNotifications(), settings());
|
||||||
|
|
||||||
onEndSaveSettings();
|
onEndSaveSettings();
|
||||||
|
|
|
@ -71,7 +71,7 @@ bool SystemTrayIcon::isSystemTrayDesired() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemTrayIcon::areNotificationsEnabled() {
|
bool SystemTrayIcon::areNotificationsEnabled() {
|
||||||
return qApp->settings()->value(GROUP(Notifications), SETTING(Notifications::EnableNotifications)).toBool();
|
return qApp->settings()->value(GROUP(GUI), SETTING(GUI::EnableNotifications)).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemTrayIcon::showPrivate() {
|
void SystemTrayIcon::showPrivate() {
|
||||||
|
|
|
@ -316,12 +316,10 @@ void FeedReader::executeNextAutoUpdate() {
|
||||||
updateFeeds(feeds_for_update);
|
updateFeeds(feeds_for_update);
|
||||||
|
|
||||||
// NOTE: OSD/bubble informing about performing of scheduled update can be shown now.
|
// NOTE: OSD/bubble informing about performing of scheduled update can be shown now.
|
||||||
if (qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::EnableAutoUpdateNotification)).toBool()) {
|
qApp->showGuiMessage(Notification::Event::ArticlesFetchingStarted,
|
||||||
qApp->showGuiMessage(Notification::Event::ArticlesFetchingStarted,
|
tr("Starting auto-download of some feeds' articles"),
|
||||||
tr("Starting auto-download of some feeds' articles"),
|
tr("I will auto-download new articles for %n feed(s).", nullptr, feeds_for_update.size()),
|
||||||
tr("I will auto-download new articles for %n feed(s).", nullptr, feeds_for_update.size()),
|
QSystemTrayIcon::MessageIcon::Information);
|
||||||
QSystemTrayIcon::MessageIcon::Information);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ QList<Notification> NotificationFactory::allNotifications() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
Notification NotificationFactory::notificationForEvent(Notification::Event event) const {
|
Notification NotificationFactory::notificationForEvent(Notification::Event event) const {
|
||||||
if (!qApp->settings()->value(GROUP(Notifications), SETTING(Notifications::EnableNotifications)).toBool()) {
|
if (!qApp->settings()->value(GROUP(GUI), SETTING(GUI::EnableNotifications)).toBool()) {
|
||||||
return Notification();
|
return Notification();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,9 +39,6 @@ DKEY Feeds::ID = "feeds";
|
||||||
DKEY Feeds::UpdateTimeout = "feed_update_timeout";
|
DKEY Feeds::UpdateTimeout = "feed_update_timeout";
|
||||||
DVALUE(int) Feeds::UpdateTimeoutDef = DOWNLOAD_TIMEOUT;
|
DVALUE(int) Feeds::UpdateTimeoutDef = DOWNLOAD_TIMEOUT;
|
||||||
|
|
||||||
DKEY Feeds::EnableAutoUpdateNotification = "enable_auto_update_notification";
|
|
||||||
DVALUE(bool) Feeds::EnableAutoUpdateNotificationDef = false;
|
|
||||||
|
|
||||||
DKEY Feeds::CountFormat = "count_format";
|
DKEY Feeds::CountFormat = "count_format";
|
||||||
DVALUE(char*) Feeds::CountFormatDef = "(%unread)";
|
DVALUE(char*) Feeds::CountFormatDef = "(%unread)";
|
||||||
|
|
||||||
|
@ -181,6 +178,9 @@ DVALUE(bool) GUI::MessageViewerToolbarsVisibleDef = true;
|
||||||
DKEY GUI::StatusBarVisible = "enable_status_bar";
|
DKEY GUI::StatusBarVisible = "enable_status_bar";
|
||||||
DVALUE(bool) GUI::StatusBarVisibleDef = true;
|
DVALUE(bool) GUI::StatusBarVisibleDef = true;
|
||||||
|
|
||||||
|
DKEY GUI::EnableNotifications = "enable_notifications";
|
||||||
|
DVALUE(bool) GUI::EnableNotificationsDef = true;
|
||||||
|
|
||||||
DKEY GUI::HideMainWindowWhenMinimized = "hide_when_minimized";
|
DKEY GUI::HideMainWindowWhenMinimized = "hide_when_minimized";
|
||||||
DVALUE(bool) GUI::HideMainWindowWhenMinimizedDef = false;
|
DVALUE(bool) GUI::HideMainWindowWhenMinimizedDef = false;
|
||||||
|
|
||||||
|
@ -312,9 +312,6 @@ DKEY Keyboard::ID = "keyboard";
|
||||||
// Notifications.
|
// Notifications.
|
||||||
DKEY Notifications::ID = "notifications";
|
DKEY Notifications::ID = "notifications";
|
||||||
|
|
||||||
DKEY Notifications::EnableNotifications = "enable_notifications";
|
|
||||||
DVALUE(bool) Notifications::EnableNotificationsDef = true;
|
|
||||||
|
|
||||||
// Web browser.
|
// Web browser.
|
||||||
DKEY Browser::ID = "browser";
|
DKEY Browser::ID = "browser";
|
||||||
|
|
||||||
|
|
|
@ -56,9 +56,6 @@ namespace Feeds {
|
||||||
KEY UpdateTimeout;
|
KEY UpdateTimeout;
|
||||||
VALUE(int) UpdateTimeoutDef;
|
VALUE(int) UpdateTimeoutDef;
|
||||||
|
|
||||||
KEY EnableAutoUpdateNotification;
|
|
||||||
VALUE(bool) EnableAutoUpdateNotificationDef;
|
|
||||||
|
|
||||||
KEY CountFormat;
|
KEY CountFormat;
|
||||||
VALUE(char*) CountFormatDef;
|
VALUE(char*) CountFormatDef;
|
||||||
|
|
||||||
|
@ -144,6 +141,9 @@ namespace Messages {
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
KEY ID;
|
KEY ID;
|
||||||
|
|
||||||
|
KEY EnableNotifications;
|
||||||
|
VALUE(bool) EnableNotificationsDef;
|
||||||
|
|
||||||
KEY MessageViewState;
|
KEY MessageViewState;
|
||||||
VALUE(QString) MessageViewStateDef;
|
VALUE(QString) MessageViewStateDef;
|
||||||
|
|
||||||
|
@ -360,9 +360,6 @@ namespace Keyboard {
|
||||||
// Notifications.
|
// Notifications.
|
||||||
namespace Notifications {
|
namespace Notifications {
|
||||||
KEY ID;
|
KEY ID;
|
||||||
|
|
||||||
KEY EnableNotifications;
|
|
||||||
VALUE(bool) EnableNotificationsDef;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Web browser.
|
// Web browser.
|
||||||
|
|
Loading…
Reference in New Issue