Skip to content

Commit

Permalink
bugfix: AboutView does not show
Browse files Browse the repository at this point in the history
  • Loading branch information
MSzturc committed May 14, 2020
1 parent 010c693 commit e65402e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ThinkpadAssistant/AboutViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,18 @@ class AboutViewController: NSViewController {

override func viewDidLoad() {
super.viewDidLoad()

if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
self.versionLabel.stringValue = NSLocalizedString("Version", comment: "") + " " + version
}
NSApp.activate(ignoringOtherApps: true)
let notificationCenter = NotificationCenter.default
notificationCenter.addObserver(self, selector: #selector(appMovedToBackground), name: NSApplication.willResignActiveNotification, object: nil)

}

@objc func appMovedToBackground() {
self.view.window!.close()
}

}

0 comments on commit e65402e

Please sign in to comment.