mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 12:33:44 +02:00
Show "About" view on first run.
Still needs some work to show up in the right place
This commit is contained in:
parent
e1755e569e
commit
36a9aff283
1 changed files with 8 additions and 1 deletions
|
@ -38,8 +38,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||||
let defaultsDict = ["firstRun": true]
|
let defaultsDict = ["firstRun": true]
|
||||||
defaults.registerDefaults(defaultsDict)
|
defaults.registerDefaults(defaultsDict)
|
||||||
|
|
||||||
|
let firstRun = defaults.boolForKey("firstRun")
|
||||||
|
|
||||||
if defaults.boolForKey("firstRun") {
|
if firstRun {
|
||||||
defaults.setBool(false, forKey: "firstRun")
|
defaults.setBool(false, forKey: "firstRun")
|
||||||
defaults.synchronize()
|
defaults.synchronize()
|
||||||
|
|
||||||
|
@ -78,6 +79,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||||
aboutPopover.contentViewController = AboutViewController(
|
aboutPopover.contentViewController = AboutViewController(
|
||||||
nibName: "AboutViewController", bundle: nil)
|
nibName: "AboutViewController", bundle: nil)
|
||||||
aboutPopover.behavior = .Transient
|
aboutPopover.behavior = .Transient
|
||||||
|
|
||||||
|
if firstRun {
|
||||||
|
NSOperationQueue.mainQueue().addOperationWithBlock() {
|
||||||
|
self.showAbout()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func applicationWillTerminate(aNotification: NSNotification) {
|
func applicationWillTerminate(aNotification: NSNotification) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue