1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-17 13:17:13 +00:00

mac/menu: remove redundant quit func and use identical command func

This commit is contained in:
der richter 2024-04-01 01:10:13 +02:00
parent 3c51497954
commit 67c48ed922

View File

@ -110,8 +110,8 @@ class MenuBar: NSObject {
Config(name: "Hide Others", key: "h", modifiers: [.command, .option], action: #selector(NSApp.hideOtherApplications(_:))), Config(name: "Hide Others", key: "h", modifiers: [.command, .option], action: #selector(NSApp.hideOtherApplications(_:))),
Config(name: "Show All", action: #selector(NSApp.unhideAllApplications(_:))), Config(name: "Show All", action: #selector(NSApp.unhideAllApplications(_:))),
Config(type: .separator), Config(type: .separator),
Config(name: "Quit and Remember Position", action: #selector(quit(_:)), target: self, command: "quit-watch-later"), Config(name: "Quit and Remember Position", action: #selector(command(_:)), target: self, command: "quit-watch-later"),
Config(name: "Quit mpv", key: "q", action: #selector(quit(_:)), target: self, command: "quit"), Config(name: "Quit mpv", key: "q", action: #selector(command(_:)), target: self, command: "quit"),
] ]
let fileMenuConfigs = [ let fileMenuConfigs = [
@ -320,11 +320,6 @@ class MenuBar: NSObject {
} }
} }
@objc func quit(_ menuItem: MenuItem) {
guard let menuConfig = menuItem.config else { return }
appHub.input.command(menuConfig.command)
}
@objc func openFiles() { @objc func openFiles() {
let panel = NSOpenPanel() let panel = NSOpenPanel()
panel.allowsMultipleSelection = true panel.allowsMultipleSelection = true