Make unsaved Nearby networks clickable, add password-entry dialog
Rows for scanned networks not yet in breadcrumbs' saved config were both dimmed and disabled (set_sensitive(false)), so there was no way to add them from the popover. They now stay visually dimmed via the existing wifi-popover-row-unsaved style but remain clickable, opening a small password dialog that saves + joins the network via `breadcrumbs add` + `breadcrumbs join`.
This commit is contained in:
parent
e057f97e82
commit
8471cc02fe
5 changed files with 98 additions and 9 deletions
|
|
@ -142,3 +142,19 @@ pub fn spawn_join(ssid: String) {
|
|||
});
|
||||
}
|
||||
|
||||
/// Fire-and-forget: save a new network with its password, then join it.
|
||||
pub fn spawn_add_and_join(ssid: String, password: String) {
|
||||
relm4::spawn(async move {
|
||||
let added = tokio::process::Command::new("breadcrumbs")
|
||||
.args(["add", &ssid, &password])
|
||||
.output()
|
||||
.await;
|
||||
if matches!(added, Ok(o) if o.status.success()) {
|
||||
let _ = tokio::process::Command::new("breadcrumbs")
|
||||
.args(["join", &ssid])
|
||||
.output()
|
||||
.await;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue