Make RefreshInterval shared code

Back out inadvertent macOS changes
This commit is contained in:
Maurice Parker 2019-04-23 08:47:58 -05:00
parent 12d4d2dbb1
commit 23c69a9223
6 changed files with 45 additions and 60 deletions

View File

@ -15,35 +15,6 @@ enum FontSize: Int {
case veryLarge = 3
}
enum RefreshInterval: Int {
case manually = 1
case every10Minutes = 2
case every30Minutes = 3
case everyHour = 4
case every2Hours = 5
case every4Hours = 6
case every8Hours = 7
func inSeconds() -> TimeInterval {
switch self {
case .manually:
return 0
case .every10Minutes:
return 10 * 60
case .every30Minutes:
return 30 * 60
case .everyHour:
return 60 * 60
case .every2Hours:
return 2 * 60 * 60
case .every4Hours:
return 4 * 60 * 60
case .every8Hours:
return 8 * 60 * 60
}
}
}
struct AppDefaults {
struct Key {

View File

@ -14,8 +14,6 @@ import RSWeb
enum DetailState: Equatable {
case noSelection
@IBOutlet weak var nextUnreadButtonItem: UIBarButtonItem!
@IBOutlet weak var nextUnreadButtonItem: UIBarButtonItem!
case multipleSelection
case article(Article)
}

View File

@ -87,6 +87,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner {
}
}
private var showAvatars = false
private var rowHeightWithFeedName: CGFloat = 0.0
private var rowHeightWithoutFeedName: CGFloat = 0.0

View File

@ -22,6 +22,8 @@
5183CCDD226F1F5C0010922C /* NavigationProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5183CCDC226F1F5C0010922C /* NavigationProgressView.swift */; };
5183CCDF226F1FCC0010922C /* UINavigationController+Progress.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5183CCDE226F1FCC0010922C /* UINavigationController+Progress.swift */; };
5183CCE3226F314C0010922C /* ProgressTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5183CCE2226F314C0010922C /* ProgressTableViewController.swift */; };
5183CCE5226F4DFA0010922C /* RefreshInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5183CCE4226F4DFA0010922C /* RefreshInterval.swift */; };
5183CCE6226F4E110010922C /* RefreshInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5183CCE4226F4DFA0010922C /* RefreshInterval.swift */; };
519B8D332143397200FA689C /* SharingServiceDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 519B8D322143397200FA689C /* SharingServiceDelegate.swift */; };
51C451A9226377C200C03939 /* ArticlesDatabase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8407167F2262A61100344432 /* ArticlesDatabase.framework */; };
51C451AA226377C200C03939 /* ArticlesDatabase.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8407167F2262A61100344432 /* ArticlesDatabase.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@ -617,6 +619,7 @@
5183CCDC226F1F5C0010922C /* NavigationProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationProgressView.swift; sourceTree = "<group>"; };
5183CCDE226F1FCC0010922C /* UINavigationController+Progress.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UINavigationController+Progress.swift"; sourceTree = "<group>"; };
5183CCE2226F314C0010922C /* ProgressTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressTableViewController.swift; sourceTree = "<group>"; };
5183CCE4226F4DFA0010922C /* RefreshInterval.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RefreshInterval.swift; sourceTree = "<group>"; };
519B8D322143397200FA689C /* SharingServiceDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharingServiceDelegate.swift; sourceTree = "<group>"; };
51C4524E226506F400C03939 /* UIStoryboard-Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIStoryboard-Extensions.swift"; sourceTree = "<group>"; };
51C4524F226506F400C03939 /* UIImage-Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage-Extensions.swift"; sourceTree = "<group>"; };
@ -1217,6 +1220,7 @@
isa = PBXGroup;
children = (
849A97581ED9EB0D007D329B /* ArticleUtilities.swift */,
5183CCE4226F4DFA0010922C /* RefreshInterval.swift */,
84411E701FE5FBFA004B527F /* SmallIconProvider.swift */,
);
path = Data;
@ -2182,6 +2186,7 @@
51C45292226509C800C03939 /* TodayFeedDelegate.swift in Sources */,
84F3EE1B20DEC97E003FADEB /* HTMLFeedFinder.swift in Sources */,
51C452A222650A1900C03939 /* RSHTMLMetadata+Extension.swift in Sources */,
5183CCE5226F4DFA0010922C /* RefreshInterval.swift in Sources */,
51C4529D22650A1000C03939 /* FaviconURLFinder.swift in Sources */,
51C45258226508CF00C03939 /* AppAssets.swift in Sources */,
51C4527C2265091600C03939 /* MasterTimelineCellLayout.swift in Sources */,
@ -2314,6 +2319,7 @@
84C9FC7A22629E1200D921D6 /* AccountsTableViewBackgroundView.swift in Sources */,
8426119E1FCB6ED40086A189 /* HTMLMetadataDownloader.swift in Sources */,
849A976E1ED9EBC8007D329B /* TimelineViewController.swift in Sources */,
5183CCE6226F4E110010922C /* RefreshInterval.swift in Sources */,
849A97771ED9EC04007D329B /* TimelineCellData.swift in Sources */,
841ABA6020145EC100980E11 /* BuiltinSmartFeedInspectorViewController.swift in Sources */,
D5E4CC54202C1361009B4FFC /* AppDelegate+Scriptability.swift in Sources */,

View File

@ -0,0 +1,38 @@
//
// RefreshInterval.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 4/23/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import Foundation
enum RefreshInterval: Int {
case manually = 1
case every10Minutes = 2
case every30Minutes = 3
case everyHour = 4
case every2Hours = 5
case every4Hours = 6
case every8Hours = 7
func inSeconds() -> TimeInterval {
switch self {
case .manually:
return 0
case .every10Minutes:
return 10 * 60
case .every30Minutes:
return 30 * 60
case .everyHour:
return 60 * 60
case .every2Hours:
return 2 * 60 * 60
case .every4Hours:
return 4 * 60 * 60
case .every8Hours:
return 8 * 60 * 60
}
}
}

View File

@ -8,35 +8,6 @@
import UIKit
enum RefreshInterval: Int {
case manually = 1
case every10Minutes = 2
case every30Minutes = 3
case everyHour = 4
case every2Hours = 5
case every4Hours = 6
case every8Hours = 7
func inSeconds() -> TimeInterval {
switch self {
case .manually:
return 0
case .every10Minutes:
return 10 * 60
case .every30Minutes:
return 30 * 60
case .everyHour:
return 60 * 60
case .every2Hours:
return 2 * 60 * 60
case .every4Hours:
return 4 * 60 * 60
case .every8Hours:
return 8 * 60 * 60
}
}
}
struct AppDefaults {
struct Key {