Skip to content

Commit

Permalink
Fix open event on click
Browse files Browse the repository at this point in the history
  • Loading branch information
leits committed Jun 16, 2020
1 parent 3ef2257 commit 7942088
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 7 additions & 0 deletions MeetingBar/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ class AppDelegate: NSObject, NSApplicationDelegate {
return
}
}


@objc func clickOnEvent(sender: NSMenuItem) {
NSLog("Click on event (\(sender.title))!")
let event: EKEvent = sender.representedObject as! EKEvent
openEvent(event)
}

@objc func openPrefecencesWindow(_: NSStatusBarButton?) {
NSLog("Open preferences window")
Expand Down
8 changes: 1 addition & 7 deletions MeetingBar/StatusBarItemControler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class StatusBarItemControler {
let itemTitle = "\(eventStartTime) - \(eventTitle)"
let eventItem = self.item.menu!.addItem(
withTitle: itemTitle,
action: #selector(StatusBarItemControler.clickOnEvent(sender:)),
action: #selector(AppDelegate.clickOnEvent(sender:)),
keyEquivalent: "")
let eventStatus = getEventStatus(event)
if eventStatus != nil {
Expand Down Expand Up @@ -291,12 +291,6 @@ class StatusBarItemControler {
action: #selector(AppDelegate.quit),
keyEquivalent: "")
}

@objc func clickOnEvent(sender: NSMenuItem) {
NSLog("Click on event (\(sender.title))!")
let event: EKEvent = sender.representedObject as! EKEvent
openEvent(event)
}
}

func createEventStatusString(_ event: EKEvent) -> String {
Expand Down

0 comments on commit 7942088

Please sign in to comment.