From 0f275f8179f0a493493c52eb376fe169410212dd Mon Sep 17 00:00:00 2001 From: Gobinath Date: Sat, 5 Nov 2016 10:00:35 +0530 Subject: [PATCH] Reset the state during stop --- safeeyes/safeeyes/SafeEyesCore.py | 5 +++++ safeeyes/safeeyes/config/lang/en.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/safeeyes/safeeyes/SafeEyesCore.py b/safeeyes/safeeyes/SafeEyesCore.py index 36b9b5e..bb3fe20 100644 --- a/safeeyes/safeeyes/SafeEyesCore.py +++ b/safeeyes/safeeyes/SafeEyesCore.py @@ -157,6 +157,11 @@ class SafeEyesCore: Stop Safe Eyes """ def stop(self): + # Reset the state properties in case of restart + self.break_count = 0 + self.long_break_message_index = -1 + self.short_break_message_index = -1 + self.notification_condition.acquire() self.active = False self.notification_condition.notify() diff --git a/safeeyes/safeeyes/config/lang/en.json b/safeeyes/safeeyes/config/lang/en.json index 24ba44e..96991fc 100644 --- a/safeeyes/safeeyes/config/lang/en.json +++ b/safeeyes/safeeyes/config/lang/en.json @@ -31,7 +31,7 @@ "interval_between_two_breaks": "Interval between two breaks", "no_of_short_breaks_between_two_long_breaks": "Number of short breaks between two long breaks", "time_to_prepare_for_break": "Time to prepare for break (in seconds)", - "strict_break": "Strict break (Hide {skip} button)", + "strict_break": "Strict break (Hide skip button)", "enable": "Enable Safe Eyes", "settings": "Settings", "quit": "Quit",