Skip to content

Commit ce2d3c9

Browse files
committed
added stop button to tracker_window
1 parent 6413205 commit ce2d3c9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/core/screens/tracker_window.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ def __init__(self, parent, controller, logic_controller):
3939
width=10)
4040
pause_button.pack(pady=5)
4141

42+
# stop button
4243
self.stop_button_pressed = False
44+
self.stop_button = tk.Button(self, text="Stop", command=self._stop, width=10)
45+
self.stop_button.pack(pady=5)
4346

4447
self.update_queue = queue.Queue()
4548

@@ -120,6 +123,12 @@ def toggle_pause_tracker(self, button=True):
120123
self.logic_controller.time_tracker.resume()
121124
else:
122125
self.logic_controller.time_tracker.pause()
126+
127+
def _stop(self):
128+
"""ask the user for confirmation to set the stop button pressed flag."""
129+
confirm = tk.messagebox.askyesno("Confirm Stop Tracking", "Are you sure you want to stop tracking?\nProgress will be saved.")
130+
if confirm:
131+
self.stop_button_pressed = True
123132

124133
def periodic_update(self):
125134
"""Update the GUI clock"""

0 commit comments

Comments
 (0)