Browse Source

Update ParentPanelController.swift

pull/101/head
Abhishek 3 years ago
parent
commit
1a8f6b2766
  1. 7
      Clocker/Panel/ParentPanelController.swift

7
Clocker/Panel/ParentPanelController.swift

@ -543,7 +543,7 @@ class ParentPanelController: NSWindowController {
@IBAction func openPreferences(_: NSButton) { @IBAction func openPreferences(_: NSButton) {
updatePopoverDisplayState() // Popover's class has access to all timezones. Need to close the popover, so that we don't have two copies of selections updatePopoverDisplayState() // Popover's class has access to all timezones. Need to close the popover, so that we don't have two copies of selections
openPreferences() openPreferencesWindow()
} }
func deleteTimezone(at row: Int) { func deleteTimezone(at row: Int) {
@ -682,7 +682,7 @@ class ParentPanelController: NSWindowController {
mainTableView.reloadData() mainTableView.reloadData()
} }
private func openPreferences() { @objc private func openPreferencesWindow() {
oneWindow?.showWindow(nil) oneWindow?.showWindow(nil)
NSApp.activate(ignoringOtherApps: true) NSApp.activate(ignoringOtherApps: true)
} }
@ -1000,6 +1000,8 @@ class ParentPanelController: NSWindowController {
action: #selector(reportIssue), keyEquivalent: "") action: #selector(reportIssue), keyEquivalent: "")
let localizeClocker = NSMenuItem(title: "Localize Clocker...", let localizeClocker = NSMenuItem(title: "Localize Clocker...",
action: #selector(openCrowdin), keyEquivalent: "") action: #selector(openCrowdin), keyEquivalent: "")
let openPreferences = NSMenuItem(title: "Preferences",
action: #selector(openPreferencesWindow), keyEquivalent: "")
let appDisplayName = Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName") ?? "Clocker" let appDisplayName = Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName") ?? "Clocker"
let shortVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") ?? "N/A" let shortVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") ?? "N/A"
@ -1008,6 +1010,7 @@ class ParentPanelController: NSWindowController {
let versionInfo = "\(appDisplayName) \(shortVersion) (\(longVersion))" let versionInfo = "\(appDisplayName) \(shortVersion) (\(longVersion))"
let clockerVersionInfo = NSMenuItem(title: versionInfo, action: nil, keyEquivalent: "") let clockerVersionInfo = NSMenuItem(title: versionInfo, action: nil, keyEquivalent: "")
clockerVersionInfo.isEnabled = false clockerVersionInfo.isEnabled = false
menuItem.addItem(openPreferences)
menuItem.addItem(rateClocker) menuItem.addItem(rateClocker)
menuItem.addItem(sendFeedback) menuItem.addItem(sendFeedback)
menuItem.addItem(localizeClocker) menuItem.addItem(localizeClocker)

Loading…
Cancel
Save