mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Refactor state restoration so that the MainWindowController has control of state restoration order.
This commit is contained in:
@@ -447,13 +447,15 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
|
||||
|
||||
extension MainWindowController: NSWindowDelegate {
|
||||
|
||||
func window(_ window: NSWindow, willEncodeRestorableState state: NSCoder) {
|
||||
func window(_ window: NSWindow, willEncodeRestorableState coder: NSCoder) {
|
||||
sidebarViewController?.encodeState(with: coder)
|
||||
|
||||
// saveSplitViewState(to: state)
|
||||
}
|
||||
|
||||
func window(_ window: NSWindow, didDecodeRestorableState state: NSCoder) {
|
||||
|
||||
func window(_ window: NSWindow, didDecodeRestorableState coder: NSCoder) {
|
||||
sidebarViewController?.decodeState(with: coder)
|
||||
|
||||
// restoreSplitViewState(from: state)
|
||||
//
|
||||
// // Make sure the timeline view is first responder if possible, to start out viewing
|
||||
@@ -494,6 +496,10 @@ extension MainWindowController: SidebarDelegate {
|
||||
return timelineViewController.unreadCount
|
||||
}
|
||||
|
||||
func sidebarInvalidatedRestorationState(_: SidebarViewController) {
|
||||
invalidateRestorableState()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: - TimelineContainerViewControllerDelegate
|
||||
@@ -532,6 +538,10 @@ extension MainWindowController: TimelineContainerViewControllerDelegate {
|
||||
sidebarViewController?.selectFeed(webFeed)
|
||||
}
|
||||
|
||||
func timelineInvalidatedRestorationState(_: TimelineContainerViewController) {
|
||||
invalidateRestorableState()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: - NSSearchFieldDelegate
|
||||
|
||||
Reference in New Issue
Block a user