update iced

This commit is contained in:
Ashley Wulber 2024-10-30 22:51:08 -04:00 committed by Ashley Wulber
parent 11faa567f3
commit 5b5cd77e7c
45 changed files with 2360 additions and 1537 deletions

View file

@ -6,7 +6,10 @@ pub mod wireless_enabled;
use std::{collections::HashMap, fmt::Debug, time::Duration};
use cosmic::iced::{self, subscription};
use cosmic::{
iced::{self, Subscription},
iced_futures::stream,
};
use cosmic_dbus_networkmanager::{
active_connection::ActiveConnection,
device::SpecificDevice,
@ -42,13 +45,16 @@ pub enum State {
pub fn network_manager_subscription<I: Copy + Debug + std::hash::Hash + 'static>(
id: I,
) -> iced::Subscription<NetworkManagerEvent> {
subscription::channel(id, 50, |mut output| async move {
let mut state = State::Ready;
Subscription::run_with_id(
id,
stream::channel(50, |mut output| async move {
let mut state = State::Ready;
loop {
state = start_listening(state, &mut output).await;
}
})
loop {
state = start_listening(state, &mut output).await;
}
}),
)
}
async fn start_listening(