Removed known wifi from visible wireless networks section
This commit is contained in:
parent
b0f709aa15
commit
f140e80bf9
1 changed files with 36 additions and 22 deletions
|
|
@ -1919,28 +1919,42 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let mut list_col =
|
let list_col = self
|
||||||
Vec::with_capacity(self.nm_state.nm_state.wireless_access_points.len());
|
.nm_state
|
||||||
for ap in &self.nm_state.nm_state.wireless_access_points {
|
.nm_state
|
||||||
if self.nm_state.nm_state.active_conns.iter().any(|a| {
|
.wireless_access_points
|
||||||
let hw_address = active_conn_hw_address(a);
|
.iter()
|
||||||
ap.ssid.as_ref() == &a.name() && ap.hw_address == hw_address
|
.filter(|ap| {
|
||||||
}) {
|
let among_active = self.nm_state.nm_state.active_conns.iter().any(|a| {
|
||||||
continue;
|
let hw_address = active_conn_hw_address(a);
|
||||||
}
|
ap.ssid.as_ref() == &a.name() && ap.hw_address == hw_address
|
||||||
let button = menu_button(
|
});
|
||||||
row![
|
let among_known =
|
||||||
icon::from_name(wifi_icon(ap.strength))
|
self.nm_state
|
||||||
.size(16)
|
.nm_state
|
||||||
.symbolic(true),
|
.known_access_points
|
||||||
text::body(ap.ssid.as_ref()).align_y(Alignment::Center)
|
.iter()
|
||||||
]
|
.any(|known_ap| {
|
||||||
.align_y(Alignment::Center)
|
ap.network_type == known_ap.network_type
|
||||||
.spacing(12),
|
&& ap.hw_address == known_ap.hw_address
|
||||||
)
|
&& ap.ssid == known_ap.ssid
|
||||||
.on_press(Message::SelectWirelessAccessPoint(ap.clone()));
|
});
|
||||||
list_col.push(button.into());
|
!among_active && !among_known
|
||||||
}
|
})
|
||||||
|
.map(|ap| {
|
||||||
|
let button = menu_button(
|
||||||
|
row![
|
||||||
|
icon::from_name(wifi_icon(ap.strength))
|
||||||
|
.size(16)
|
||||||
|
.symbolic(true),
|
||||||
|
text::body(ap.ssid.as_ref()).align_y(Alignment::Center)
|
||||||
|
]
|
||||||
|
.align_y(Alignment::Center)
|
||||||
|
.spacing(12),
|
||||||
|
)
|
||||||
|
.on_press(Message::SelectWirelessAccessPoint(ap.clone()));
|
||||||
|
button.into()
|
||||||
|
});
|
||||||
content = content
|
content = content
|
||||||
.push(scrollable(Column::with_children(list_col)).height(Length::Fixed(300.0)));
|
.push(scrollable(Column::with_children(list_col)).height(Length::Fixed(300.0)));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue