diff --git a/RSwitch/Swift/AppDelegate.swift b/RSwitch/Swift/AppDelegate.swift index 4435495..1ce8cdd 100644 --- a/RSwitch/Swift/AppDelegate.swift +++ b/RSwitch/Swift/AppDelegate.swift @@ -10,7 +10,12 @@ import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { - + + @objc func showAabout(_ sender: NSMenuItem?) { abtController.showWindow(self) } + + @objc func performTimer(_ sender: Timer) { print("timer fired") } + + var mainStoryboard: NSStoryboard! var abtController: NSWindowController! @@ -57,7 +62,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { timer = Timer.scheduledTimer( timeInterval: 3600, target: self, - selector: #selector(updateTimer), + selector: #selector(performTimer), userInfo: nil, repeats: true ) diff --git a/RSwitch/Swift/Menu.swift b/RSwitch/Swift/Menu.swift index 7ef7390..157946e 100644 --- a/RSwitch/Swift/Menu.swift +++ b/RSwitch/Swift/Menu.swift @@ -75,7 +75,7 @@ extension AppDelegate: NSMenuDelegate { // Add an About item menu.addItem(NSMenuItem.separator()) - menu.addItem(NSMenuItem(title: "About RSwitch…", action: #selector(about), keyEquivalent: "")) + menu.addItem(NSMenuItem(title: "About RSwitch…", action: #selector(showAabout), keyEquivalent: "")) menu.addItem(NSMenuItem(title: "RSwitch Help…", action: #selector(rswitch_help), keyEquivalent: "")) // Toggle Dock Icon diff --git a/RSwitch/Swift/Utils/Running.swift b/RSwitch/Swift/Utils/Running.swift index c55ceb4..3130ec9 100644 --- a/RSwitch/Swift/Utils/Running.swift +++ b/RSwitch/Swift/Utils/Running.swift @@ -11,11 +11,6 @@ import Cocoa extension AppDelegate { - // Show about dialog - @objc func about(_ sender: NSMenuItem?) { abtController.showWindow(self) } - - @objc func updateTimer(_ sender: Timer) { print("timer fired") } - // Show the framework dir in a new Finder window @objc func openFrameworksDir(_ sender: NSMenuItem?) { NSWorkspace.shared.openFile(RVersions.macos_r_framework, withApplication: "Finder")