2019-09-04 23:24:16 +02:00
|
|
|
//
|
|
|
|
// RootSplitViewController.swift
|
|
|
|
// NetNewsWire-iOS
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 9/4/19.
|
|
|
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
2019-09-05 20:14:14 +02:00
|
|
|
import Account
|
2019-09-04 23:24:16 +02:00
|
|
|
|
|
|
|
class RootSplitViewController: UISplitViewController {
|
|
|
|
|
|
|
|
var coordinator: SceneCoordinator!
|
|
|
|
|
2019-11-19 02:12:24 +01:00
|
|
|
override var prefersStatusBarHidden: Bool {
|
|
|
|
return coordinator.prefersStatusBarHidden
|
|
|
|
}
|
|
|
|
|
|
|
|
override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation {
|
|
|
|
return .slide
|
|
|
|
}
|
|
|
|
|
2020-04-29 00:16:34 +02:00
|
|
|
override func viewDidAppear(_ animated: Bool) {
|
|
|
|
coordinator.resetFocus()
|
|
|
|
}
|
|
|
|
|
2019-09-09 23:59:24 +02:00
|
|
|
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
|
2019-11-20 23:41:13 +01:00
|
|
|
self.coordinator.configurePanelMode(for: size)
|
2019-10-31 00:02:57 +01:00
|
|
|
super.viewWillTransition(to: size, with: coordinator)
|
2019-09-09 23:59:24 +02:00
|
|
|
}
|
|
|
|
|
2019-09-04 23:24:16 +02:00
|
|
|
// MARK: Keyboard Shortcuts
|
2019-09-06 04:14:19 +02:00
|
|
|
|
2019-09-05 18:29:04 +02:00
|
|
|
@objc func scrollOrGoToNextUnread(_ sender: Any?) {
|
2019-09-06 04:14:19 +02:00
|
|
|
coordinator.scrollOrGoToNextUnread()
|
2019-09-05 18:29:04 +02:00
|
|
|
}
|
2020-07-10 20:51:41 +02:00
|
|
|
|
|
|
|
@objc func scrollUp(_ sender: Any?) {
|
|
|
|
coordinator.scrollUp()
|
|
|
|
}
|
2019-09-05 18:29:04 +02:00
|
|
|
|
|
|
|
@objc func goToPreviousUnread(_ sender: Any?) {
|
2019-09-06 01:02:40 +02:00
|
|
|
coordinator.selectPrevUnread()
|
2019-09-05 18:29:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@objc func nextUnread(_ sender: Any?) {
|
2019-09-05 21:50:05 +02:00
|
|
|
coordinator.selectNextUnread()
|
2019-09-05 18:29:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@objc func markRead(_ sender: Any?) {
|
2019-09-05 21:50:05 +02:00
|
|
|
coordinator.markAsReadForCurrentArticle()
|
2019-09-05 18:29:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@objc func markUnreadAndGoToNextUnread(_ sender: Any?) {
|
2019-09-05 21:50:05 +02:00
|
|
|
coordinator.markAsUnreadForCurrentArticle()
|
|
|
|
coordinator.selectNextUnread()
|
2019-09-05 18:29:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@objc func markAllAsReadAndGoToNextUnread(_ sender: Any?) {
|
2021-04-13 02:41:01 +02:00
|
|
|
coordinator.markAllAsReadInTimeline() {
|
|
|
|
self.coordinator.selectNextUnread()
|
|
|
|
}
|
2019-09-05 18:29:04 +02:00
|
|
|
}
|
2020-01-04 09:42:29 +01:00
|
|
|
|
|
|
|
@objc func markAboveAsRead(_ sender: Any?) {
|
|
|
|
coordinator.markAboveAsRead()
|
|
|
|
}
|
2019-09-05 18:29:04 +02:00
|
|
|
|
2020-01-03 08:16:55 +01:00
|
|
|
@objc func markBelowAsRead(_ sender: Any?) {
|
|
|
|
coordinator.markBelowAsRead()
|
2019-09-05 18:29:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@objc func markUnread(_ sender: Any?) {
|
2019-09-05 21:50:05 +02:00
|
|
|
coordinator.markAsUnreadForCurrentArticle()
|
2019-09-05 18:29:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@objc func goToPreviousSubscription(_ sender: Any?) {
|
|
|
|
coordinator.selectPrevFeed()
|
|
|
|
}
|
|
|
|
|
|
|
|
@objc func goToNextSubscription(_ sender: Any?) {
|
|
|
|
coordinator.selectNextFeed()
|
|
|
|
}
|
2019-09-04 23:24:16 +02:00
|
|
|
|
|
|
|
@objc func openInBrowser(_ sender: Any?) {
|
|
|
|
coordinator.showBrowserForCurrentArticle()
|
|
|
|
}
|
2020-05-14 14:28:38 +02:00
|
|
|
|
2020-05-15 09:09:33 +02:00
|
|
|
@objc func openInAppBrowser(_ sender: Any?) {
|
2020-05-29 17:09:04 +02:00
|
|
|
coordinator.showInAppBrowser()
|
2020-05-14 14:28:38 +02:00
|
|
|
}
|
2019-09-04 23:24:16 +02:00
|
|
|
|
2019-09-07 16:01:29 +02:00
|
|
|
@objc func articleSearch(_ sender: Any?) {
|
|
|
|
coordinator.showSearch()
|
|
|
|
}
|
|
|
|
|
2019-09-05 20:14:14 +02:00
|
|
|
@objc func addNewFeed(_ sender: Any?) {
|
2024-11-02 19:08:58 +01:00
|
|
|
coordinator.showAddFeed()
|
2019-09-05 20:14:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@objc func addNewFolder(_ sender: Any?) {
|
2020-08-11 22:00:31 +02:00
|
|
|
coordinator.showAddFolder()
|
2019-09-05 20:14:14 +02:00
|
|
|
}
|
|
|
|
|
2020-03-16 00:15:52 +01:00
|
|
|
@objc func cleanUp(_ sender: Any?) {
|
2020-03-24 22:00:01 +01:00
|
|
|
coordinator.cleanUp(conditional: false)
|
2020-03-16 00:15:52 +01:00
|
|
|
}
|
|
|
|
|
2020-03-22 16:18:07 +01:00
|
|
|
@objc func toggleReadFeedsFilter(_ sender: Any?) {
|
|
|
|
coordinator.toggleReadFeedsFilter()
|
|
|
|
}
|
|
|
|
|
|
|
|
@objc func toggleReadArticlesFilter(_ sender: Any?) {
|
|
|
|
coordinator.toggleReadArticlesFilter()
|
|
|
|
}
|
|
|
|
|
2019-09-05 20:14:14 +02:00
|
|
|
@objc func refresh(_ sender: Any?) {
|
2020-03-11 21:47:00 +01:00
|
|
|
appDelegate.manualRefresh(errorHandler: ErrorHandler.present(self))
|
2019-09-05 20:14:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@objc func goToToday(_ sender: Any?) {
|
|
|
|
coordinator.selectTodayFeed()
|
|
|
|
}
|
|
|
|
|
|
|
|
@objc func goToAllUnread(_ sender: Any?) {
|
|
|
|
coordinator.selectAllUnreadFeed()
|
|
|
|
}
|
|
|
|
|
|
|
|
@objc func goToStarred(_ sender: Any?) {
|
|
|
|
coordinator.selectStarredFeed()
|
|
|
|
}
|
2020-05-13 13:59:59 +02:00
|
|
|
|
|
|
|
@objc func goToSettings(_ sender: Any?) {
|
|
|
|
coordinator.showSettings()
|
|
|
|
}
|
|
|
|
|
2019-09-05 22:43:01 +02:00
|
|
|
@objc func toggleRead(_ sender: Any?) {
|
|
|
|
coordinator.toggleReadForCurrentArticle()
|
|
|
|
}
|
|
|
|
|
|
|
|
@objc func toggleStarred(_ sender: Any?) {
|
|
|
|
coordinator.toggleStarredForCurrentArticle()
|
|
|
|
}
|
2020-05-13 18:27:02 +02:00
|
|
|
|
|
|
|
@objc func toggleSidebar(_ sender: Any?) {
|
|
|
|
coordinator.toggleSidebar()
|
|
|
|
}
|
2019-09-04 23:24:16 +02:00
|
|
|
}
|