diff --git a/Aural.xcodeproj/project.pbxproj b/Aural.xcodeproj/project.pbxproj index 2036bf2e1..d70a83046 100644 --- a/Aural.xcodeproj/project.pbxproj +++ b/Aural.xcodeproj/project.pbxproj @@ -672,7 +672,6 @@ 3E6C129825CEBE2700BF0D07 /* VAlignedTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6C0FBF25CEB98600BF0D07 /* VAlignedTextField.swift */; }; 3E6C129925CEBE2700BF0D07 /* AuralTabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6C0FD125CEB98600BF0D07 /* AuralTabView.swift */; }; 3E6C129B25CEBE2700BF0D07 /* ColoredCursorTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6C0FC525CEB98600BF0D07 /* ColoredCursorTextField.swift */; }; - 3E6C129C25CEBE2700BF0D07 /* AlertWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6C0FC925CEB98600BF0D07 /* AlertWindowController.swift */; }; 3E6C129D25CEBE2700BF0D07 /* AuralSliderCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6C0FD625CEB98600BF0D07 /* AuralSliderCell.swift */; }; 3E6C129E25CEBE2700BF0D07 /* EQSliderCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6C0FD725CEB98600BF0D07 /* EQSliderCell.swift */; }; 3E6C12A025CEBE2700BF0D07 /* TintedImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6C0FBE25CEB98600BF0D07 /* TintedImageView.swift */; }; @@ -682,7 +681,6 @@ 3E6C12A425CEBE2700BF0D07 /* AboutDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3E6C0FDC25CEB98600BF0D07 /* AboutDialog.xib */; }; 3E6C12A525CEBE2700BF0D07 /* EffectsUnitSlider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6C0FD525CEB98600BF0D07 /* EffectsUnitSlider.swift */; }; 3E6C12A625CEBE2700BF0D07 /* ToggleMenuItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6C0FCD25CEB98600BF0D07 /* ToggleMenuItem.swift */; }; - 3E6C12A725CEBE2700BF0D07 /* Alerts.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3E6C0FC725CEB98600BF0D07 /* Alerts.xib */; }; 3E6C12A825CEBE2700BF0D07 /* TriStateLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6C0FD025CEB98600BF0D07 /* TriStateLabel.swift */; }; 3E6C12A925CEBE2700BF0D07 /* EffectsUnitTriStateBypassImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6C0FCA25CEB98600BF0D07 /* EffectsUnitTriStateBypassImage.swift */; }; 3E6C12AA25CEBE2700BF0D07 /* AboutDialogController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6C0FDB25CEB98600BF0D07 /* AboutDialogController.swift */; }; @@ -1782,9 +1780,7 @@ 3E6C0FC325CEB98600BF0D07 /* StringInputPopover.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = StringInputPopover.xib; sourceTree = ""; }; 3E6C0FC425CEB98600BF0D07 /* StringInputPopoverViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringInputPopoverViewController.swift; sourceTree = ""; }; 3E6C0FC525CEB98600BF0D07 /* ColoredCursorTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColoredCursorTextField.swift; sourceTree = ""; }; - 3E6C0FC725CEB98600BF0D07 /* Alerts.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Alerts.xib; sourceTree = ""; }; 3E6C0FC825CEB98600BF0D07 /* DialogsAndAlerts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DialogsAndAlerts.swift; sourceTree = ""; }; - 3E6C0FC925CEB98600BF0D07 /* AlertWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertWindowController.swift; sourceTree = ""; }; 3E6C0FCA25CEB98600BF0D07 /* EffectsUnitTriStateBypassImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EffectsUnitTriStateBypassImage.swift; sourceTree = ""; }; 3E6C0FCB25CEB98600BF0D07 /* SnappingWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SnappingWindow.swift; sourceTree = ""; }; 3E6C0FCD25CEB98600BF0D07 /* ToggleMenuItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleMenuItem.swift; sourceTree = ""; }; @@ -4390,9 +4386,7 @@ 3E6C0FC625CEB98600BF0D07 /* Alerts */ = { isa = PBXGroup; children = ( - 3E6C0FC725CEB98600BF0D07 /* Alerts.xib */, 3E6C0FC825CEB98600BF0D07 /* DialogsAndAlerts.swift */, - 3E6C0FC925CEB98600BF0D07 /* AlertWindowController.swift */, ); path = Alerts; sourceTree = ""; @@ -5749,7 +5743,6 @@ 3E0219CB2C23497D00865AC2 /* neo-latina-demo-FFP.ttf in Resources */, 3E45C03325E1264C00C1519C /* FontSchemeSizes.xib in Resources */, 3E6668B12ADB4AF500BBD119 /* WindowLayoutSetup.xib in Resources */, - 3E6C12A725CEBE2700BF0D07 /* Alerts.xib in Resources */, 3EC793882B74700900AF7E9E /* CompactPlayQueue.xib in Resources */, 3E25B65027F7818900D10A5F /* PlayQueueWindow.xib in Resources */, 3E91932925E0CF5D00F30F81 /* FontSchemeFonts.xib in Resources */, @@ -5780,7 +5773,6 @@ 3E02190B2C23490E00865AC2 /* LegacyPlaylistPreferences.swift in Sources */, 3E0218222C23490E00865AC2 /* FilesAndPaths.swift in Sources */, 3E64AE112BD6FFB900630B8B /* ProgressArc.swift in Sources */, - 3E6C129C25CEBE2700BF0D07 /* AlertWindowController.swift in Sources */, 3E0219A22C23490E00865AC2 /* Globals.swift in Sources */, 3E6C0EC325CEB3ED00BF0D07 /* AppDelegate.swift in Sources */, 3EF28DBB2694E46B005D5B43 /* AppMode.swift in Sources */, diff --git a/Aural.xcodeproj/project.xcworkspace/xcuserdata/kven.xcuserdatad/UserInterfaceState.xcuserstate b/Aural.xcodeproj/project.xcworkspace/xcuserdata/kven.xcuserdatad/UserInterfaceState.xcuserstate index 185b51d19..e1d470b87 100644 Binary files a/Aural.xcodeproj/project.xcworkspace/xcuserdata/kven.xcuserdatad/UserInterfaceState.xcuserstate and b/Aural.xcodeproj/project.xcworkspace/xcuserdata/kven.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Source/UI/CustomViews/Alerts/AlertWindowController.swift b/Source/UI/CustomViews/Alerts/AlertWindowController.swift deleted file mode 100644 index f4d5a7616..000000000 --- a/Source/UI/CustomViews/Alerts/AlertWindowController.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// AlertWindowController.swift -// Aural -// -// Copyright © 2024 Kartik Venugopal. All rights reserved. -// -// This software is licensed under the MIT software license. -// See the file "LICENSE" in the project root directory for license terms. -// -import Cocoa - -class AlertWindowController: SingletonWindowController, ModalComponentProtocol { - - override var windowNibName: NSNib.Name? {"Alerts"} - - @IBOutlet weak var icon: NSImageView! - - @IBOutlet weak var lblTitle: NSTextField! - @IBOutlet weak var lblMessage: NSTextField! - @IBOutlet weak var lblInfo: NSTextField! - - @IBOutlet weak var btnOK: NSButton! - - var isModal: Bool { - return self.window?.isVisible ?? false - } - - func showAlert(_ alertType: AlertType, _ title: String, _ message: String, _ info: String) { - - if !self.isWindowLoaded { - _ = theWindow - } - - switch alertType { - - case .error: icon.image = .imgError - - case .warning: icon.image = .imgWarning - - default: icon.image = .imgWarning - - } - - lblTitle.stringValue = title - lblMessage.stringValue = message - lblInfo.stringValue = info - - theWindow.showCenteredOnScreen() - } - - @IBAction func okButtonAction(_ sender: Any) { - theWindow.close() - } -} - -enum AlertType { - - case error - case warning - case info -} diff --git a/Source/UI/CustomViews/Alerts/Alerts.xib b/Source/UI/CustomViews/Alerts/Alerts.xib deleted file mode 100644 index 2df21f6ad..000000000 --- a/Source/UI/CustomViews/Alerts/Alerts.xib +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Source/UI/CustomViews/Buttons/ModalDialogButtonCells.swift b/Source/UI/CustomViews/Buttons/ModalDialogButtonCells.swift index 72c09e6b9..2c6114691 100644 --- a/Source/UI/CustomViews/Buttons/ModalDialogButtonCells.swift +++ b/Source/UI/CustomViews/Buttons/ModalDialogButtonCells.swift @@ -69,36 +69,6 @@ class StringInputPopoverResponseButtonCell: ModalDialogResponseButtonCell { override var textFont: NSFont {.stringInputPopoverFont} } -// Cell for all response buttons (Save/Cancel, etc) -class ModalDialogControlButtonCell: ModalDialogButtonCell { - - override var cellInsetX: CGFloat {1} - override var cellInsetY: CGFloat {0} - - override var textFont: NSFont {.modalDialogControlButtonFont} -} - -// Browse button in Playlist preferences -class ModalDialogSmallControlButtonCell: ModalDialogButtonCell { - - override var cellInsetX: CGFloat {1} - override var cellInsetY: CGFloat {0} - - override var textFont: NSFont {standardFontSet.mainFont(size: 10)} -} - -// Cell for search results navigation buttons (next/previous) -class ColoredNavigationButtonCell: ModalDialogButtonCell { - - override var cellInsetX: CGFloat {1} - override var cellInsetY: CGFloat {1} - - override var borderRadius: CGFloat {3} - - override var textColor: NSColor {.modalDialogNavButtonTextColor} - override var textFont: NSFont {.modalDialogNavButtonFont} -} - class ColorAwareButtonCell: ModalDialogButtonCell { override var textColor: NSColor {systemColorScheme.buttonColor} diff --git a/Source/UI/Library/Playlists/SinglePlaylist/PlaylistContainer.xib b/Source/UI/Library/Playlists/SinglePlaylist/PlaylistContainer.xib index 4ecc9c759..8e48bd84e 100644 --- a/Source/UI/Library/Playlists/SinglePlaylist/PlaylistContainer.xib +++ b/Source/UI/Library/Playlists/SinglePlaylist/PlaylistContainer.xib @@ -559,7 +559,7 @@ - + diff --git a/Source/UI/Library/Playlists/SinglePlaylist/PlaylistContainerViewController.swift b/Source/UI/Library/Playlists/SinglePlaylist/PlaylistContainerViewController.swift index cedbdaf2b..492190599 100644 --- a/Source/UI/Library/Playlists/SinglePlaylist/PlaylistContainerViewController.swift +++ b/Source/UI/Library/Playlists/SinglePlaylist/PlaylistContainerViewController.swift @@ -44,7 +44,6 @@ class PlaylistContainerViewController: NSViewController { lazy var searchWindowController: SearchWindowController = .shared lazy var fileOpenDialog = DialogsAndAlerts.openFilesAndFoldersDialog - lazy var alertDialog: AlertWindowController = .instance lazy var saveDialog = DialogsAndAlerts.savePlaylistDialog var currentViewController: PlaylistSimpleViewController { @@ -159,7 +158,8 @@ class PlaylistContainerViewController: NSViewController { if playlistBeingModified { - alertDialog.showAlert(.error, "Playlist not modified", "The Playlist cannot be modified while tracks are being added", "Please wait till the Playlist is done adding tracks ...") + NSAlert.showError(withTitle: "Playlist not modified", + andText: "The playlist cannot be modified while tracks are being added. Please wait till the playlist is done adding tracks ...") } return playlistBeingModified diff --git a/Source/UI/Menus/Base.lproj/MainMenu.xib b/Source/UI/Menus/Base.lproj/MainMenu.xib index 82331f2ed..fb9a8d761 100644 --- a/Source/UI/Menus/Base.lproj/MainMenu.xib +++ b/Source/UI/Menus/Base.lproj/MainMenu.xib @@ -795,7 +795,7 @@ CA - + diff --git a/Source/UI/Menus/PlayQueueMenuController.swift b/Source/UI/Menus/PlayQueueMenuController.swift index 8671efaf7..8347c6779 100644 --- a/Source/UI/Menus/PlayQueueMenuController.swift +++ b/Source/UI/Menus/PlayQueueMenuController.swift @@ -38,8 +38,6 @@ class PlayQueueMenuController: NSObject, NSMenuDelegate { @IBOutlet weak var scrollToTopItem: NSMenuItem! @IBOutlet weak var scrollToBottomItem: NSMenuItem! - private lazy var alertDialog: AlertWindowController = .instance - private lazy var messenger = Messenger(for: self) func menuNeedsUpdate(_ menu: NSMenu) { diff --git a/Source/UI/PlayQueue/PlayQueueContainerViewController+Actions.swift b/Source/UI/PlayQueue/PlayQueueContainerViewController+Actions.swift index 276c94518..79375d4df 100644 --- a/Source/UI/PlayQueue/PlayQueueContainerViewController+Actions.swift +++ b/Source/UI/PlayQueue/PlayQueueContainerViewController+Actions.swift @@ -251,9 +251,8 @@ extension PlayQueueContainerViewController { if playQueueBeingModified { - alertDialog.showAlert(.error, "Play Queue not modified", - "The Play Queue cannot be modified while tracks are being added", - "Please wait till the Play Queue is done adding tracks ...") + NSAlert.showError(withTitle: "Play Queue not modified", + andText: "The Play Queue cannot be modified while tracks are being added. Please wait till the Play Queue is done adding tracks ...") } return playQueueBeingModified diff --git a/Source/UI/PlayQueue/PlayQueueContainerViewController.swift b/Source/UI/PlayQueue/PlayQueueContainerViewController.swift index 0cb85aaca..e4991fd42 100644 --- a/Source/UI/PlayQueue/PlayQueueContainerViewController.swift +++ b/Source/UI/PlayQueue/PlayQueueContainerViewController.swift @@ -46,8 +46,6 @@ class PlayQueueContainerViewController: NSViewController { lazy var fileOpenDialog = DialogsAndAlerts.openFilesAndFoldersDialog - lazy var alertDialog: AlertWindowController = .instance - lazy var saveDialog = DialogsAndAlerts.savePlaylistDialog var currentViewController: PlayQueueViewController { @@ -218,7 +216,9 @@ class PlayQueueContainerViewController: NSViewController { let playQueueBeingModified = playQueueDelegate.isBeingModified if playQueueBeingModified { - alertDialog.showAlert(.error, "Play Queue not modified", "The Play Queue cannot be modified while tracks are being added", "Please wait till the Play Queue is done adding tracks ...") + + NSAlert.showError(withTitle: "Play Queue not modified", + andText: "The Play Queue cannot be modified while tracks are being added. Please wait till the Play Queue is done adding tracks ...") } return playQueueBeingModified diff --git a/Source/UI/Preferences/Controls/Gestures/GesturesPreferences.xib b/Source/UI/Preferences/Controls/Gestures/GesturesPreferences.xib index 13ba5b35c..cc8c5a502 100644 --- a/Source/UI/Preferences/Controls/Gestures/GesturesPreferences.xib +++ b/Source/UI/Preferences/Controls/Gestures/GesturesPreferences.xib @@ -151,7 +151,7 @@