顶级菜单中服务器名前加上文字:服务器.

This commit is contained in:
Charlie Qiu
2016-10-02 01:45:59 +08:00
parent cb9d2b62ad
commit bfc39d8179
3 changed files with 7 additions and 2 deletions

View File

@ -347,11 +347,13 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
for v in defaults.array(forKey: "ServerProfiles")! { for v in defaults.array(forKey: "ServerProfiles")! {
let profile = v as! [String:Any] let profile = v as! [String:Any]
if profile["Id"] as! String == defaults.string(forKey: "ActiveServerProfileId")! { if profile["Id"] as! String == defaults.string(forKey: "ActiveServerProfileId")! {
var profileName :String
if profile["Remark"] as! String != "" { if profile["Remark"] as! String != "" {
serverMenuText = profile["Remark"] as! String profileName = profile["Remark"] as! String
} else { } else {
serverMenuText = profile["ServerHost"] as! String profileName = profile["ServerHost"] as! String
} }
serverMenuText = "\(serverMenuText) - \(profileName)"
} }
} }
serversMenuItem.title = serverMenuText serversMenuItem.title = serverMenuText

View File

@ -45,3 +45,5 @@
"Proxy - Global" = "Proxy - Global"; "Proxy - Global" = "Proxy - Global";
"Proxy - Manual" = "Proxy - Manual"; "Proxy - Manual" = "Proxy - Manual";
"Servers" = "Servers";

View File

@ -50,3 +50,4 @@
"Proxy - Manual" = "代理 - 手动"; "Proxy - Manual" = "代理 - 手动";
"Servers" = "服务器";