sculpt: yield focus when switching away from Wifi

When first selecting an access point to connect to, and then - while the
passphrase entry field is displayed - switching to wired networking, the
keyboard focus was still referring to the passphrase entry field instead
of yieling the focus to the inspect window. This commit fixes the
problem by adding the wifi NIC target as additional condition.
This commit is contained in:
Norman Feske 2018-06-26 14:21:42 +02:00
parent 9039bd58bd
commit 6c6b19b198
1 changed files with 3 additions and 0 deletions

View File

@ -78,6 +78,9 @@ bool Sculpt::Network_dialog::need_keyboard_focus_for_passphrase() const
if (_wifi_connection.state == Wifi_connection::CONNECTED)
return false;
if (!_nic_target.wifi())
return false;
return _for_each_ap([&] (Access_point const &ap) {
return _ap_item.selected(ap.bssid) && ap.wpa_protected(); });
}