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 {
|
||||
var profileName :String
|
||||
if !p.remark.isEmpty {
|
||||
profileName = p.remark
|
||||
profileName = String(p.remark.prefix(24))
|
||||
} else {
|
||||
profileName = p.serverHost
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ class PreferencesWindowController: NSWindowController
|
||||
let profile = profileMgr.profiles[index]
|
||||
let isActive = (profileMgr.activeProfileId == profile.uuid)
|
||||
if !profile.remark.isEmpty {
|
||||
return (profile.remark, isActive)
|
||||
return (String(profile.remark.prefix(24)), isActive)
|
||||
} else {
|
||||
return (profile.serverHost, isActive)
|
||||
}
|
||||
|
@ -328,7 +328,7 @@ class ServerProfile: NSObject, NSCopying {
|
||||
if remark.isEmpty {
|
||||
return "\(serverHost):\(serverPort)"
|
||||
} else {
|
||||
return "\(remark) (\(serverHost):\(serverPort))"
|
||||
return "\(String(remark.prefix(24))) (\(serverHost):\(serverPort))"
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user