Display max 24 chars of profile remark.
This commit is contained in:
@ -491,7 +491,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
|||||||
if mgr.activeProfileId == p.uuid {
|
if mgr.activeProfileId == p.uuid {
|
||||||
var profileName :String
|
var profileName :String
|
||||||
if !p.remark.isEmpty {
|
if !p.remark.isEmpty {
|
||||||
profileName = p.remark
|
profileName = String(p.remark.prefix(24))
|
||||||
} else {
|
} else {
|
||||||
profileName = p.serverHost
|
profileName = p.serverHost
|
||||||
}
|
}
|
||||||
|
@ -250,7 +250,7 @@ class PreferencesWindowController: NSWindowController
|
|||||||
let profile = profileMgr.profiles[index]
|
let profile = profileMgr.profiles[index]
|
||||||
let isActive = (profileMgr.activeProfileId == profile.uuid)
|
let isActive = (profileMgr.activeProfileId == profile.uuid)
|
||||||
if !profile.remark.isEmpty {
|
if !profile.remark.isEmpty {
|
||||||
return (profile.remark, isActive)
|
return (String(profile.remark.prefix(24)), isActive)
|
||||||
} else {
|
} else {
|
||||||
return (profile.serverHost, isActive)
|
return (profile.serverHost, isActive)
|
||||||
}
|
}
|
||||||
|
@ -328,7 +328,7 @@ class ServerProfile: NSObject, NSCopying {
|
|||||||
if remark.isEmpty {
|
if remark.isEmpty {
|
||||||
return "\(serverHost):\(serverPort)"
|
return "\(serverHost):\(serverPort)"
|
||||||
} else {
|
} else {
|
||||||
return "\(remark) (\(serverHost):\(serverPort))"
|
return "\(String(remark.prefix(24))) (\(serverHost):\(serverPort))"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user