diff --git a/UTMBeGone/Menu/MenuManager.swift b/UTMBeGone/Menu/MenuManager.swift index 5fb681f..378355c 100644 --- a/UTMBeGone/Menu/MenuManager.swift +++ b/UTMBeGone/Menu/MenuManager.swift @@ -62,12 +62,7 @@ class MenuManager: NSObject { let preferencesItem = NSMenuItem(title: "Preferences", action: #selector(MenuManager.openPreferences), keyEquivalent: "") preferencesItem.target = self menu.addItem(preferencesItem) - - let launchAtLoginItem = NSMenuItem(title: "Launch at Login ", action: #selector(MenuManager.toggleLaunchAtLogin), keyEquivalent: "") - launchAtLoginItem.target = self - launchAtLoginItem.state = launchAtLoginEnabled ? .on : .off - menu.addItem(launchAtLoginItem) - + if stopped { let resumeMenuItem = NSMenuItem(title: "Resume ", action: #selector(MenuManager.resume), keyEquivalent: "") resumeMenuItem.target = self @@ -78,10 +73,19 @@ class MenuManager: NSObject { menu.addItem(stopMenuItem) } + let launchAtLoginItem = NSMenuItem(title: "Launch at Login ", action: #selector(MenuManager.toggleLaunchAtLogin), keyEquivalent: "") + launchAtLoginItem.target = self + launchAtLoginItem.state = launchAtLoginEnabled ? .on : .off + menu.addItem(launchAtLoginItem) + let removeFromMenuItem = NSMenuItem(title: "Hide Icon ", action: #selector(MenuManager.removeFromMenu), keyEquivalent: "") removeFromMenuItem.target = self menu.addItem(removeFromMenuItem) + let websiteItem = NSMenuItem(title: "Project Website", action: #selector(MenuManager.openProjectWebsite), keyEquivalent: "") + websiteItem.target = self + menu.addItem(websiteItem) + let quitMenuItem = NSMenuItem(title: "Quit", action: #selector(MenuManager.quit), keyEquivalent: "") quitMenuItem.target = self menu.addItem(quitMenuItem) @@ -129,6 +133,10 @@ extension MenuManager { setupMenu() } + @objc private func openProjectWebsite() { + NSWorkspace.shared.open(URL(string: "https://github.com/Bunn/UTMBeGone")!) + } + @objc private func quit() { NSApplication.shared.terminate(self) }