diff --git a/Config.cpp b/Config.cpp
index 9235ae3a..f95d5cc5 100644
--- a/Config.cpp
+++ b/Config.cpp
@@ -26,6 +26,7 @@ with this program. If not, see
#define PARAM_ENABLE "ServerEnabled"
#define PARAM_PORT "ServerPort"
#define PARAM_DEBUG "DebugEnabled"
+#define PARAM_ALERT "AlertsEnabled"
#define PARAM_AUTHREQUIRED "AuthRequired"
#define PARAM_SECRET "AuthSecret"
#define PARAM_SALT "AuthSalt"
@@ -38,6 +39,7 @@ Config::Config() :
ServerEnabled(true),
ServerPort(4444),
DebugEnabled(false),
+ AlertsEnabled(true),
AuthRequired(false),
Secret(""),
Salt(""),
@@ -52,6 +54,8 @@ Config::Config() :
config_set_default_bool(obs_config,
SECTION_NAME, PARAM_DEBUG, DebugEnabled);
+ config_set_default_bool(obs_config,
+ SECTION_NAME, PARAM_ALERT, AlertsEnabled);
config_set_default_bool(obs_config,
SECTION_NAME, PARAM_AUTHREQUIRED, AuthRequired);
@@ -80,6 +84,7 @@ void Config::Load() {
ServerPort = config_get_uint(obs_config, SECTION_NAME, PARAM_PORT);
DebugEnabled = config_get_bool(obs_config, SECTION_NAME, PARAM_DEBUG);
+ AlertsEnabled = config_get_bool(obs_config, SECTION_NAME, PARAM_ALERT);
AuthRequired = config_get_bool(obs_config, SECTION_NAME, PARAM_AUTHREQUIRED);
Secret = config_get_string(obs_config, SECTION_NAME, PARAM_SECRET);
@@ -93,6 +98,7 @@ void Config::Save() {
config_set_uint(obs_config, SECTION_NAME, PARAM_PORT, ServerPort);
config_set_bool(obs_config, SECTION_NAME, PARAM_DEBUG, DebugEnabled);
+ config_set_bool(obs_config, SECTION_NAME, PARAM_ALERT, AlertsEnabled);
config_set_bool(obs_config, SECTION_NAME, PARAM_AUTHREQUIRED, AuthRequired);
config_set_string(obs_config, SECTION_NAME, PARAM_SECRET, Secret);
diff --git a/Config.h b/Config.h
index 94e9ec28..cdccef87 100644
--- a/Config.h
+++ b/Config.h
@@ -39,6 +39,7 @@ class Config {
uint64_t ServerPort;
bool DebugEnabled;
+ bool AlertsEnabled;
bool AuthRequired;
const char* Secret;
diff --git a/Utils.cpp b/Utils.cpp
index 7170479e..fcc45d23 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -24,6 +24,7 @@ with this program. If not, see
#include "obs-websocket.h"
#include "Utils.h"
+#include "Config.h"
Q_DECLARE_METATYPE(OBSScene);
@@ -379,7 +380,7 @@ QSystemTrayIcon* Utils::GetTrayIcon() {
void Utils::SysTrayNotify(QString &text,
QSystemTrayIcon::MessageIcon icon, QString title) {
- if (!QSystemTrayIcon::supportsMessages())
+ if (!Config::Current()->AlertsEnabled || !QSystemTrayIcon::supportsMessages())
return;
QSystemTrayIcon* trayIcon = GetTrayIcon();
diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini
index 6d95025b..892bae6d 100644
--- a/data/locale/en-US.ini
+++ b/data/locale/en-US.ini
@@ -5,6 +5,7 @@ OBSWebsocket.Settings.ServerPort="Server Port"
OBSWebsocket.Settings.AuthRequired="Enable authentication"
OBSWebsocket.Settings.Password="Password"
OBSWebsocket.Settings.DebugEnable="Enable debug logging"
+OBSWebsocket.Settings.AlertsEnable="Enable System Tray Alerts"
OBSWebsocket.ConnectNotify.Connected="New WebSocket connection"
OBSWebsocket.ConnectNotify.Disconnected="WebSocket client disconnected"
OBSWebsocket.ConnectNotify.ClientIP="Client Address:"
\ No newline at end of file
diff --git a/forms/settings-dialog.cpp b/forms/settings-dialog.cpp
index f4cff0a4..69b06db6 100644
--- a/forms/settings-dialog.cpp
+++ b/forms/settings-dialog.cpp
@@ -49,6 +49,7 @@ void SettingsDialog::showEvent(QShowEvent* event)
ui->serverPort->setValue(conf->ServerPort);
ui->debugEnabled->setChecked(conf->DebugEnabled);
+ ui->alertsEnabled->setChecked(conf->AlertsEnabled);
ui->authRequired->setChecked(conf->AuthRequired);
ui->password->setText(CHANGE_ME);
@@ -78,6 +79,7 @@ void SettingsDialog::FormAccepted()
conf->ServerPort = ui->serverPort->value();
conf->DebugEnabled = ui->debugEnabled->isChecked();
+ conf->AlertsEnabled = ui->alertsEnabled->isChecked();
if (ui->authRequired->isChecked())
{
diff --git a/forms/settings-dialog.ui b/forms/settings-dialog.ui
index 17590b33..1dbdc82e 100644
--- a/forms/settings-dialog.ui
+++ b/forms/settings-dialog.ui
@@ -7,7 +7,7 @@
0
0
407
- 175
+ 195
@@ -80,6 +80,16 @@
-
+
+
+ OBSWebsocket.Settings.AlertsEnable
+
+
+ true
+
+
+
+ -
OBSWebsocket.Settings.DebugEnable
@@ -113,11 +123,11 @@
248
- 274
+ 294
157
- 294
+ 314
@@ -129,11 +139,11 @@
316
- 280
+ 300
286
- 294
+ 314