This commit is contained in:
undefiened 2024-11-22 07:15:03 +00:00 committed by GitHub
commit 0ef0eec54c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 4 deletions

View File

@ -65,7 +65,7 @@
{ {
"id": "audiblealert", "id": "audiblealert",
"enabled": true, "enabled": true,
"version": "0.0.3", "version": "0.0.4",
"settings": { "settings": {
"pre_break_alert": true, "pre_break_alert": true,
"post_break_alert": true "post_break_alert": true
@ -79,6 +79,7 @@
"show_time_in_tray": false, "show_time_in_tray": false,
"show_long_time_in_tray": false, "show_long_time_in_tray": false,
"allow_disabling": true, "allow_disabling": true,
"allow_forced_disabling": false,
"disable_options": [{ "disable_options": [{
"time": 30, "time": 30,
"unit": "minute" "unit": "minute"

View File

@ -2,7 +2,7 @@
"meta": { "meta": {
"name": "Tray Icon", "name": "Tray Icon",
"description": "Show a tray icon in the notification area", "description": "Show a tray icon in the notification area",
"version": "0.0.3" "version": "0.0.4"
}, },
"dependencies": { "dependencies": {
"python_modules": [], "python_modules": [],
@ -31,6 +31,12 @@
"type": "BOOL", "type": "BOOL",
"default": true "default": true
}, },
{
"id": "allow_forced_disabling",
"label": "Allow disabling Safe Eyes even when strict mode is enabled",
"type": "BOOL",
"default": false
},
{ {
"id": "disable_options", "id": "disable_options",
"label": "Disable options", "label": "Disable options",

View File

@ -435,6 +435,7 @@ class TrayIcon:
self.idle_condition = threading.Condition() self.idle_condition = threading.Condition()
self.lock = threading.Lock() self.lock = threading.Lock()
self.allow_disabling = plugin_config['allow_disabling'] self.allow_disabling = plugin_config['allow_disabling']
self.allow_forced_disabling = plugin_config.get('allow_forced_disabling', False)
self.animate = False self.animate = False
self.menu_locked = 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. 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.menu_locked = True
self.update_menu() self.update_menu()
@ -732,7 +733,7 @@ class TrayIcon:
""" """
This method is called by the core to activate the menu after the the break. 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.menu_locked = False
self.update_menu() self.update_menu()