|
|
@ -696,19 +696,19 @@ class ParentPanelController: NSWindowController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@IBAction func dismissNextEventLabel(_: NSButton) { |
|
|
|
@IBAction func dismissNextEventLabel(_: NSButton) { |
|
|
|
removeUpcomingEventView() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func removeUpcomingEventView() { |
|
|
|
|
|
|
|
OperationQueue.main.addOperation { |
|
|
|
|
|
|
|
let eventCenter = EventCenter.sharedCenter() |
|
|
|
let eventCenter = EventCenter.sharedCenter() |
|
|
|
let now = Date() |
|
|
|
let now = Date() |
|
|
|
if let events = eventCenter.eventsForDate[NSCalendar.autoupdatingCurrent.startOfDay(for: now)], events.isEmpty == false { |
|
|
|
if let events = eventCenter.eventsForDate[NSCalendar.autoupdatingCurrent.startOfDay(for: now)], events.isEmpty == false { |
|
|
|
if let upcomingEvent = eventCenter.nextOccuring(events), let meetingLink = upcomingEvent.meetingURL { |
|
|
|
if let upcomingEvent = eventCenter.nextOccuring(events), let meetingLink = upcomingEvent.meetingURL { |
|
|
|
NSWorkspace.shared.open(meetingLink) |
|
|
|
NSWorkspace.shared.open(meetingLink) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
removeUpcomingEventView() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func removeUpcomingEventView() { |
|
|
|
|
|
|
|
OperationQueue.main.addOperation { |
|
|
|
if self.stackView.arrangedSubviews.contains(self.upcomingEventView!), self.upcomingEventView?.isHidden == false { |
|
|
|
if self.stackView.arrangedSubviews.contains(self.upcomingEventView!), self.upcomingEventView?.isHidden == false { |
|
|
|
self.upcomingEventView?.isHidden = true |
|
|
|
self.upcomingEventView?.isHidden = true |
|
|
|
UserDefaults.standard.set("NO", forKey: CLShowUpcomingEventView) |
|
|
|
UserDefaults.standard.set("NO", forKey: CLShowUpcomingEventView) |
|
|
|