Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion safeeyes/config/safeeyes.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
{
"id": "audiblealert",
"enabled": true,
"version": "0.0.3",
"version": "0.0.4",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version bump should probably be in "trayicon", not "audiblealert".

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(If the rework I propose above happens, this comment is moot, of course.)

"settings": {
"pre_break_alert": true,
"post_break_alert": true
Expand All @@ -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"
Expand Down
8 changes: 7 additions & 1 deletion safeeyes/plugins/trayicon/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand Down Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions safeeyes/plugins/trayicon/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ def __init__(self, context, plugin_config):
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

Expand Down Expand Up @@ -724,15 +725,15 @@ def lock_menu(self):
"""
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()

def unlock_menu(self):
"""
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()

Expand Down
Loading