Skip to content

Commit

Permalink
FranzCocoa: rename Preferences to Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdanp committed Mar 20, 2024
1 parent 02b7ea8 commit 3689d60
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 52 deletions.
24 changes: 12 additions & 12 deletions FranzCocoa.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
43CDBAC22AE411A0003063D7 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 432C24622903F03B00C6F336 /* Error.swift */; };
43CDBAC32AE411A0003063D7 /* Identifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43D03DD728FB03940049D44D /* Identifiers.swift */; };
43CDBAC42AE411A0003063D7 /* WelcomeWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43CD623928CE27DB00095144 /* WelcomeWindowController.swift */; };
43CDBAC52AE411A0003063D7 /* PreferencesWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43D3AEA928FFDF3500D52E92 /* PreferencesWindowController.swift */; };
43CDBAC52AE411A0003063D7 /* SettingsWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43D3AEA928FFDF3500D52E92 /* SettingsWindowController.swift */; };
43CDBAC62AE411A0003063D7 /* WindowManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43CD623628CE27B200095144 /* WindowManager.swift */; };
43CDBAC72AE411A0003063D7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43CD621828CE24B000095144 /* AppDelegate.swift */; };
43CDBAC82AE411A0003063D7 /* AutoUpdater.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43F987A5292A81D400E5E1DE /* AutoUpdater.swift */; };
Expand Down Expand Up @@ -154,7 +154,7 @@
43CDBAF02AE411A0003063D7 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 43CD621C28CE24B100095144 /* MainMenu.xib */; };
43CDBAF12AE411A0003063D7 /* ConnectionTableCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 43804AB828D1A026002880FE /* ConnectionTableCellView.xib */; };
43CDBAF22AE411A0003063D7 /* HexViewerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 43B8DCC729546B200056E9FD /* HexViewerViewController.xib */; };
43CDBAF32AE411A0003063D7 /* PreferencesWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 43D3AEAA28FFDF3500D52E92 /* PreferencesWindowController.xib */; };
43CDBAF32AE411A0003063D7 /* SettingsWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 43D3AEAA28FFDF3500D52E92 /* SettingsWindowController.xib */; };
43CDBAF42AE411A0003063D7 /* DataViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 435EBE5429542E7C00DCFEBF /* DataViewController.xib */; };
43CDBAF52AE411A0003063D7 /* TopicRecordsTableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 437A77DE290D5AA1001965B0 /* TopicRecordsTableViewController.xib */; };
43CDBAF62AE411A0003063D7 /* RecordWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 43B3C0712952FFFF00E0289C /* RecordWindowController.xib */; };
Expand All @@ -168,8 +168,8 @@
43D03DD828FB03940049D44D /* Identifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43D03DD728FB03940049D44D /* Identifiers.swift */; };
43D3AEA628FFD8D100D52E92 /* Pasteboard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43D3AEA528FFD8D100D52E92 /* Pasteboard.swift */; };
43D3AEA828FFD96500D52E92 /* Defaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43D3AEA728FFD96500D52E92 /* Defaults.swift */; };
43D3AEAB28FFDF3500D52E92 /* PreferencesWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43D3AEA928FFDF3500D52E92 /* PreferencesWindowController.swift */; };
43D3AEAC28FFDF3500D52E92 /* PreferencesWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 43D3AEAA28FFDF3500D52E92 /* PreferencesWindowController.xib */; };
43D3AEAB28FFDF3500D52E92 /* SettingsWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43D3AEA928FFDF3500D52E92 /* SettingsWindowController.swift */; };
43D3AEAC28FFDF3500D52E92 /* SettingsWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 43D3AEAA28FFDF3500D52E92 /* SettingsWindowController.xib */; };
43DF30722B0FC9AC00308269 /* JumpToLineWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43DF30702B0FC9AC00308269 /* JumpToLineWindowController.swift */; };
43DF30732B0FC9AC00308269 /* JumpToLineWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43DF30702B0FC9AC00308269 /* JumpToLineWindowController.swift */; };
43DF30742B0FC9AC00308269 /* JumpToLineWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 43DF30712B0FC9AC00308269 /* JumpToLineWindowController.xib */; };
Expand Down Expand Up @@ -274,8 +274,8 @@
43D03DD728FB03940049D44D /* Identifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Identifiers.swift; sourceTree = "<group>"; };
43D3AEA528FFD8D100D52E92 /* Pasteboard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pasteboard.swift; sourceTree = "<group>"; };
43D3AEA728FFD96500D52E92 /* Defaults.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Defaults.swift; sourceTree = "<group>"; };
43D3AEA928FFDF3500D52E92 /* PreferencesWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferencesWindowController.swift; sourceTree = "<group>"; };
43D3AEAA28FFDF3500D52E92 /* PreferencesWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PreferencesWindowController.xib; sourceTree = "<group>"; };
43D3AEA928FFDF3500D52E92 /* SettingsWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsWindowController.swift; sourceTree = "<group>"; };
43D3AEAA28FFDF3500D52E92 /* SettingsWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SettingsWindowController.xib; sourceTree = "<group>"; };
43DF30702B0FC9AC00308269 /* JumpToLineWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JumpToLineWindowController.swift; sourceTree = "<group>"; };
43DF30712B0FC9AC00308269 /* JumpToLineWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = JumpToLineWindowController.xib; sourceTree = "<group>"; };
43E5AE8B291245E000C74966 /* DispatchQueue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DispatchQueue.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -391,8 +391,6 @@
431C698128F2E0C60082986A /* NewTopicFormViewController.xib */,
43D03DD528FAFE3B0049D44D /* Notifications.swift */,
43D3AEA528FFD8D100D52E92 /* Pasteboard.swift */,
43D3AEA928FFDF3500D52E92 /* PreferencesWindowController.swift */,
43D3AEAA28FFDF3500D52E92 /* PreferencesWindowController.xib */,
43CBADD2290FB8D70066C7CE /* PublishRecordFormViewController.swift */,
43CBADD3290FB8D70066C7CE /* PublishRecordFormViewController.xib */,
43B3C06C2952FB9000E0289C /* RecordDetailViewController.swift */,
Expand All @@ -408,6 +406,8 @@
432244EC2B187CDB0012E013 /* SchemaEditorToolbarController.xib */,
43E64A062928F2BF00FDBF29 /* ScriptWindowController.swift */,
43E64A072928F2BF00FDBF29 /* ScriptWindowController.xib */,
43D3AEA928FFDF3500D52E92 /* SettingsWindowController.swift */,
43D3AEAA28FFDF3500D52E92 /* SettingsWindowController.xib */,
436E720C28D760BF00ECBF49 /* SidebarEntryCellView.swift */,
436E720E28D760D400ECBF49 /* SidebarEntryCellView.xib */,
4314EDF728D85E0E00431770 /* SidebarGroupCellView.swift */,
Expand Down Expand Up @@ -601,7 +601,7 @@
43804AB928D1A026002880FE /* ConnectionTableCellView.xib in Resources */,
43B8DCC929546B200056E9FD /* HexViewerViewController.xib in Resources */,
43DF30742B0FC9AC00308269 /* JumpToLineWindowController.xib in Resources */,
43D3AEAC28FFDF3500D52E92 /* PreferencesWindowController.xib in Resources */,
43D3AEAC28FFDF3500D52E92 /* SettingsWindowController.xib in Resources */,
435EBE5629542E7C00DCFEBF /* DataViewController.xib in Resources */,
437A77E0290D5AA1001965B0 /* TopicRecordsTableViewController.xib in Resources */,
43B3C0732952FFFF00E0289C /* RecordWindowController.xib in Resources */,
Expand Down Expand Up @@ -637,7 +637,7 @@
43CDBAF12AE411A0003063D7 /* ConnectionTableCellView.xib in Resources */,
43CDBAF22AE411A0003063D7 /* HexViewerViewController.xib in Resources */,
43DF30752B0FC9AC00308269 /* JumpToLineWindowController.xib in Resources */,
43CDBAF32AE411A0003063D7 /* PreferencesWindowController.xib in Resources */,
43CDBAF32AE411A0003063D7 /* SettingsWindowController.xib in Resources */,
43CDBAF42AE411A0003063D7 /* DataViewController.xib in Resources */,
43CDBAF52AE411A0003063D7 /* TopicRecordsTableViewController.xib in Resources */,
43CDBAF62AE411A0003063D7 /* RecordWindowController.xib in Resources */,
Expand Down Expand Up @@ -771,7 +771,7 @@
432244F82B18DB760012E013 /* NewSchemaForm.swift in Sources */,
43D03DD828FB03940049D44D /* Identifiers.swift in Sources */,
43CD623B28CE27DB00095144 /* WelcomeWindowController.swift in Sources */,
43D3AEAB28FFDF3500D52E92 /* PreferencesWindowController.swift in Sources */,
43D3AEAB28FFDF3500D52E92 /* SettingsWindowController.swift in Sources */,
43CD623728CE27B200095144 /* WindowManager.swift in Sources */,
43CD621928CE24B000095144 /* AppDelegate.swift in Sources */,
43F987A6292A81D400E5E1DE /* AutoUpdater.swift in Sources */,
Expand Down Expand Up @@ -831,7 +831,7 @@
432244F92B18DB760012E013 /* NewSchemaForm.swift in Sources */,
43CDBAC32AE411A0003063D7 /* Identifiers.swift in Sources */,
43CDBAC42AE411A0003063D7 /* WelcomeWindowController.swift in Sources */,
43CDBAC52AE411A0003063D7 /* PreferencesWindowController.swift in Sources */,
43CDBAC52AE411A0003063D7 /* SettingsWindowController.swift in Sources */,
43CDBAC62AE411A0003063D7 /* WindowManager.swift in Sources */,
43CDBAC72AE411A0003063D7 /* AppDelegate.swift in Sources */,
43CDBAC82AE411A0003063D7 /* AutoUpdater.swift in Sources */,
Expand Down
4 changes: 2 additions & 2 deletions FranzCocoa/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
WindowManager.shared.showWelcomeWindow()
}

