forked from shadowfacts/Tusker
Remove old XCB code
This commit is contained in:
parent
22022f5ef6
commit
ffb0ceba20
|
@ -10,7 +10,6 @@
|
|||
0411610022B442870030A9B7 /* LoadingLargeImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041160FE22B442870030A9B7 /* LoadingLargeImageViewController.swift */; };
|
||||
0427033822B30F5F000D31B6 /* BehaviorPrefsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0427033722B30F5F000D31B6 /* BehaviorPrefsView.swift */; };
|
||||
0427033A22B31269000D31B6 /* AdvancedPrefsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0427033922B31269000D31B6 /* AdvancedPrefsView.swift */; };
|
||||
0427037C22B316B9000D31B6 /* SilentActionPrefs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0427037B22B316B9000D31B6 /* SilentActionPrefs.swift */; };
|
||||
0450531F22B0097E00100BA2 /* Timline+UI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0450531E22B0097E00100BA2 /* Timline+UI.swift */; };
|
||||
04586B4122B2FFB10021BD04 /* PreferencesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04586B4022B2FFB10021BD04 /* PreferencesView.swift */; };
|
||||
04586B4322B301470021BD04 /* AppearancePrefsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04586B4222B301470021BD04 /* AppearancePrefsView.swift */; };
|
||||
|
@ -365,7 +364,6 @@
|
|||
041160FE22B442870030A9B7 /* LoadingLargeImageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingLargeImageViewController.swift; sourceTree = "<group>"; };
|
||||
0427033722B30F5F000D31B6 /* BehaviorPrefsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BehaviorPrefsView.swift; sourceTree = "<group>"; };
|
||||
0427033922B31269000D31B6 /* AdvancedPrefsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedPrefsView.swift; sourceTree = "<group>"; };
|
||||
0427037B22B316B9000D31B6 /* SilentActionPrefs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SilentActionPrefs.swift; sourceTree = "<group>"; };
|
||||
0450531E22B0097E00100BA2 /* Timline+UI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Timline+UI.swift"; sourceTree = "<group>"; };
|
||||
04586B4022B2FFB10021BD04 /* PreferencesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferencesView.swift; sourceTree = "<group>"; };
|
||||
04586B4222B301470021BD04 /* AppearancePrefsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppearancePrefsView.swift; sourceTree = "<group>"; };
|
||||
|
@ -1019,7 +1017,6 @@
|
|||
D68015412401A74600D6103B /* MediaPrefsView.swift */,
|
||||
D6BC9DB2232D4C07002CA326 /* WellnessPrefsView.swift */,
|
||||
0427033922B31269000D31B6 /* AdvancedPrefsView.swift */,
|
||||
0427037B22B316B9000D31B6 /* SilentActionPrefs.swift */,
|
||||
D67895BF246870DE00D4CD9E /* LocalAccountAvatarView.swift */,
|
||||
);
|
||||
path = Preferences;
|
||||
|
@ -1978,7 +1975,6 @@
|
|||
D65234D325618EFA001AF9CF /* TimelineTableViewController.swift in Sources */,
|
||||
D68E6F5F253C9B2D001A1B4C /* BaseEmojiLabel.swift in Sources */,
|
||||
D6F0B12B24A3071C001E48C3 /* MainSplitViewController.swift in Sources */,
|
||||
0427037C22B316B9000D31B6 /* SilentActionPrefs.swift in Sources */,
|
||||
D6AEBB3E2321638100E5038B /* UIActivity+Types.swift in Sources */,
|
||||
D61AC1D5232E9FA600C54D2D /* InstanceSelectorTableViewController.swift in Sources */,
|
||||
D681E4D9246E346E0053414F /* AccountActivityItemSource.swift in Sources */,
|
||||
|
|
|
@ -67,7 +67,6 @@ class Preferences: Codable, ObservableObject {
|
|||
self.disableInfiniteScrolling = try container.decodeIfPresent(Bool.self, forKey: .disableInfiniteScrolling) ?? false
|
||||
self.hideDiscover = try container.decodeIfPresent(Bool.self, forKey: .hideDiscover) ?? false
|
||||
|
||||
self.silentActions = try container.decode([String: Permission].self, forKey: .silentActions)
|
||||
self.statusContentType = try container.decode(StatusContentType.self, forKey: .statusContentType)
|
||||
|
||||
self.hasShownLocalTimelineDescription = try container.decodeIfPresent(Bool.self, forKey: .hasShownLocalTimelineDescription) ?? false
|
||||
|
@ -107,7 +106,6 @@ class Preferences: Codable, ObservableObject {
|
|||
try container.encode(disableInfiniteScrolling, forKey: .disableInfiniteScrolling)
|
||||
try container.encode(hideDiscover, forKey: .hideDiscover)
|
||||
|
||||
try container.encode(silentActions, forKey: .silentActions)
|
||||
try container.encode(statusContentType, forKey: .statusContentType)
|
||||
|
||||
try container.encode(hasShownLocalTimelineDescription, forKey: .hasShownLocalTimelineDescription)
|
||||
|
@ -150,7 +148,6 @@ class Preferences: Codable, ObservableObject {
|
|||
@Published var hideDiscover = false
|
||||
|
||||
// MARK: Advanced
|
||||
@Published var silentActions: [String: Permission] = [:]
|
||||
@Published var statusContentType: StatusContentType = .plain
|
||||
|
||||
// MARK:
|
||||
|
@ -188,7 +185,6 @@ class Preferences: Codable, ObservableObject {
|
|||
case disableInfiniteScrolling
|
||||
case hideDiscover
|
||||
|
||||
case silentActions
|
||||
case statusContentType
|
||||
|
||||
case hasShownLocalTimelineDescription
|
||||
|
@ -197,10 +193,4 @@ class Preferences: Codable, ObservableObject {
|
|||
|
||||
}
|
||||
|
||||
extension Preferences {
|
||||
enum Permission: String, Codable {
|
||||
case undecided, accepted, rejected
|
||||
}
|
||||
}
|
||||
|
||||
extension UIUserInterfaceStyle: Codable {}
|
||||
|
|
|
@ -14,7 +14,6 @@ struct AdvancedPrefsView : View {
|
|||
var body: some View {
|
||||
List {
|
||||
formattingSection
|
||||
automationSection
|
||||
cachingSection
|
||||
}
|
||||
.listStyle(InsetGroupedListStyle())
|
||||
|
@ -36,14 +35,6 @@ struct AdvancedPrefsView : View {
|
|||
}
|
||||
}
|
||||
|
||||
var automationSection: some View {
|
||||
Section(header: Text("Automation")) {
|
||||
NavigationLink(destination: SilentActionPrefs()) {
|
||||
Text("Silent Action Permissions")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var cachingSection: some View {
|
||||
Section(header: Text("Caching"), footer: Text("Clearing caches will restart the app.")) {
|
||||
Button(action: clearCache) {
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
// SilentActionPrefs.swift
|
||||
// Tusker
|
||||
//
|
||||
// Created by Shadowfacts on 6/13/19.
|
||||
// Copyright © 2019 Shadowfacts. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct SilentActionPrefs : View {
|
||||
@ObservedObject var preferences = Preferences.shared
|
||||
|
||||
var body: some View {
|
||||
List(Array(preferences.silentActions.keys), id: \.self) { source in
|
||||
SilentActionPermissionCell(source: source)
|
||||
}
|
||||
.listStyle(InsetGroupedListStyle())
|
||||
// .navigationBarTitle("Silent Action Permissions")
|
||||
// see FB6838291
|
||||
}
|
||||
}
|
||||
|
||||
struct SilentActionPermissionCell: View {
|
||||
@ObservedObject var preferences = Preferences.shared
|
||||
let source: String
|
||||
|
||||
var body: some View {
|
||||
Toggle(isOn: Binding(get: {
|
||||
self.preferences.silentActions[self.source] == .accepted
|
||||
}, set: {
|
||||
self.preferences.silentActions[self.source] = $0 ? .accepted : .rejected
|
||||
})) {
|
||||
Text(verbatim: source)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
struct SilentActionPrefs_Previews : PreviewProvider {
|
||||
static var previews: some View {
|
||||
SilentActionPrefs().environmentObject(Preferences.shared)
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -1,13 +0,0 @@
|
|||
//
|
||||
// XCBSessionType.swift
|
||||
// Tusker
|
||||
//
|
||||
// Created by Shadowfacts on 9/23/18.
|
||||
// Copyright © 2018 Shadowfacts. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum XCBSessionType {
|
||||
case postStatus
|
||||
}
|
Loading…
Reference in New Issue