manager: surface D-Bus call errors to the user
Connect / Forget / Set(Powered) / Scan / Disconnect / RegisterAgent /
ConnectHidden previously discarded reply errors with NULL callbacks, so
"Connecting…" could hang forever after a refused call (rfkill, busy
adapter, another agent already registered, bad credentials on a known
network). The user had no way to see the failure.
Add iwd_manager_{report,last,clear}_error and wire reply callbacks in
adapter / device / network / agent. The popup status line now appends
the latest error to the state label, and user actions (rescan, toggle,
connect, disconnect) clear it.
Scan errors that mean "already in flight" are filtered out — they're
the normal race when two scan triggers fire close together.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3fc41eef8f
commit
0418e8bab9
7 changed files with 165 additions and 24 deletions
|
|
@ -61,6 +61,16 @@ iwd_adapter_free(Iwd_Adapter *a)
|
|||
free(a);
|
||||
}
|
||||
|
||||
static void
|
||||
_on_set_powered_reply(void *data, const Eldbus_Message *msg, Eldbus_Pending *p EINA_UNUSED)
|
||||
{
|
||||
Iwd_Adapter *a = data;
|
||||
const char *en, *em;
|
||||
if (eldbus_message_error_get(msg, &en, &em) && a->manager)
|
||||
iwd_manager_report_error(a->manager,
|
||||
"Set Adapter.Powered failed: %s", em ? em : en);
|
||||
}
|
||||
|
||||
void
|
||||
iwd_adapter_set_powered(Iwd_Adapter *a, Eina_Bool on)
|
||||
{
|
||||
|
|
@ -83,7 +93,7 @@ iwd_adapter_set_powered(Iwd_Adapter *a, Eina_Bool on)
|
|||
eldbus_message_iter_basic_append(variant, 'b', v);
|
||||
eldbus_message_iter_container_close(iter, variant);
|
||||
|
||||
eldbus_proxy_send(props, msg, NULL, NULL, -1);
|
||||
eldbus_proxy_send(props, msg, _on_set_powered_reply, a, -1);
|
||||
/* Keep the props proxy alive on the adapter so the call isn't canceled. */
|
||||
if (a->_props_proxy_keepalive) eldbus_proxy_unref(a->_props_proxy_keepalive);
|
||||
a->_props_proxy_keepalive = props;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue