Skip to content

Commit

Permalink
show tray message when another instance pings
Browse files Browse the repository at this point in the history
  • Loading branch information
shotwn committed Apr 4, 2020
1 parent 1cd1c80 commit 2cee091
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ def trayActivated(self, reason):
if reason == self.tray.ActivationReason.Trigger:
self.show()

def single_instance_triggered(self):
self.tray.showMessage("FS Time Sync", "FS Time Sync is already running.")
self.show()

def show(self):
self.tray_actions["hide_show"].setText("Hide")
self.tray_actions["hide_show"].triggered.connect(self.hide)
Expand All @@ -94,7 +98,7 @@ def exit(self):

def start(self):
# Add single instance trigger.
self.root.si.add_trigger(self.show)
self.root.si.add_trigger(self.single_instance_triggered)

# Settings are triggered here.
if not self.root.settings.get("startup", "tray"): # Start regularly or as tray icon
Expand Down

0 comments on commit 2cee091

Please sign in to comment.