From 9b7141ce7bf6b035bf488a5c4279a0efe2d3a397 Mon Sep 17 00:00:00 2001 From: Jari Zwarts Date: Wed, 5 Oct 2016 19:09:34 +0200 Subject: [PATCH] WIP preferences window, new app icon (#28) --- Noti.xcodeproj/project.pbxproj | 4 + Noti/AppDelegate.swift | 10 + .../IntroLogo.imageset/Contents.json | 4 +- .../IntroLogo.imageset/IntroLogo-1.png | Bin 0 -> 2262 bytes .../IntroLogo.imageset/IntroLogo.png | Bin 2826 -> 0 bytes .../IntroLogo.imageset/IntroLogo@2x-1.png | Bin 0 -> 5433 bytes .../IntroLogo.imageset/IntroLogo@2x.png | Bin 6401 -> 0 bytes .../StatusBarImage.png | Bin 378 -> 370 bytes .../StatusBarImage@2x.png | Bin 781 -> 699 bytes .../Contents.json | 21 ++ .../StatusBarImageFail.png | Bin 0 -> 390 bytes .../StatusBarImageFail@2x.png | Bin 0 -> 778 bytes Noti/Base.lproj/Main.storyboard | 190 ++++++++++++++++++ ...otificationPreferencesViewController.swift | 24 +++ Noti/PushManager.swift | 2 +- Noti/StatusMenuController.swift | 21 +- 16 files changed, 266 insertions(+), 10 deletions(-) create mode 100644 Noti/Assets.xcassets/IntroLogo.imageset/IntroLogo-1.png delete mode 100644 Noti/Assets.xcassets/IntroLogo.imageset/IntroLogo.png create mode 100644 Noti/Assets.xcassets/IntroLogo.imageset/IntroLogo@2x-1.png delete mode 100644 Noti/Assets.xcassets/IntroLogo.imageset/IntroLogo@2x.png create mode 100644 Noti/Assets.xcassets/StatusBarButtonImageFail.imageset/Contents.json create mode 100644 Noti/Assets.xcassets/StatusBarButtonImageFail.imageset/StatusBarImageFail.png create mode 100644 Noti/Assets.xcassets/StatusBarButtonImageFail.imageset/StatusBarImageFail@2x.png create mode 100644 Noti/NotificationPreferencesViewController.swift diff --git a/Noti.xcodeproj/project.pbxproj b/Noti.xcodeproj/project.pbxproj index ae43bd2..cd0c70f 100644 --- a/Noti.xcodeproj/project.pbxproj +++ b/Noti.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 162B919FE4321ED9BC86AD09 /* Pods_Noti.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2C7615AF577BAEAF32B8516 /* Pods_Noti.framework */; }; 4901D3CF1D1C121D005F1641 /* StatusMenuController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4901D3CE1D1C121D005F1641 /* StatusMenuController.swift */; }; 4901D3D31D23E6AB005F1641 /* IntroViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4901D3D21D23E6AB005F1641 /* IntroViewController.swift */; }; + 495CFD9D1DA05B9900E13865 /* NotificationPreferencesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 495CFD9C1DA05B9900E13865 /* NotificationPreferencesViewController.swift */; }; 498275F21D35101A00AB7029 /* Crypt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 498275F11D35101A00AB7029 /* Crypt.swift */; }; 498275FB1D3567D500AB7029 /* SwCrypt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 498275FA1D3567D500AB7029 /* SwCrypt.swift */; }; 498499FE1D1BE46F007FC963 /* PushManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 498499FD1D1BE46F007FC963 /* PushManager.swift */; }; @@ -27,6 +28,7 @@ 0F7FEC6A353CB04118DDEBF6 /* Pods-Noti.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Noti.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Noti/Pods-Noti.debug.xcconfig"; sourceTree = ""; }; 4901D3CE1D1C121D005F1641 /* StatusMenuController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatusMenuController.swift; sourceTree = ""; }; 4901D3D21D23E6AB005F1641 /* IntroViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntroViewController.swift; sourceTree = ""; }; + 495CFD9C1DA05B9900E13865 /* NotificationPreferencesViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationPreferencesViewController.swift; sourceTree = ""; }; 498275F11D35101A00AB7029 /* Crypt.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Crypt.swift; sourceTree = ""; }; 498275F91D3567D500AB7029 /* SwCrypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SwCrypt.h; sourceTree = ""; }; 498275FA1D3567D500AB7029 /* SwCrypt.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwCrypt.swift; sourceTree = ""; }; @@ -93,6 +95,7 @@ 499DD0F71D2D7BBF00BB759D /* Ephemerals.swift */, 499DD0FB1D2D8FAC00BB759D /* RoundedImage.swift */, 498275F11D35101A00AB7029 /* Crypt.swift */, + 495CFD9C1DA05B9900E13865 /* NotificationPreferencesViewController.swift */, ); path = Noti; sourceTree = ""; @@ -243,6 +246,7 @@ 499DD0FC1D2D8FAC00BB759D /* RoundedImage.swift in Sources */, 498499FE1D1BE46F007FC963 /* PushManager.swift in Sources */, 49B43B0E1D1ADFB200A24585 /* AuthViewController.swift in Sources */, + 495CFD9D1DA05B9900E13865 /* NotificationPreferencesViewController.swift in Sources */, 4901D3CF1D1C121D005F1641 /* StatusMenuController.swift in Sources */, 49B43B0C1D1ADFB200A24585 /* AppDelegate.swift in Sources */, 499DD0F81D2D7BBF00BB759D /* Ephemerals.swift in Sources */, diff --git a/Noti/AppDelegate.swift b/Noti/AppDelegate.swift index 9a22e08..1c0fa4f 100644 --- a/Noti/AppDelegate.swift +++ b/Noti/AppDelegate.swift @@ -15,6 +15,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { var pushManager: PushManager? let userDefaults: NSUserDefaults = NSUserDefaults.standardUserDefaults() var iwc:NSWindowController?; + var pwc:NSWindowController?; func loadPushManager() { let token = userDefaults.stringForKey("token") @@ -35,9 +36,18 @@ class AppDelegate: NSObject, NSApplicationDelegate { iwc!.window?.makeKeyAndOrderFront(self) } } + + func displayPreferencesWindow() { + let storyboard = NSStoryboard(name: "Main", bundle: nil) + pwc = storyboard.instantiateControllerWithIdentifier("PreferencesWindowController") as? NSWindowController + NSApplication.sharedApplication().activateIgnoringOtherApps(true) + pwc!.showWindow(self) + pwc!.window?.makeKeyAndOrderFront(self) + } func applicationDidFinishLaunching(aNotification: NSNotification) { loadPushManager() +// displayPreferencesWindow() } func applicationWillTerminate(aNotification: NSNotification) { diff --git a/Noti/Assets.xcassets/IntroLogo.imageset/Contents.json b/Noti/Assets.xcassets/IntroLogo.imageset/Contents.json index 6b2f804..6d3bcb1 100644 --- a/Noti/Assets.xcassets/IntroLogo.imageset/Contents.json +++ b/Noti/Assets.xcassets/IntroLogo.imageset/Contents.json @@ -2,12 +2,12 @@ "images" : [ { "idiom" : "mac", - "filename" : "IntroLogo.png", + "filename" : "IntroLogo-1.png", "scale" : "1x" }, { "idiom" : "mac", - "filename" : "IntroLogo@2x.png", + "filename" : "IntroLogo@2x-1.png", "scale" : "2x" } ], diff --git a/Noti/Assets.xcassets/IntroLogo.imageset/IntroLogo-1.png b/Noti/Assets.xcassets/IntroLogo.imageset/IntroLogo-1.png new file mode 100644 index 0000000000000000000000000000000000000000..9c2beb024b656162e44f16621c3d24bd74123569 GIT binary patch literal 2262 zcmZ{mX*iUN8^+(6c_(9^A(<>=OxaRdq9KDBM#z#v)-j9|MOluNWg2hDkhR5@Emsl$ z9I{2Sj0iZz0H9K>sT8LO*aD4~=_L$NpUQAx3!?rF&bQDwLQK@xWV7KUEe<8a_Lo7JbA5zzPN zR_mPMr62vCOQXLkuC9;#sze6%8*VJNuv(Y$!upLjzC;V{>Jx*RbI{u0f1^j@T6uZ- zN1p6Bd)!}S>X?#80j*>3EfORzGWmhLRi1sz7*Dq@6SBwTY$=ok%0rirnhMkMIBr(KX7Z|X96yTXK-B5VY7e}dB zh^XhKdiQx3-)fWqRvKW}-f%}=s-5cK{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l?;OW96Kx_YyeE8JALD$rD!6TWq3&frNHg1@jigy!lAL=Wzxwnq^)c7(cBn4fiqtt;@Pq$-76uur+g}?<&RC> z#~$zTxmBz^9of5mV>m1R`7>{}T3|1*9$0t+r0k9QZ)B*$f5Vi_oaT?HmA&10Q~+xW KdupYbckDlZ4h4k( literal 0 HcmV?d00001 diff --git a/Noti/Assets.xcassets/IntroLogo.imageset/IntroLogo.png b/Noti/Assets.xcassets/IntroLogo.imageset/IntroLogo.png deleted file mode 100644 index aea68917a6cdee5970c987f3de0d71e36a332d81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2826 zcma);X*kpi8^-^$U}o%N-^b2TNf|YSu^W>$6$e?$Qnu`2CVxwzFp(wMx1&NNkw%Q= z7)y3#Ng0(Tdt|5vr}KV#KfE8_56}I(uKT*5&-a~dV`avT5=Q|5z)dhWw);)+-$Stf z)=oY5{@;Lm8(10uz%vRb%bg7XQ0)X`1N$40wSwqXDH9?3k65T(O_D<~VmztO$k&`) zEX)l*&MrjStSgU2*viF-CMQw&#`(U(onNb^ltOp3l?`kxnhJ0^#4G-iCbTU z*Vx$D-E>{4o3Jyp7p>>J@6e)5sjy4zG30C4uAQ4$x`f1U>c^KnpR1vAU5n8|%p@o$ zro%G?YsPZ{_#vhtr&FADLG=0Bo-p$IlYX5d_)9cwBS>td)sO!{_j4&iT$sP~Pu3HW z7plI|OhgYa3&_bC3JJSFcHtoPr#nGrVG+`ym@+|*SX~WyjxQUxiZ+fnQ_E_pcQ1ol zQJHDHp-wi*nFzl4iOz@@Y{^VT`P7Z$M{+AOAl-e_>U<<4glkyy?)W3;O6(y?)Fu0WeD zMA!{#`F%ZT?+q=QM(J$3rK9db=~SN8*o=^E;Xg>P9aITUIVloQs!$nc_U#2_oeeQ` zi#Jw(+AK)RGda%L^R;MpRVZ=t*zPOBIg62O5-&|u`E7UhU8!h@4>O_2`yI)3fJwB| zPTMcm#aCLtNPaL-j-+9zos``6>aB?ao}qf6wN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MR2(q<%}?bxu|^YBhV4iafgQ=%Fc{Vl zfJ6p(!#Kfa1~_bHofZZWJQx5eBzWl|(Th>Qy;^r77}{`RBuhk($V4imfTt?ZMd6B! z0zUQrKTXBAa%p8up91Nk|3m5}UWimgty0iPqaz0fb2BAYq=N5{ioDBSX+0>=`X|6o zmjTgrf7A-Iwwyy(=l^!Gt9Ouuyqf$h5PE=^ph6C-eV2zB?SyPrR;;kejRGf_O8E+< zBrI{&fdXX~X-J?rwr|J^clo7R+5A_4>p7CqUIOp!qKrdB-ZuS;Fb{4(wdi2B4Vwb` zbXw-`9pt$i$#cH-*(~eG&tFI-A-feLdyi(46x43iWuf##v!?96-1`!Ollw zfNU6a#8L@Yl{B+>s^UQPuMcnMO1xx+NKYK`8kqFiQHp)9{d08yt2aA*W$5oy!(?jn z)wjA7{5a2{@N2F!PZt-CQjQ94y+<>c5cGEn zi)THuyRvm`IQ5*v45unRG4`d?QzxTd_}pboXMN$4P4eRU9o4ka+8f6i4BZ;sq((@# z(UNlM+8e81sm}Wyy-G+D0LAf`tarzUXuFh#&(vtopwm}vhkrX)hm2I+r>a&9LdKY7 zJBksmQrU$iVzyr>x0M!CLmnF6h@0=Emr@cKRNMaz`}f}n#%HVt!YJ0H5l8e=0)q<$ NF6&;!R$RIs{vS6imS+F} literal 0 HcmV?d00001 diff --git a/Noti/Assets.xcassets/IntroLogo.imageset/IntroLogo@2x.png b/Noti/Assets.xcassets/IntroLogo.imageset/IntroLogo@2x.png deleted file mode 100644 index eb51e9a656a6525f1683bcbedf8d18e95046a4de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6401 zcmds6hf@<#x8H;X0;q&$q4z3Mgox5Y3B3tKP`ZGqR4D?j_Kg=!64FJGlOAAv+ z0D!PAApnenCEUYnudoCdU}S3q0EBFwT_1J;INoY$YUCUPp_TBgi=h(w*A$Fn`am){ zCAIQFs-$=}UQ$l48V*kmMJfs2>XV`I#TT215GG_`u5i@T4?W3Y^A&gai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_nH2xvjm^%|NHMjdkz%OMYZShf{FziQ?%8b4_#wdaMDS#({8uFQB4Q-E!v;p4+=2{ z@`+Q7V&QfQyqa!Khfe5HWD^ukXW>hrbL~6W1+K{_PJc0qb6 zpT`u)Vic<}$yQdN3T?A8ec#@)nC)a`DFZ074}A6!Vi8==bE=*B#QAJLkFRtkyWV$W z><>XF8GqD{vA#PH6iz3HS;y0kHAsHS#NxA@sEbaHpU@j t0_=hO1EzjWH~Yb;vDsb~`rlUIF9t*RD{vZlh714z002ovPDHLkV1mM)J=OpK delta 741 zcmV?i9s+(#KKBY45A)|yVV6@o=XZTtWlrTtSqc7A_SsFOrs_N!S(mZ&hFfs*^gUq50M@C zGw=Q1d-MJ~yK{SYwOTc*9jJETKiq*J2ztRJm;+@G=^?%Pe1BV6*CdI(aPL5ej+N{$ zu>Q_^y*_LAS!Fw+J3*q1HeXWoU}48DiKN6cHn&(L=!CC7E0 ziWTAxQy(ymg#8M-f$XSn%tLm9Cn`9Ce@StX>nc)Alo=bJFgw8Gn2M|iSc70WVq)VY z=9$=yEOV=0MT})AIj(Ev8uKW|DdTu%5izFtd-&^t9Dfkskc%Avi#n(k`95asoR2u0 zzzv&J_D%dH@WbNYV^4rCi?humIOo7yoAlYfS6$#sY!}C?u0d1Q4z^2IVxNCr;Oa!_ z%?F-Q@({@LcmRxmhTDbz_d}nmoc@^ZOx6;hRyn|5V$s_X<96$EDp6o;300#ns~_uYq-H{g+nvv^^@Z{x}`

!pF3ss&Al$d)&cq2UyW)9%GiNF XDFh5To~)t^00000NkvXXu0mjfs{U)W diff --git a/Noti/Assets.xcassets/StatusBarButtonImageFail.imageset/Contents.json b/Noti/Assets.xcassets/StatusBarButtonImageFail.imageset/Contents.json new file mode 100644 index 0000000..7d6c549 --- /dev/null +++ b/Noti/Assets.xcassets/StatusBarButtonImageFail.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "mac", + "filename" : "StatusBarImageFail.png", + "scale" : "1x" + }, + { + "idiom" : "mac", + "filename" : "StatusBarImageFail@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + }, + "properties" : { + "template-rendering-intent" : "template" + } +} \ No newline at end of file diff --git a/Noti/Assets.xcassets/StatusBarButtonImageFail.imageset/StatusBarImageFail.png b/Noti/Assets.xcassets/StatusBarButtonImageFail.imageset/StatusBarImageFail.png new file mode 100644 index 0000000000000000000000000000000000000000..9004005887776c5a88a635eea5862fc3623885bd GIT binary patch literal 390 zcmV;10eSw3P)N zJ^?DMpbjROIMnaA=N4>krPRduCtuI$Ip_ZEy*CK{T5%lj!YvGy|N8rww85!e+7O2t z+`yZ2v;3M^Tg#XQRnRu`r0rJ=n=;(Vb6Toj6*6Q&1zv37j5xJiLAh$uGi#&OtL3L%C||Nl_9O&&@@eW?C#ALJvNm0a6#XKt0LL zCT~1_hOW6ya%wLVi)XHx7qx|-bWigr48uq$2i1y;gKm8tcXFfk>`Hoda5vw|_QT}@ zgZhg;=#1Xs6@1#Gs3RG{1%E&G4FwpEU|q>HRrXRkX{TiJZOc9ne)p34x%CEYPw(Z0 k;R!s#100uk`Y$U#0jBp=Q8*4Ood5s;07*qoM6N<$f(vV>9{>OV literal 0 HcmV?d00001 diff --git a/Noti/Assets.xcassets/StatusBarButtonImageFail.imageset/StatusBarImageFail@2x.png b/Noti/Assets.xcassets/StatusBarButtonImageFail.imageset/StatusBarImageFail@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..e3a557da0398f54b151f1e23c648a662726331cf GIT binary patch literal 778 zcmV+l1NHogP)-d_l5(&i!r zuF_bi(#Ai)F2qWaYefAI6b-~eE5*hlsNwv)yBYE_%q%l|yGxLJ@XfsWzBliEcXoD< zO_q)9fb2l8*INeP43-awtbq(fwSa4_GDIFKqX;#wd+PW&Pg*`Tv_Q5^YD{_BOqrM` zR0BoxNw5aw+=c8bfk$AX21$D@Xm}I+0I~L+#QD7n6?!zf2XolDEO4B$dmsO?ntc2l&APMMbE?*&dEDV>{d>^Sct2B@7ax_)VpFT z0;^DQ!lPuG(6?v&s>FM#aaO%NlKqHl8=eJ|vS)kxR_aEAATpX*CyL zIBOShWQ{hrrjDigTy{raI)49!%Qy}CJIS~XtgTB2CbDzW#=mQWX6y)Gic!!N_yw*B zwm=ui8T|#Ui7%YQB&P{vjkZpVxWh3?o}80#UBjPZY#QGV$8cWQ31e6JNp9>JOe$Jt za?u@hHS9ucfe$8dj!_o8&YjQW7B)6s$9!wiv zR*{?~`NmySl(^gAr#J~FzZ|npejD+R9WH)~xVC + + + + + @@ -777,6 +782,190 @@ Whenever your devices have something to say, I'll let you know! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + encryptionEnabled + + + + + + + + + + + + + + + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -820,6 +1009,7 @@ Whenever your devices have something to say, I'll let you know! + diff --git a/Noti/NotificationPreferencesViewController.swift b/Noti/NotificationPreferencesViewController.swift new file mode 100644 index 0000000..ca87adc --- /dev/null +++ b/Noti/NotificationPreferencesViewController.swift @@ -0,0 +1,24 @@ +// +// NotificationPreferences.swift +// Noti +// +// Created by Jari on 01/10/16. +// Copyright © 2016 Jari Zwarts. All rights reserved. +// + +import Cocoa + + +public class NotificationPreferencesViewController: NSViewController { + @IBOutlet weak var sounds:NSArrayController! + + override public func viewDidLoad() { + let fileManager = NSFileManager.defaultManager() + let enumerator:NSDirectoryEnumerator = fileManager.enumeratorAtPath("/System/Library/Sounds")! + + while let element = enumerator.nextObject() as? NSString { + sounds.addObject(element.stringByDeletingPathExtension) + } + print(sounds.arrangedObjects) + } +} \ No newline at end of file diff --git a/Noti/PushManager.swift b/Noti/PushManager.swift index 664b5b0..d9349f0 100644 --- a/Noti/PushManager.swift +++ b/Noti/PushManager.swift @@ -264,7 +264,7 @@ class PushManager: NSObject, WebSocketDelegate, NSUserNotificationCenterDelegate if(!self.killed) { print("Reconnecting in 5 sec"); if error != nil { - setState("Disconnected: \(error!.localizedDescription), retrying...", disabled: true) + setState("Disconnected: \(error!.localizedFailureReason != nil ? error!.localizedFailureReason! : error!.localizedDescription), retrying...", disabled: true) } else { setState("Disconnected, retrying...", disabled: true) diff --git a/Noti/StatusMenuController.swift b/Noti/StatusMenuController.swift index 3bb0660..653a1ae 100644 --- a/Noti/StatusMenuController.swift +++ b/Noti/StatusMenuController.swift @@ -14,15 +14,18 @@ class StatusMenuController: NSObject, NSUserNotificationCenterDelegate { let statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(NSVariableStatusItemLength) @IBOutlet weak var menu: NSMenu! @IBOutlet weak var menuItem: NSMenuItem! + var appDelegate: AppDelegate?; override func awakeFromNib() { print("StatusMenuController alive") + appDelegate = NSApplication.sharedApplication().delegate as? AppDelegate + if let button = statusItem.button { - button.image = NSImage(named: "StatusBarButtonImage") + button.image = NSImage(named: "StatusBarButtonImageFail") statusItem.menu = menu; + button.appearsDisabled = true } - statusItem.button?.appearsDisabled = true menuItem.enabled = true NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(StatusMenuController.stateChange(_:)), name:"StateChange", object: nil) @@ -36,7 +39,9 @@ class StatusMenuController: NSObject, NSUserNotificationCenterDelegate { } if let disabled = info["disabled"] as? Bool { + statusItem.button?.image = NSImage(named: disabled ? "StatusBarButtonImageFail" : "StatusBarButtonImage") statusItem.button?.appearsDisabled = disabled + } if let image = info["image"] as? NSImage { @@ -55,14 +60,16 @@ class StatusMenuController: NSObject, NSUserNotificationCenterDelegate { @IBAction func reauthorize(sender: AnyObject?) { //delete token & restart push manager - let appDelegate = NSApplication.sharedApplication().delegate as! AppDelegate - appDelegate.userDefaults.removeObjectForKey("token") - appDelegate.loadPushManager() + appDelegate!.userDefaults.removeObjectForKey("token") + appDelegate!.loadPushManager() + } + + @IBAction func preferences(sender: AnyObject?) { + appDelegate!.displayPreferencesWindow() } @IBAction func setPassword(sender: AnyObject?) { - let appDelegate = NSApplication.sharedApplication().delegate as! AppDelegate - appDelegate.pushManager?.displayPasswordForm() + appDelegate!.pushManager?.displayPasswordForm() } @IBAction func quit(sender: AnyObject?) {