diff --git a/src/e_mod_popup.c b/src/e_mod_popup.c index 4062fe3..99f7aaf 100644 --- a/src/e_mod_popup.c +++ b/src/e_mod_popup.c @@ -190,7 +190,18 @@ _on_passphrase_request(void *data EINA_UNUSED, Iwd_Agent_Request *req, const cha if (n && n->ssid) ssid = n->ssid; } } - wifi_auth_prompt(_popup ? _popup->box : e_comp->elm, ssid, _on_auth_done, NULL); + const char *sec = NULL; + if (e_iwd && e_iwd->manager) + { + const Eina_Hash *h = iwd_manager_networks(e_iwd->manager); + if (h) + { + Iwd_Network *n = eina_hash_find(h, netpath); + if (n) sec = _sec_label(n->security); + } + } + wifi_auth_prompt(_popup ? _popup->box : e_comp->elm, ssid, sec, + _on_auth_done, NULL); } /* ----- popup lifecycle ------------------------------------------------- */ diff --git a/src/ui/wifi_auth.c b/src/ui/wifi_auth.c index f5e8842..8fdb1e5 100644 --- a/src/ui/wifi_auth.c +++ b/src/ui/wifi_auth.c @@ -43,6 +43,7 @@ _on_del(void *data, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *ev EI Evas_Object * wifi_auth_prompt(Evas_Object *parent EINA_UNUSED, const char *ssid, + const char *security, Wifi_Auth_Cb cb, void *data) { Auth_Ctx *c = calloc(1, sizeof(*c)); @@ -71,6 +72,17 @@ wifi_auth_prompt(Evas_Object *parent EINA_UNUSED, const char *ssid, Evas_Object *box = elm_box_add(p); elm_box_padding_set(box, 0, 6); + if (security && *security) + { + char buf[128]; + snprintf(buf, sizeof(buf), "Security: %s", security); + Evas_Object *lbl = elm_label_add(box); + elm_object_text_set(lbl, buf); + evas_object_size_hint_align_set(lbl, 0.0, 0.5); + elm_box_pack_end(box, lbl); + evas_object_show(lbl); + } + Evas_Object *entry = elm_entry_add(box); elm_entry_single_line_set(entry, EINA_TRUE); elm_entry_password_set(entry, EINA_TRUE); diff --git a/src/ui/wifi_auth.h b/src/ui/wifi_auth.h index 19a738b..684cdf2 100644 --- a/src/ui/wifi_auth.h +++ b/src/ui/wifi_auth.h @@ -5,9 +5,12 @@ typedef void (*Wifi_Auth_Cb)(void *data, const char *passphrase, Eina_Bool ok); -/* Show a modal passphrase dialog. cb is called exactly once with ok=EINA_TRUE - * + passphrase, or ok=EINA_FALSE on cancel. The dialog destroys itself. */ +/* Show a modal passphrase dialog. security is an optional human label + * (e.g. "WPA", "WEP") shown alongside the SSID; pass NULL to omit it. + * cb is called exactly once with ok=EINA_TRUE + passphrase, or + * ok=EINA_FALSE on cancel. The dialog destroys itself. */ Evas_Object *wifi_auth_prompt(Evas_Object *parent, const char *ssid, + const char *security, Wifi_Auth_Cb cb, void *data); #endif