Mark selected pool in status submenus
Not only country/group.
This commit is contained in:
parent
3b8933a9f2
commit
498e739dae
|
@ -321,10 +321,6 @@ class StatusMenu: NSObject {
|
||||||
|
|
||||||
let submenuGroup = NSMenu()
|
let submenuGroup = NSMenu()
|
||||||
for pool in group.pools {
|
for pool in group.pools {
|
||||||
if pool.id == providerProfile.poolId {
|
|
||||||
itemGroup.state = .on
|
|
||||||
}
|
|
||||||
|
|
||||||
let title = !pool.secondaryId.isEmpty ? pool.secondaryId : L10n.Core.Global.Values.default
|
let title = !pool.secondaryId.isEmpty ? pool.secondaryId : L10n.Core.Global.Values.default
|
||||||
let item = NSMenuItem(title: title, action: #selector(connectToPool(_:)), keyEquivalent: "")
|
let item = NSMenuItem(title: title, action: #selector(connectToPool(_:)), keyEquivalent: "")
|
||||||
if let extraCountry = pool.extraCountries?.first {
|
if let extraCountry = pool.extraCountries?.first {
|
||||||
|
@ -333,6 +329,11 @@ class StatusMenu: NSObject {
|
||||||
item.target = self
|
item.target = self
|
||||||
item.representedObject = pool
|
item.representedObject = pool
|
||||||
submenuGroup.addItem(item)
|
submenuGroup.addItem(item)
|
||||||
|
|
||||||
|
if pool.id == providerProfile.poolId {
|
||||||
|
itemGroup.state = .on
|
||||||
|
item.state = .on
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if submenuGroup.numberOfItems > 1 {
|
if submenuGroup.numberOfItems > 1 {
|
||||||
itemGroup.action = nil
|
itemGroup.action = nil
|
||||||
|
|
Loading…
Reference in New Issue