Code clean.

This commit is contained in:
Qiu Yuzhou
2018-09-19 23:22:11 +08:00
parent 9508af2bc1
commit e5683f26f8

View File

@ -252,34 +252,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
ctrl.window?.makeKeyAndOrderFront(self)
}
@IBAction func showQRCodeForCurrentServer(_ sender: NSMenuItem) {
var errMsg: String?
if let profile = ServerProfileManager.instance.getActiveProfile() {
if profile.isValid() {
// Show window
if qrcodeWinCtrl != nil{
qrcodeWinCtrl.close()
}
qrcodeWinCtrl = SWBQRCodeWindowController(windowNibName: NSNib.Name(rawValue: "SWBQRCodeWindowController"))
qrcodeWinCtrl.qrCode = profile.URL()!.absoluteString
qrcodeWinCtrl.legacyQRCode = profile.URL(legacy: true)!.absoluteString
qrcodeWinCtrl.title = profile.title()
qrcodeWinCtrl.showWindow(self)
NSApp.activate(ignoringOtherApps: true)
qrcodeWinCtrl.window?.makeKeyAndOrderFront(nil)
return
} else {
errMsg = "Current server profile is not valid.".localized
}
} else {
errMsg = "No current server profile.".localized
}
if let msg = errMsg {
self.makeToast(msg)
}
}
@IBAction func showShareServerProfiles(_ sender: NSMenuItem) {
if shareWinCtrl != nil {
shareWinCtrl.close()
@ -354,7 +326,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
preferencesWinCtrl.showWindow(self)
NSApp.activate(ignoringOtherApps: true)
preferencesWinCtrl.window?.makeKeyAndOrderFront(self)
}
@IBAction func showAllInOnePreferences(_ sender: NSMenuItem) {