diff --git a/safeeyes/config/safeeyes.json b/safeeyes/config/safeeyes.json index 0230046..1abe458 100644 --- a/safeeyes/config/safeeyes.json +++ b/safeeyes/config/safeeyes.json @@ -65,7 +65,7 @@ { "id": "audiblealert", "enabled": true, - "version": "0.0.3", + "version": "0.0.4", "settings": { "pre_break_alert": true, "post_break_alert": true @@ -79,6 +79,7 @@ "show_time_in_tray": false, "show_long_time_in_tray": false, "allow_disabling": true, + "allow_forced_disabling": false, "disable_options": [{ "time": 30, "unit": "minute" diff --git a/safeeyes/plugins/trayicon/config.json b/safeeyes/plugins/trayicon/config.json index 4cc8c96..d1a5117 100644 --- a/safeeyes/plugins/trayicon/config.json +++ b/safeeyes/plugins/trayicon/config.json @@ -2,7 +2,7 @@ "meta": { "name": "Tray Icon", "description": "Show a tray icon in the notification area", - "version": "0.0.3" + "version": "0.0.4" }, "dependencies": { "python_modules": [], @@ -31,6 +31,12 @@ "type": "BOOL", "default": true }, + { + "id": "allow_forced_disabling", + "label": "Allow disabling Safe Eyes even when strict mode is enabled", + "type": "BOOL", + "default": false + }, { "id": "disable_options", "label": "Disable options", diff --git a/safeeyes/plugins/trayicon/plugin.py b/safeeyes/plugins/trayicon/plugin.py index 42b309a..0586910 100644 --- a/safeeyes/plugins/trayicon/plugin.py +++ b/safeeyes/plugins/trayicon/plugin.py @@ -435,6 +435,7 @@ class TrayIcon: self.idle_condition = threading.Condition() self.lock = threading.Lock() self.allow_disabling = plugin_config['allow_disabling'] + self.allow_forced_disabling = plugin_config.get('allow_forced_disabling', False) self.animate = False self.menu_locked = False @@ -724,7 +725,7 @@ class TrayIcon: """ This method is called by the core to prevent user from disabling Safe Eyes after the notification. """ - if self.active: + if self.active and not self.allow_forced_disabling: self.menu_locked = True self.update_menu() @@ -732,7 +733,7 @@ class TrayIcon: """ This method is called by the core to activate the menu after the the break. """ - if self.active: + if self.active and not self.allow_forced_disabling: self.menu_locked = False self.update_menu()