Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# Changelog
## [Unreleased]

### Changed
- Core: Refactored connection monitoring from polling to event-driven D-Bus signals for faster response times and lower CPU usage ([#46](https://github.com/cachebag/nmrs/issues/46))
- Core: Replaced `tokio` with `futures-timer` for runtime-agnostic async support (fixes GTK/glib compatibility)

### Added
- Core: `ActiveConnectionState` and `ConnectionStateReason` enums for detailed connection status tracking ([#46](https://github.com/cachebag/nmrs/issues/46))
- Core: `monitor_network_changes()` API for real-time network list updates via D-Bus signals
- Core: `NetworkManager` is now `Clone`

### Fixed
- Core: `forget()` now verifies device is disconnected before deleting saved connections ([#124](https://github.com/cachebag/nmrs/issues/124))
- Core: `list_networks()` preserves security flags when deduplicating APs ([#123](https://github.com/cachebag/nmrs/issues/123))
- Core: Fixed race condition in signal subscription where rapid state changes could be missed
- GUI: Fixed UI freeze when connecting/forgetting networks

## [0.4.0-beta] - 2025-12-11
### **Breaking Changes**
- **nmrs**: Expanded `ConnectionError` enum with new variants (`AuthFailed`, `SupplicantConfigFailed`, `SupplicantTimeout`, `DhcpFailed`, `Timeout`, `Stuck`, `NoWifiDevice`, `WifiNotReady`, `NoSavedConnection`, `Failed(StateReason)`) - exhaustive matches will need a wildcard ([#82](https://github.com/cachebag/nmrs/issues/82))
Expand Down
33 changes: 30 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nmrs-gui/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nmrs-gui"
version = "0.4.0"
version = "0.5.0"
edition = "2024"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion nmrs-gui/src/ui/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ pub async fn refresh_networks(
is_scanning.set(false);
}

fn clear_children(container: &gtk::Box) {
pub fn clear_children(container: &gtk::Box) {
let mut child = container.first_child();
while let Some(widget) = child {
child = widget.next_sibling();
Expand Down
34 changes: 31 additions & 3 deletions nmrs-gui/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,45 @@ pub fn build_ui(app: &Application) {
};

let ctx = Rc::new(networks::NetworksContext {
nm,
nm: nm.clone(),
on_success,
status: status_clone.clone(),
stack: stack_clone.clone(),
parent_window: win_clone.clone(),
details_page,
});

let header =
header::build_header(ctx, &list_container_clone, is_scanning_clone, &win_clone);
let header = header::build_header(
ctx.clone(),
&list_container_clone,
is_scanning_clone.clone(),
&win_clone,
);
vbox_clone.prepend(&header);

// TODO: Re-enable network monitoring with proper UI integration
// Currently disabled because it needs access to full context for row creation
/*
// Start background network monitoring for live updates
let nm_monitor = nm.clone();
let list_container_monitor = list_container_clone.clone();
let is_scanning_monitor = is_scanning_clone;
let ctx_monitor = ctx.clone();

glib::MainContext::default().spawn_local(async move {
let _ = nm_monitor.monitor_network_changes(move || {
let ctx = ctx_monitor.clone();
let list_container = list_container_monitor.clone();
let is_scanning = is_scanning_monitor.clone();

glib::MainContext::default().spawn_local(async move {
if !is_scanning.get() {
header::refresh_networks(ctx, &list_container, &is_scanning).await;
}
});
}).await;
});
*/
}
Err(err) => {
status_clone.set_text(&format!("Failed to initialize: {err}"));
Expand Down
11 changes: 6 additions & 5 deletions nmrs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nmrs"
version = "0.4.0"
version = "0.5.0"
edition = "2024"
description = "A Rust library for NetworkManager over D-Bus"
license = "MIT"
Expand All @@ -13,10 +13,11 @@ categories = ["api-bindings", "asynchronous"]
log = "0.4.29"
zbus = "5.11.0"
zvariant = "5.7.0"
serde = { version = "1", features = ["derive"] }
thiserror = "2.0.16"
futures-timer = "3.0.3"
uuid = { version = "1.18.1", features = ["v4"] }
serde = { version = "1.0.228", features = ["derive"] }
thiserror = "2.0.17"
uuid = { version = "1.19.0", features = ["v4"] }
futures = "0.3.31"
futures-timer = "3.0"

[dev-dependencies]
tokio = { version = "1.48.0", features = ["rt-multi-thread", "macros", "sync", "time"] }
Loading
Loading