diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG
index 2ff1c8bb9..376e1bb66 100644
--- a/resources/text/CHANGELOG
+++ b/resources/text/CHANGELOG
@@ -21,6 +21,7 @@
Fixed:
+ - Added ability to completely disable notifications (bug #128).
- Better info in popup notification when many feeds are updated.
- Fixed obtaining of contents in RSS 2.0 feed entries. (bug #130)
- Improved popup informing about changes in newly installed version.
diff --git a/src/gui/dialogs/formsettings.cpp b/src/gui/dialogs/formsettings.cpp
index f47297874..181bd0c45 100755
--- a/src/gui/dialogs/formsettings.cpp
+++ b/src/gui/dialogs/formsettings.cpp
@@ -732,6 +732,7 @@ void FormSettings::loadInterface() {
m_ui->m_cmbNotificationPosition->addItem(tr("Bottom-right corner"), Qt::BottomRightCorner);
m_ui->m_cmbNotificationPosition->addItem(tr("Top-right corner"), Qt::TopRightCorner);
m_ui->m_cmbNotificationPosition->setCurrentIndex(m_ui->m_cmbNotificationPosition->findData(static_cast(settings->value(GROUP(GUI), SETTING(GUI::FancyNotificationsPosition)).toInt())));
+ m_ui->m_grpBaseNotifications->setChecked(settings->value(GROUP(GUI), SETTING(GUI::EnableNotifications)).toBool());
// Load settings of icon theme.
QString current_theme = qApp->icons()->currentIconTheme();
@@ -834,6 +835,7 @@ void FormSettings::saveInterface() {
// Save notifications.
settings->setValue(GROUP(GUI), GUI::UseFancyNotifications, m_ui->m_grpNotifications->isChecked());
+ settings->setValue(GROUP(GUI), GUI::EnableNotifications, m_ui->m_grpBaseNotifications->isChecked());
settings->setValue(GROUP(GUI), GUI::FancyNotificationsPosition, static_cast(m_ui->m_cmbNotificationPosition->itemData(m_ui->m_cmbNotificationPosition->currentIndex()).toInt()));
// Save selected icon theme.
diff --git a/src/gui/dialogs/formsettings.h b/src/gui/dialogs/formsettings.h
old mode 100644
new mode 100755
index 810dd3cbe..cdaa14663
--- a/src/gui/dialogs/formsettings.h
+++ b/src/gui/dialogs/formsettings.h
@@ -48,10 +48,9 @@ class FormSettings : public QDialog {
protected:
// Does check of controls before dialog can be submitted.
bool doSaveCheck();
-
bool eventFilter(QObject *obj, QEvent *e);
- protected slots:
+ private slots:
// Displays "restart" dialog if some critical settings changed.
void promptForRestart();
diff --git a/src/gui/dialogs/formsettings.ui b/src/gui/dialogs/formsettings.ui
index adb74b6f1..b92abf5bc 100755
--- a/src/gui/dialogs/formsettings.ui
+++ b/src/gui/dialogs/formsettings.ui
@@ -88,7 +88,7 @@
-
- 0
+ 3
@@ -463,7 +463,7 @@ Authors of this application are NOT responsible for lost data.
QTabWidget::North
- 0
+ 1
@@ -636,24 +636,39 @@ Authors of this application are NOT responsible for lost data.
-
-
+
- Fancy && modern popup notifications (This uses OS native notifications via D-Bus if available.)
+ Enable notifications
+
+
+ false
true
-
-
-
-
-
- Notification position
+
+
-
+
+
+ Fancy && modern popup notifications (This uses OS native notifications via D-Bus if available.)
+
+ true
+
+
+
-
+
+
+ Notification position
+
+
+
+ -
+
+
+
- -
-
-
@@ -1765,5 +1780,21 @@ Authors of this application are NOT responsible for lost data.
+
+ m_grpBaseNotifications
+ toggled(bool)
+ m_grpNotifications
+ setEnabled(bool)
+
+
+ 624
+ 82
+
+
+ 624
+ 89
+
+
+
diff --git a/src/gui/notifications/notification.cpp b/src/gui/notifications/notification.cpp
index 78b522aef..510acf9c5 100755
--- a/src/gui/notifications/notification.cpp
+++ b/src/gui/notifications/notification.cpp
@@ -66,10 +66,14 @@ Notification::~Notification() {
qDebug("Destroying Notification instance.");
}
-bool Notification::areNotificationsActivated() {
+bool Notification::areFancyNotificationsEnabled() {
return qApp->settings()->value(GROUP(GUI), SETTING(GUI::UseFancyNotifications)).toBool();
}
+bool Notification::areNotificationsEnabled() {
+ return qApp->settings()->value(GROUP(GUI), SETTING(GUI::EnableNotifications)).toBool();
+}
+
void Notification::notify(const QString &text, const QString &title, const QIcon &icon,
QObject *invokation_target, const char *invokation_slot) {
cancel();
diff --git a/src/gui/notifications/notification.h b/src/gui/notifications/notification.h
old mode 100644
new mode 100755
index 13b11bec5..dceb7bcc4
--- a/src/gui/notifications/notification.h
+++ b/src/gui/notifications/notification.h
@@ -35,7 +35,8 @@ class Notification : public QWidget {
explicit Notification();
virtual ~Notification();
- static bool areNotificationsActivated();
+ static bool areFancyNotificationsEnabled();
+ static bool areNotificationsEnabled();
public slots:
// Main methods for using the netofication.
diff --git a/src/miscellaneous/application.cpp b/src/miscellaneous/application.cpp
index 495d06042..0ff6edeae 100755
--- a/src/miscellaneous/application.cpp
+++ b/src/miscellaneous/application.cpp
@@ -198,19 +198,25 @@ void Application::showGuiMessage(const QString &title, const QString &message,
QSystemTrayIcon::MessageIcon message_type, QWidget *parent,
bool show_at_least_msgbox, const QIcon &custom_icon,
QObject *invokation_target, const char *invokation_slot) {
- if (Notification::areNotificationsActivated()) {
- // Show OSD instead if tray icon bubble, depending on settings.
- if (custom_icon.isNull()) {
- notification()->notify(message, title, message_type, invokation_target, invokation_slot);
+ if (Notification::areNotificationsEnabled()) {
+ if (Notification::areFancyNotificationsEnabled()) {
+ // Show OSD instead if tray icon bubble, depending on settings.
+ if (custom_icon.isNull()) {
+ notification()->notify(message, title, message_type, invokation_target, invokation_slot);
+ }
+ else {
+ notification()->notify(message, title, custom_icon, invokation_target, invokation_slot);
+ }
+
+ return;
}
- else {
- notification()->notify(message, title, custom_icon, invokation_target, invokation_slot);
+ else if (SystemTrayIcon::isSystemTrayActivated()) {
+ trayIcon()->showMessage(title, message, message_type, TRAY_ICON_BUBBLE_TIMEOUT, invokation_target, invokation_slot);
+ return;
}
}
- else if (SystemTrayIcon::isSystemTrayActivated()) {
- trayIcon()->showMessage(title, message, message_type, TRAY_ICON_BUBBLE_TIMEOUT, invokation_target, invokation_slot);
- }
- else if (show_at_least_msgbox) {
+
+ if (show_at_least_msgbox) {
// Tray icon or OSD is not available, display simple text box.
MessageBox::show(parent, (QMessageBox::Icon) message_type, title, message);
}
diff --git a/src/miscellaneous/settings.cpp b/src/miscellaneous/settings.cpp
index 56c8cbac1..bc040936e 100755
--- a/src/miscellaneous/settings.cpp
+++ b/src/miscellaneous/settings.cpp
@@ -111,6 +111,9 @@ DVALUE(bool) GUI::HideMainWindowWhenMinimizedDef = false;
DKEY GUI::UseTrayIcon = "use_tray_icon";
DVALUE(bool) GUI::UseTrayIconDef = true;
+DKEY GUI::EnableNotifications = "enable_notifications";
+DVALUE(bool) GUI::EnableNotificationsDef = true;
+
DKEY GUI::UseFancyNotifications = "use_fancy_notifications";
DVALUE(bool) GUI::UseFancyNotificationsDef = true;
diff --git a/src/miscellaneous/settings.h b/src/miscellaneous/settings.h
index c254e7cee..b3a977520 100755
--- a/src/miscellaneous/settings.h
+++ b/src/miscellaneous/settings.h
@@ -126,6 +126,9 @@ namespace GUI {
KEY UseTrayIcon;
VALUE(bool) UseTrayIconDef;
+ KEY EnableNotifications;
+ VALUE(bool) EnableNotificationsDef;
+
KEY UseFancyNotifications;
VALUE(bool) UseFancyNotificationsDef;