mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-11-07 21:20:07 +01:00
♻️ Use WindowController instead of WC
- Renamed `ProgressWC` to `TerminalProgressWindowController` so it
better reflects the functionality of the class.
- Renamed all `-WC` suffixed classes to `-WindowController`. This is
cleaner because it avoids referencing water closets. 🚽
- Fixed some instances where the copyright notice used the wrong
filename. All window controller classes are now accurate.
This commit is contained in:
@@ -51,13 +51,13 @@ class App {
|
||||
var preferences: [PreferenceName: Bool]!
|
||||
|
||||
/** The window controller of the currently active preferences window. */
|
||||
var preferencesWindowController: PrefsWC?
|
||||
var preferencesWindowController: PreferencesWindowController?
|
||||
|
||||
/** The window controller of the currently active site list window. */
|
||||
var domainListWindowController: DomainListWC?
|
||||
var domainListWindowController: DomainListWindowController?
|
||||
|
||||
/** The window controller of the onboarding window. */
|
||||
var onboardingWindowController: OnboardingWC?
|
||||
var onboardingWindowController: OnboardingWindowController?
|
||||
|
||||
/** List of detected (installed) applications that PHP Monitor can work with. */
|
||||
var detectedApplications: [Application] = []
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="20037"/>
|
||||
<capability name="Image references" minToolsVersion="12.0"/>
|
||||
<capability name="Named colors" minToolsVersion="9.0"/>
|
||||
@@ -325,7 +324,7 @@
|
||||
<scene sceneID="PQa-AT-b2a">
|
||||
<objects>
|
||||
<customObject id="OF0-qs-3Oh" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
<windowController storyboardIdentifier="preferencesWindow" showSeguePresentationStyle="single" id="hLJ-Fd-wRr" customClass="PrefsWC" customModule="PHP_Monitor" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<windowController storyboardIdentifier="preferencesWindow" showSeguePresentationStyle="single" id="hLJ-Fd-wRr" customClass="PreferencesWindowController" customModule="PHP_Monitor" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="h4c-3b-nko">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
@@ -399,7 +398,7 @@
|
||||
<!--Window Controller-->
|
||||
<scene sceneID="4XS-kY-YIS">
|
||||
<objects>
|
||||
<windowController storyboardIdentifier="domainListWindow" id="8Ec-9q-82s" customClass="DomainListWC" customModule="PHP_Monitor" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<windowController storyboardIdentifier="domainListWindow" id="8Ec-9q-82s" customClass="DomainListWindowController" customModule="PHP_Monitor" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<window key="window" separatorStyle="line" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="raw-02-3Q1">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
@@ -819,7 +818,7 @@ Gw
|
||||
<rect key="frame" x="0.0" y="0.0" width="626" height="309"/>
|
||||
<clipView key="contentView" ambiguous="YES" drawsBackground="NO" id="6IL-DW-37w">
|
||||
<rect key="frame" x="0.0" y="0.0" width="626" height="309"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<tableView verticalHuggingPriority="750" ambiguous="YES" allowsExpansionToolTips="YES" multipleSelection="NO" autosaveName="phpmon-sitelist-columns" rowHeight="54" headerView="xUg-Mq-OSh" viewBased="YES" id="cp3-34-pQj">
|
||||
<rect key="frame" x="0.0" y="0.0" width="626" height="281"/>
|
||||
|
||||
@@ -236,7 +236,7 @@ class Startup {
|
||||
titleText: "startup.errors.valet_version_unknown.title".localized,
|
||||
subtitleText: "startup.errors.valet_version_unknown.subtitle".localized,
|
||||
descriptionText: "startup.errors.valet_version_unknown.desc".localized
|
||||
),
|
||||
)
|
||||
]
|
||||
|
||||
// MARK: - EnvironmentCheck struct
|
||||
|
||||
@@ -64,7 +64,7 @@ class DomainListVC: NSViewController, NSTableViewDelegate, NSTableViewDataSource
|
||||
|
||||
let windowController = storyboard.instantiateController(
|
||||
withIdentifier: "domainListWindow"
|
||||
) as! DomainListWC
|
||||
) as! DomainListWindowController
|
||||
|
||||
guard let window = windowController.window else { return }
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// DomainListWC.swift
|
||||
// DomainListWindowController.swift
|
||||
// PHP Monitor
|
||||
//
|
||||
// Created by Nico Verbruggen on 03/12/2021.
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
class DomainListWC: PMWindowController, NSSearchFieldDelegate, NSToolbarDelegate {
|
||||
class DomainListWindowController: PMWindowController, NSSearchFieldDelegate, NSToolbarDelegate {
|
||||
|
||||
// MARK: - Window Identifier
|
||||
|
||||
@@ -11,7 +11,7 @@ import Cocoa
|
||||
|
||||
class SelectionVC: NSViewController {
|
||||
|
||||
weak var domainListWC: DomainListWC?
|
||||
weak var domainListWC: DomainListWindowController?
|
||||
|
||||
@IBOutlet weak var textFieldTitle: NSTextField!
|
||||
@IBOutlet weak var textFieldDescription: NSTextField!
|
||||
|
||||
@@ -13,7 +13,7 @@ class ComposerWindow {
|
||||
private var menu: MainMenu?
|
||||
private var shouldNotify: Bool! = nil
|
||||
private var completion: ((Bool) -> Void)! = nil
|
||||
private var window: ProgressWC?
|
||||
private var window: TerminalProgressWindowController?
|
||||
|
||||
/**
|
||||
Updates the global dependencies and runs the completion callback when done.
|
||||
@@ -35,7 +35,7 @@ class ComposerWindow {
|
||||
menu?.setBusyImage()
|
||||
menu?.rebuild()
|
||||
|
||||
window = ProgressWC.display(
|
||||
window = TerminalProgressWindowController.display(
|
||||
title: "alert.composer_progress.title".localized,
|
||||
description: "alert.composer_progress.info".localized
|
||||
)
|
||||
|
||||
@@ -93,7 +93,7 @@ extension MainMenu {
|
||||
if Stats.successfulLaunchCount >= 1 && !isRunningSwiftUIPreview {
|
||||
Log.info("Should present the first launch screen!")
|
||||
DispatchQueue.main.async {
|
||||
OnboardingWC.show()
|
||||
OnboardingWindowController.show()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate, PhpSwitcherDelegate
|
||||
}
|
||||
|
||||
@objc func openPrefs() {
|
||||
PrefsWC.show()
|
||||
PreferencesWindowController.show()
|
||||
}
|
||||
|
||||
@objc func openDomainList() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// OnboardingWC.swift
|
||||
// OnboardingWindowController.swift
|
||||
// PHP Monitor
|
||||
//
|
||||
// Created by Nico Verbruggen on 25/06/2022.
|
||||
@@ -9,7 +9,7 @@
|
||||
import Cocoa
|
||||
import SwiftUI
|
||||
|
||||
class OnboardingWC: PMWindowController {
|
||||
class OnboardingWindowController: PMWindowController {
|
||||
|
||||
// MARK: - Window Identifier
|
||||
|
||||
@@ -18,7 +18,7 @@ class OnboardingWC: PMWindowController {
|
||||
}
|
||||
|
||||
public static func create(delegate: NSWindowDelegate?) {
|
||||
let windowController = OnboardingWC()
|
||||
let windowController = OnboardingWindowController()
|
||||
windowController.window = NSWindow()
|
||||
|
||||
guard let window = windowController.window else { return }
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// PrefsWC+Hotkey.swift
|
||||
// PreferencesWindowController+Hotkey.swift
|
||||
// PHP Monitor
|
||||
//
|
||||
// Created by Nico Verbruggen on 25/07/2022.
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
extension PrefsWC {
|
||||
extension PreferencesWindowController {
|
||||
|
||||
// MARK: - Key Interaction
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// PrefsWC.swift
|
||||
// PreferencesWindowController.swift
|
||||
// PHP Monitor
|
||||
//
|
||||
// Created by Nico Verbruggen on 02/04/2021.
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
class PrefsWC: PMWindowController {
|
||||
class PreferencesWindowController: PMWindowController {
|
||||
|
||||
// MARK: - Window Identifier
|
||||
|
||||
@@ -21,7 +21,7 @@ class PrefsWC: PMWindowController {
|
||||
|
||||
let windowController = storyboard.instantiateController(
|
||||
withIdentifier: "preferencesWindow"
|
||||
) as! PrefsWC
|
||||
) as! PreferencesWindowController
|
||||
|
||||
guard let window = windowController.window else { return }
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<!--Window Controller-->
|
||||
<scene sceneID="pUZ-6w-gUX">
|
||||
<objects>
|
||||
<windowController storyboardIdentifier="progressWindow" id="LSr-Iw-X1T" customClass="ProgressWC" customModule="PHP_Monitor" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<windowController storyboardIdentifier="progressWindow" id="LSr-Iw-X1T" customClass="TerminalProgressWindowController" customModule="PHP_Monitor" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<window key="window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="none" frameAutosaveName="" titlebarAppearsTransparent="YES" titleVisibility="hidden" id="PD9-0p-i0S" customClass="NSPanel">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" utility="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" rightStrut="YES" topStrut="YES"/>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// ProgressView.swift
|
||||
// TerminalProgressWindowController.swift
|
||||
// PHP Monitor
|
||||
//
|
||||
// Created by Nico Verbruggen on 18/12/2021.
|
||||
@@ -9,14 +9,14 @@
|
||||
import Foundation
|
||||
import AppKit
|
||||
|
||||
class ProgressWC: NSWindowController, NSWindowDelegate {
|
||||
class TerminalProgressWindowController: NSWindowController, NSWindowDelegate {
|
||||
|
||||
static func display(title: String, description: String) -> ProgressWC {
|
||||
static func display(title: String, description: String) -> TerminalProgressWindowController {
|
||||
let storyboard = NSStoryboard(name: "ProgressWindow", bundle: nil)
|
||||
|
||||
let windowController = storyboard.instantiateController(
|
||||
withIdentifier: "progressWindow"
|
||||
) as! ProgressWC
|
||||
) as! TerminalProgressWindowController
|
||||
|
||||
windowController.showWindow(windowController)
|
||||
windowController.window?.makeKeyAndOrderFront(nil)
|
||||
Reference in New Issue
Block a user