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