Start Accounts preferences pane.
This commit is contained in:
parent
70bc4a7b45
commit
3fdc55d605
@ -299,6 +299,8 @@
|
||||
84CC88181FE59CBF00644329 /* SmartFeedsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CC88171FE59CBF00644329 /* SmartFeedsController.swift */; };
|
||||
84D52E951FE588BB00D14F5B /* DetailStatusBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D52E941FE588BB00D14F5B /* DetailStatusBarView.swift */; };
|
||||
84DAEE301F86CAFE0058304B /* OPMLImporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DAEE2F1F86CAFE0058304B /* OPMLImporter.swift */; };
|
||||
84E01AFD223F3050009D63C3 /* AccountsPreferencesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E01AFC223F3050009D63C3 /* AccountsPreferencesViewController.swift */; };
|
||||
84E01AFE223F3050009D63C3 /* AccountsPreferencesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E01AFC223F3050009D63C3 /* AccountsPreferencesViewController.swift */; };
|
||||
84E185B3203B74E500F69BFA /* SingleLineTextFieldSizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E185B2203B74E500F69BFA /* SingleLineTextFieldSizer.swift */; };
|
||||
84E185C3203BB12600F69BFA /* MultilineTextFieldSizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E185C2203BB12600F69BFA /* MultilineTextFieldSizer.swift */; };
|
||||
84E46C7D1F75EF7B005ECFB3 /* AppDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E46C7C1F75EF7B005ECFB3 /* AppDefaults.swift */; };
|
||||
@ -898,6 +900,7 @@
|
||||
84CC88171FE59CBF00644329 /* SmartFeedsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SmartFeedsController.swift; sourceTree = "<group>"; };
|
||||
84D52E941FE588BB00D14F5B /* DetailStatusBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailStatusBarView.swift; sourceTree = "<group>"; };
|
||||
84DAEE2F1F86CAFE0058304B /* OPMLImporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OPMLImporter.swift; sourceTree = "<group>"; };
|
||||
84E01AFC223F3050009D63C3 /* AccountsPreferencesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AccountsPreferencesViewController.swift; path = NetNewsWire/Preferences/AccountsPreferencesViewController.swift; sourceTree = "<group>"; };
|
||||
84E185B2203B74E500F69BFA /* SingleLineTextFieldSizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SingleLineTextFieldSizer.swift; sourceTree = "<group>"; };
|
||||
84E185C2203BB12600F69BFA /* MultilineTextFieldSizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultilineTextFieldSizer.swift; sourceTree = "<group>"; };
|
||||
84E46C7C1F75EF7B005ECFB3 /* AppDefaults.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDefaults.swift; path = NetNewsWire/AppDefaults.swift; sourceTree = "<group>"; };
|
||||
@ -1125,6 +1128,7 @@
|
||||
849A97A41ED9F94D007D329B /* Preferences.storyboard */,
|
||||
849A97841ED9ECCD007D329B /* PreferencesWindowController.swift */,
|
||||
84754C89213E471B009CFDFB /* GeneralPrefencesViewController.swift */,
|
||||
84E01AFC223F3050009D63C3 /* AccountsPreferencesViewController.swift */,
|
||||
84595CA121E9C880003E15A4 /* AdvancedPreferencesViewController.swift */,
|
||||
);
|
||||
name = Preferences;
|
||||
@ -2487,6 +2491,7 @@
|
||||
840F7C8321BDA4B40057E851 /* Feed+Scriptability.swift in Sources */,
|
||||
840F7C8421BDA4B40057E851 /* AuthorAvatarDownloader.swift in Sources */,
|
||||
840F7C8521BDA4B40057E851 /* SingleLineTextFieldSizer.swift in Sources */,
|
||||
84E01AFE223F3050009D63C3 /* AccountsPreferencesViewController.swift in Sources */,
|
||||
840F7C8721BDA4B40057E851 /* TimelineTableCellView.swift in Sources */,
|
||||
840F7C8821BDA4B40057E851 /* TimelineCellAppearance.swift in Sources */,
|
||||
840F7C8921BDA4B40057E851 /* InitialFeedDownloader.swift in Sources */,
|
||||
@ -2556,6 +2561,7 @@
|
||||
84FF69B11FC3793300DC198E /* FaviconURLFinder.swift in Sources */,
|
||||
84B7178C201E66580091657D /* SidebarViewController+ContextualMenus.swift in Sources */,
|
||||
842611A21FCB769D0086A189 /* RSHTMLMetadata+Extension.swift in Sources */,
|
||||
84E01AFD223F3050009D63C3 /* AccountsPreferencesViewController.swift in Sources */,
|
||||
84A1500520048DDF0046AD9A /* SendToMarsEditCommand.swift in Sources */,
|
||||
D5907DB22004BB37005947E5 /* ScriptingObjectContainer.swift in Sources */,
|
||||
849A978A1ED9ECEF007D329B /* ArticleStylesManager.swift in Sources */,
|
||||
|
@ -244,7 +244,123 @@
|
||||
<customObject id="VX1-M3-K0J" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
<userDefaultsController id="Y8q-yi-F5Z"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-327" y="739.5"/>
|
||||
<point key="canvasLocation" x="-588" y="391"/>
|
||||
</scene>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="Rsj-41-ZOj">
|
||||
<objects>
|
||||
<viewController storyboardIdentifier="Accounts" id="z5c-Js-Up9" sceneMemberID="viewController">
|
||||
<view key="view" id="GrE-GP-fYK">
|
||||
<rect key="frame" x="0.0" y="0.0" width="450" height="300"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<scrollView fixedFrame="YES" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PaF-du-r3c">
|
||||
<rect key="frame" x="0.0" y="26" width="120" height="254"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<clipView key="contentView" ambiguous="YES" id="cil-Gq-akO">
|
||||
<rect key="frame" x="1" y="0.0" width="118" height="253"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" headerView="WwB-Kb-4u2" viewBased="YES" id="aTp-KR-y6b">
|
||||
<rect key="frame" x="0.0" y="0.0" width="162" height="228"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<size key="intercellSpacing" width="3" height="2"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
||||
<tableColumns>
|
||||
<tableColumn width="116" minWidth="40" maxWidth="1000" id="JSx-yi-vwt">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||
</tableHeaderCell>
|
||||
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="Djh-3Q-J0Q">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||
<prototypeCellViews>
|
||||
<tableCellView id="8VZ-UT-iWO">
|
||||
<rect key="frame" x="1" y="1" width="116" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Wdt-GB-ChP">
|
||||
<rect key="frame" x="0.0" y="0.0" width="116" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="I4c-cw-DCs">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<connections>
|
||||
<outlet property="textField" destination="Wdt-GB-ChP" id="6iB-Dq-mX3"/>
|
||||
</connections>
|
||||
</tableCellView>
|
||||
</prototypeCellViews>
|
||||
</tableColumn>
|
||||
<tableColumn width="40" minWidth="40" maxWidth="1000" id="xee-5k-72S">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||
</tableHeaderCell>
|
||||
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="RKE-ao-CJJ">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||
<prototypeCellViews>
|
||||
<tableCellView id="9bY-7u-Y4C">
|
||||
<rect key="frame" x="120" y="1" width="40" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="QPg-fE-cJX">
|
||||
<rect key="frame" x="0.0" y="0.0" width="40" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="Fkh-IJ-OSm">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<connections>
|
||||
<outlet property="textField" destination="QPg-fE-cJX" id="HXN-x8-U7C"/>
|
||||
</connections>
|
||||
</tableCellView>
|
||||
</prototypeCellViews>
|
||||
</tableColumn>
|
||||
</tableColumns>
|
||||
</tableView>
|
||||
</subviews>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="lI8-9e-8AE">
|
||||
<rect key="frame" x="1" y="237" width="118" height="16"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="DEk-lm-vvo">
|
||||
<rect key="frame" x="224" y="17" width="15" height="102"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<tableHeaderView key="headerView" id="WwB-Kb-4u2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="162" height="25"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</tableHeaderView>
|
||||
</scrollView>
|
||||
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Y7D-xQ-wep">
|
||||
<rect key="frame" x="164" y="143" width="163" height="96"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
</customView>
|
||||
</subviews>
|
||||
</view>
|
||||
</viewController>
|
||||
<customObject id="AgZ-2t-A2h" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-568" y="727"/>
|
||||
</scene>
|
||||
<!--Container-->
|
||||
<scene sceneID="fzS-hg-3TF">
|
||||
|
@ -0,0 +1,9 @@
|
||||
//
|
||||
// AccountsPreferencesViewController.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Brent Simmons on 3/17/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
@ -23,6 +23,7 @@ private struct PreferencesToolbarItemSpec {
|
||||
|
||||
private struct ToolbarItemIdentifier {
|
||||
static let General = "General"
|
||||
static let Accounts = "Accounts"
|
||||
static let Advanced = "Advanced"
|
||||
}
|
||||
|
||||
@ -34,12 +35,12 @@ class PreferencesWindowController : NSWindowController, NSToolbarDelegate {
|
||||
private let toolbarItemSpecs: [PreferencesToolbarItemSpec] = {
|
||||
var specs = [PreferencesToolbarItemSpec]()
|
||||
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.General, name: NSLocalizedString("General", comment: "Preferences"), imageName: NSImage.preferencesGeneralName)]
|
||||
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Accounts, name: NSLocalizedString("Accounts", comment: "Preferences"), imageName: NSImage.userAccountsName)]
|
||||
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Advanced, name: NSLocalizedString("Advanced", comment: "Preferences"), imageName: NSImage.advancedName)]
|
||||
return specs
|
||||
}()
|
||||
|
||||
override func windowDidLoad() {
|
||||
|
||||
let toolbar = NSToolbar(identifier: NSToolbar.Identifier("PreferencesToolbar"))
|
||||
toolbar.delegate = self
|
||||
toolbar.autosavesConfiguration = false
|
||||
@ -83,17 +84,14 @@ class PreferencesWindowController : NSWindowController, NSToolbarDelegate {
|
||||
}
|
||||
|
||||
func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
|
||||
|
||||
return toolbarItemSpecs.map { $0.identifier }
|
||||
}
|
||||
|
||||
func toolbarAllowedItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
|
||||
|
||||
return toolbarDefaultItemIdentifiers(toolbar)
|
||||
}
|
||||
|
||||
func toolbarSelectableItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
|
||||
|
||||
return toolbarDefaultItemIdentifiers(toolbar)
|
||||
}
|
||||
}
|
||||
@ -105,18 +103,15 @@ private extension PreferencesWindowController {
|
||||
}
|
||||
|
||||
func toolbarItemSpec(for identifier: String) -> PreferencesToolbarItemSpec? {
|
||||
|
||||
return toolbarItemSpecs.first(where: { $0.identifier.rawValue == identifier })
|
||||
}
|
||||
|
||||
func switchToViewAtIndex(_ index: Int) {
|
||||
|
||||
let identifier = toolbarItemSpecs[index].identifier
|
||||
switchToView(identifier: identifier.rawValue)
|
||||
}
|
||||
|
||||
func switchToView(identifier: String) {
|
||||
|
||||
guard let toolbarItemSpec = toolbarItemSpec(for: identifier) else {
|
||||
assertionFailure("Preferences window: no toolbarItemSpec matching \(identifier).")
|
||||
return
|
||||
@ -149,7 +144,6 @@ private extension PreferencesWindowController {
|
||||
}
|
||||
|
||||
func viewController(identifier: String) -> NSViewController? {
|
||||
|
||||
if let cachedViewController = viewControllers[identifier] {
|
||||
return cachedViewController
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user