|
|
|
@ -188,8 +188,7 @@ class ParentPanelController: NSWindowController {
|
|
|
|
|
object: nil) |
|
|
|
|
NotificationCenter.default.addObserver(forName: NSUbiquitousKeyValueStore.didChangeExternallyNotification, |
|
|
|
|
object: self, |
|
|
|
|
queue: OperationQueue.main) |
|
|
|
|
{ [weak self] _ in |
|
|
|
|
queue: OperationQueue.main) { [weak self] _ in |
|
|
|
|
if let sSelf = self { |
|
|
|
|
sSelf.mainTableView.reloadData() |
|
|
|
|
sSelf.setScrollViewConstraint() |
|
|
|
@ -341,7 +340,7 @@ class ParentPanelController: NSWindowController {
|
|
|
|
|
|
|
|
|
|
let styleAttributes = [ |
|
|
|
|
NSAttributedString.Key.paragraphStyle: paragraphStyle, |
|
|
|
|
NSAttributedString.Key.font: NSFont(name: "Avenir-Light", size: 13) ?? NSFont.systemFont(ofSize: 13), |
|
|
|
|
NSAttributedString.Key.font: NSFont(name: "Avenir-Light", size: 13) ?? NSFont.systemFont(ofSize: 13) |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
let leftButtonAttributedTitle = NSAttributedString(string: leftButton.title, attributes: styleAttributes) |
|
|
|
@ -417,8 +416,7 @@ class ParentPanelController: NSWindowController {
|
|
|
|
|
newHeight += 20 |
|
|
|
|
} else if DataStore.shared().shouldDisplay(.dstTransitionInfo), |
|
|
|
|
let obj = object, |
|
|
|
|
TimezoneDataOperations(with: obj).nextDaylightSavingsTransitionIfAvailable(with: futureSliderValue) != nil |
|
|
|
|
{ |
|
|
|
|
TimezoneDataOperations(with: obj).nextDaylightSavingsTransitionIfAvailable(with: futureSliderValue) != nil { |
|
|
|
|
newHeight += 20 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -606,8 +604,7 @@ class ParentPanelController: NSWindowController {
|
|
|
|
|
|
|
|
|
|
if $0 < mainTableView.numberOfRows, |
|
|
|
|
let cellView = mainTableView.view(atColumn: 0, row: $0, makeIfNecessary: false) as? TimezoneCellView, |
|
|
|
|
let model = TimezoneData.customObject(from: current) |
|
|
|
|
{ |
|
|
|
|
let model = TimezoneData.customObject(from: current) { |
|
|
|
|
if let futureSliderCell = futureSlider.cell as? CustomSliderCell, futureSliderCell.tracking == true { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
@ -627,8 +624,7 @@ class ParentPanelController: NSWindowController {
|
|
|
|
|
if let note = model.note, !note.isEmpty { |
|
|
|
|
cellView.noteLabel.stringValue = note |
|
|
|
|
} else if DataStore.shared().shouldDisplay(.dstTransitionInfo), |
|
|
|
|
let value = TimezoneDataOperations(with: model).nextDaylightSavingsTransitionIfAvailable(with: futureSliderValue) |
|
|
|
|
{ |
|
|
|
|
let value = TimezoneDataOperations(with: model).nextDaylightSavingsTransitionIfAvailable(with: futureSliderValue) { |
|
|
|
|
cellView.noteLabel.stringValue = value |
|
|
|
|
} else { |
|
|
|
|
cellView.noteLabel.stringValue = CLEmptyString |
|
|
|
@ -728,8 +724,7 @@ class ParentPanelController: NSWindowController {
|
|
|
|
|
|
|
|
|
|
@IBAction func calendarButtonAction(_ sender: NSButton) { |
|
|
|
|
if sender.title == NSLocalizedString("Click here to start.", |
|
|
|
|
comment: "Button Title for no Calendar access") |
|
|
|
|
{ |
|
|
|
|
comment: "Button Title for no Calendar access") { |
|
|
|
|
showPermissionsWindow() |
|
|
|
|
} else { |
|
|
|
|
retrieveCalendarEvents() |
|
|
|
@ -820,8 +815,7 @@ class ParentPanelController: NSWindowController {
|
|
|
|
|
if let events = eventCenter.eventsForDate[NSCalendar.autoupdatingCurrent.startOfDay(for: now)], events.isEmpty == false { |
|
|
|
|
OperationQueue.main.addOperation { |
|
|
|
|
if self.upcomingEventCollectionView != nil, |
|
|
|
|
let upcomingEvents = eventCenter.upcomingEventsForDay(events) |
|
|
|
|
{ |
|
|
|
|
let upcomingEvents = eventCenter.upcomingEventsForDay(events) { |
|
|
|
|
self.upcomingEventsDataSource.updateEventsDataSource(upcomingEvents) |
|
|
|
|
self.upcomingEventCollectionView.reloadData() |
|
|
|
|
return |
|
|
|
@ -901,7 +895,7 @@ class ParentPanelController: NSWindowController {
|
|
|
|
|
|
|
|
|
|
let styleAttributes = [ |
|
|
|
|
NSAttributedString.Key.paragraphStyle: paragraphStyle, |
|
|
|
|
NSAttributedString.Key.font: NSFont(name: "Avenir-Light", size: 13)!, |
|
|
|
|
NSAttributedString.Key.font: NSFont(name: "Avenir-Light", size: 13)! |
|
|
|
|
] |
|
|
|
|
leftButton.attributedTitle = NSAttributedString(string: "Not Really", attributes: styleAttributes) |
|
|
|
|
rightButton.attributedTitle = NSAttributedString(string: "Yes!", attributes: styleAttributes) |
|
|
|
@ -937,7 +931,7 @@ class ParentPanelController: NSWindowController {
|
|
|
|
|
|
|
|
|
|
let styleAttributes = [ |
|
|
|
|
NSAttributedString.Key.paragraphStyle: paragraphStyle, |
|
|
|
|
NSAttributedString.Key.font: NSFont(name: "Avenir-Light", size: 13)!, |
|
|
|
|
NSAttributedString.Key.font: NSFont(name: "Avenir-Light", size: 13)! |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
if leftButton.attributedTitle.string == "Not Really" { |
|
|
|
@ -1121,8 +1115,7 @@ extension ParentPanelController: NSSharingServicePickerDelegate {
|
|
|
|
|
|
|
|
|
|
stride(from: 0, to: sortedByTime.count, by: 1).forEach { |
|
|
|
|
if $0 < sortedByTime.count, |
|
|
|
|
let dataModel = TimezoneData.customObject(from: sortedByTime[$0]) |
|
|
|
|
{ |
|
|
|
|
let dataModel = TimezoneData.customObject(from: sortedByTime[$0]) { |
|
|
|
|
let dataOperations = TimezoneDataOperations(with: dataModel) |
|
|
|
|
let date = dataOperations.todaysDate(with: 0) |
|
|
|
|
let time = dataOperations.time(with: 0) |
|
|
|
|