Skip to content

Commit

Permalink
Use notification for pause / event entry
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreWohnsland committed Jul 3, 2024
1 parent fe56d37 commit 81bfee6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ui_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ def add_pause(self, check_past_entry: bool = True):
entry_date = self.get_past_date()
DB_CONTROLLER.add_pause(pause, entry_date)
self.set_pause(0)
UIC.show_message(f"Added pause of {pause} minutes on date {entry_date.strftime('%d-%m-%Y')}")
UIC.show_notification(
self.tray_icon, f"Added pause of {pause} minutes on date {entry_date.strftime('%d-%m-%Y')}", "Pause Added"
)
self.update_other_windows()

def get_past_date(self):
Expand All @@ -175,7 +177,9 @@ def add_event(self, event: str, check_past_entry: bool = True):
if self.is_past_time and check_past_entry:
entry_datetime = self.get_past_datetime()
DB_CONTROLLER.add_event(event, entry_datetime)
UIC.show_message(f"Added event {event} at {entry_datetime.strftime('%d-%m-%Y - %H:%M:%S')}")
UIC.show_notification(
self.tray_icon, f"Added event {event} at {entry_datetime.strftime('%d-%m-%Y - %H:%M:%S')}", "Event Added"
)

def add_start(self, check_past_entry: bool = True):
"""Add a start event."""
Expand Down

0 comments on commit 81bfee6

Please sign in to comment.