@IBAction func didPushPreferencesButton(_ sender: Any) {
WindowManager.shared.showPreferencesWindow()
@IBAction func didPushSettingsButton(_ sender: Any) {
WindowManager.shared.showSettingsWindow()
}

@IBAction func didPushManualButton(_ sender: Any) {
Expand Down
4 changes: 2 additions & 2 deletions FranzCocoa/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW">
<menuItem title="Settings..." keyEquivalent="," id="BOF-NM-1cW">
<connections>
<action selector="didPushPreferencesButton:" target="Voe-Tx-rLC" id="ILF-kf-5tw"/>
<action selector="didPushSettingsButton:" target="Voe-Tx-rLC" id="ILF-kf-5tw"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ import SwiftUI

fileprivate let logger = Logger(
subsystem: "io.defn.Franz",
category: "Preferences"
category: "Settings"
)

enum PreferencesTab: Int {
enum SettingsTab: Int {
case general = 0
case connections = 1
case license = 2
case updates = 3
}

class PreferencesWindowController: NSWindowController {
private lazy var tabController = PreferencesTabViewController()
class SettingsWindowController: NSWindowController {
private lazy var tabController = SettingsTabViewController()

convenience init() {
self.init(windowNibName: "PreferencesWindowController")
self.init(windowNibName: "SettingsWindowController")
}

override func windowDidLoad() {
Expand Down Expand Up @@ -61,16 +61,16 @@ class PreferencesWindowController: NSWindowController {
window?.center()
}

func display(tab: PreferencesTab) {
func display(tab: SettingsTab) {
tabController.selectedTabViewItemIndex = tab.rawValue
}
}

// MARK: - PreferencesTabViewDelegate
extension PreferencesWindowController: PreferencesTabViewDelegate {
func preferencesTabView(didSelectItem item: NSTabViewItem) {
// MARK: - SettingsTabViewDelegate
extension SettingsWindowController: SettingsTabViewDelegate {
func settingsTabView(didSelectItem item: NSTabViewItem) {
let index = tabController.tabView.indexOfTabViewItem(item)
guard let window, let tab = PreferencesTab(rawValue: index) else {
guard let window, let tab = SettingsTab(rawValue: index) else {
return
}

Expand All @@ -91,18 +91,18 @@ extension PreferencesWindowController: PreferencesTabViewDelegate {
}
}

// MARK: - PreferencesTabViewController
protocol PreferencesTabViewDelegate: AnyObject {
func preferencesTabView(didSelectItem item: NSTabViewItem)
// MARK: - SettingsTabViewController
protocol SettingsTabViewDelegate: AnyObject {
func settingsTabView(didSelectItem item: NSTabViewItem)
}

fileprivate class PreferencesTabViewController: NSTabViewController {
var delegate: PreferencesTabViewDelegate?
fileprivate class SettingsTabViewController: NSTabViewController {
var delegate: SettingsTabViewDelegate?

override func tabView(_ tabView: NSTabView, didSelect tabViewItem: NSTabViewItem?) {
super.tabView(tabView, didSelect: tabViewItem)
guard let item = tabViewItem else { return }
delegate?.preferencesTabView(didSelectItem: item)
delegate?.settingsTabView(didSelectItem: item)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="PreferencesWindowController" customModule="Franz" customModuleProvider="target">
<customObject id="-2" userLabel="File's Owner" customClass="SettingsWindowController" customModule="Franz" customModuleProvider="target">
<connections>
<outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5" userLabel="Preferences">
<window title="Settings" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5" userLabel="Settings">
<windowStyleMask key="styleMask" titled="YES" closable="YES" fullSizeContentView="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="600" height="200"/>
Expand Down
6 changes: 3 additions & 3 deletions FranzCocoa/WelcomeWindowConnectionsViewController.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand Down Expand Up @@ -63,7 +63,7 @@
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="VHb-QH-bbw">
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="VHb-QH-bbw">
<rect key="frame" x="-2" y="171" width="284" height="19"/>
<constraints>
<constraint firstAttribute="width" constant="280" id="Ada-1d-U4c"/>
Expand Down
2 changes: 1 addition & 1 deletion FranzCocoa/WelcomeWindowContentViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ class WelcomeWindowContentViewController: NSViewController {

@IBAction func didPushTrialButton(_ sender: Any) {
WindowManager.shared.closeWelcomeWindow()
WindowManager.shared.showPreferencesWindow(selectingTab: .license)
WindowManager.shared.showSettingsWindow(selectingTab: .license)
}
}
16 changes: 8 additions & 8 deletions FranzCocoa/WindowManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class WindowManager {
static var shared = WindowManager()

private var welcomeWindowController: WelcomeWindowController?
private var preferencesWindowController: PreferencesWindowController?
private var settingsWindowController: SettingsWindowController?
private var updatesWindowController: UpdatesWindowController?
private var updatesProgressWindowController: UpdatesProgressWindowController?
private var jumpToLineWindowController: JumpToLineWindowController?
Expand Down Expand Up @@ -92,14 +92,14 @@ class WindowManager {
welcomeWindowController = nil
}

func showPreferencesWindow(selectingTab tab: PreferencesTab = .general) {
func showSettingsWindow(selectingTab tab: SettingsTab = .general) {
assert(Thread.isMainThread)
if preferencesWindowController == nil {
preferencesWindowController = PreferencesWindowController()
if settingsWindowController == nil {
settingsWindowController = SettingsWindowController()
}
preferencesWindowController?.window?.center()
preferencesWindowController?.showWindow(self)
preferencesWindowController?.display(tab: tab)
settingsWindowController?.window?.center()
settingsWindowController?.showWindow(self)
settingsWindowController?.display(tab: tab)
}

func showScriptWindow(
Expand Down Expand Up @@ -195,7 +195,7 @@ class WindowManager {
return true
}

showPreferencesWindow(selectingTab: .license)
showSettingsWindow(selectingTab: .license)
return false
}

Expand Down
8 changes: 4 additions & 4 deletions manual/index.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ See @registry-yt{this YouTube video} for a live demo.
}

@defkbd[(cmd @",")]{
Opens the Preferences Window.
Opens the Settings Window.
}


Expand Down Expand Up @@ -390,7 +390,7 @@ See @registry-yt{this YouTube video} for a live demo.
}

@defkbd[(ctl @";")]{
Within a @tech{Workspace Window}, opens the Preferences Window.
Within a @tech{Workspace Window}, opens the Settings Window.
}


Expand Down Expand Up @@ -1212,8 +1212,8 @@ changed on a per-topic basis from the ``Options...'' popover in the
@section{Privacy}

Apart from when checking for updates, Franz never phones home for any
reason. Automatic Updates can be turned off from the Preferences
Window (@kbd[cmd @","]).
reason. Automatic Updates can be turned off from the Settings Window
(@kbd[cmd @","]).

@section{Credits}

Expand Down
4 changes: 4 additions & 0 deletions website/versions/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

* A "Test Connection" button to the connection info dialog.

## Changed

* macOS: "Preferences" has been renamed to "Settings".

# 2024.01.11 (Version 1.6, Build 2)
## Fixed

Expand Down

0 comments on commit 3689d60

Please sign in to comment.