This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch connman-backend
in repository enlightenment.
View the commit online.
commit 297582cd2482501d995bdb475d384f3b717b616c
Author: Cedric BAIL <[email protected]>
AuthorDate: Mon Aug 3 14:22:57 2026 -0600
networkmanager - build the connman password dialog with Elementary
The connman agent came across from the old module still using the legacy
e_widget_* API - toolbook, framelist, widget list - while the agent right
next to it had already moved to Elementary and says so in its header
comment. So the password prompt looked like one module or the other
depending on which daemon was running, which is the opposite of the point
of merging them.
It is now an elm_frame around a labelled table of entries, same as the
NetworkManager one. The two-page toolbook goes with it: connman's
alternates are alternatives to each other, so showing them together and
sending back whichever was filled in says the same thing with less
ceremony, and drops the guesswork about which page the user was looking
at. Fields are labelled for people rather than by their wire names, and a
value connman supplies is now offered as a prefill instead of ignored.
What the two dialogs genuinely share - column sizing, entry text in and
out, the show-password toggle - moves to enm_cred_ui.c. The dialogs
themselves stay apart: NetworkManager asks for named secrets this module
labels, orders and can prefill from saved config, while connman describes
its fields on the wire, and one abstraction over both would fit neither.
Co-Authored-By: Claude Opus 5 <[email protected]>
---
po/POTFILES.in | 1 +
src/modules/networkmanager/agent.c | 45 +---
src/modules/networkmanager/enm_cred_ui.c | 54 ++++
src/modules/networkmanager/enm_cred_ui.h | 29 +++
src/modules/networkmanager/enm_net_connman_agent.c | 276 ++++++++++++---------
src/modules/networkmanager/meson.build | 2 +
6 files changed, 256 insertions(+), 151 deletions(-)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 2c5380653..c7af3aef0 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -607,6 +607,7 @@ src/modules/networkmanager/e_networkmanager_vpn.c
src/modules/networkmanager/e_networkmanager_vpn.h
src/modules/networkmanager/e_networkmanager_vpn_username.c
src/modules/networkmanager/e_networkmanager_vpn_username.h
+src/modules/networkmanager/enm_cred_ui.c
src/modules/networkmanager/enm_net.c
src/modules/networkmanager/enm_net_connman.c
src/modules/networkmanager/enm_net_connman_agent.c
diff --git a/src/modules/networkmanager/agent.c b/src/modules/networkmanager/agent.c
index 2011c1434..b671f8bc0 100644
--- a/src/modules/networkmanager/agent.c
+++ b/src/modules/networkmanager/agent.c
@@ -10,6 +10,7 @@
#include "e.h"
#include "e_networkmanager.h"
#include "e_mod_main.h"
+#include "enm_cred_ui.h"
/*
* SecretAgent UI layer.
@@ -171,13 +172,6 @@ _dialog_del_cb(void *data)
free(ad);
}
-static void
-_show_password_cb(void *data, Evas_Object *obj, void *event EINA_UNUSED)
-{
- Evas_Object *entry = data;
- elm_entry_password_set(entry, !elm_check_state_get(obj));
-}
-
static Eina_Bool
_vpn_field_is_password(const char *field)
{
@@ -266,33 +260,6 @@ _vpn_field_order_find(const char *const *fields, unsigned int n_fields,
return best == n_fields ? -1 : (int)best;
}
-static void
-_field_column_min_width_set(Evas_Object *table, int col)
-{
- Evas_Object *rect;
-
- rect = evas_object_rectangle_add(evas_object_evas_get(table));
- evas_object_color_set(rect, 0, 0, 0, 0);
- evas_object_size_hint_min_set(rect, 300 * e_scale, 1);
- evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, 0);
- evas_object_size_hint_align_set(rect, EVAS_HINT_FILL, 0.0);
- elm_table_pack(table, rect, col, 0, 1, 1);
- evas_object_show(rect);
-}
-
-static void
-_entry_text_set_plain(Evas_Object *entry, const char *text)
-{
- char *markup;
-
- if (!entry || !text || !text[0]) return;
- markup = elm_entry_utf8_to_markup(text);
- if (!markup) return;
- elm_entry_entry_set(entry, markup);
- elm_entry_cursor_end_set(entry);
- free(markup);
-}
-
/* -------------------------------------------------------------------------- */
/* Dialog construction */
/* -------------------------------------------------------------------------- */
@@ -337,7 +304,7 @@ _dialog_new(E_NM_Agent_Request *req, const char *ssid)
evas_object_size_hint_align_set(table, EVAS_HINT_FILL, 0.0);
elm_object_content_set(frame, table);
evas_object_show(table);
- _field_column_min_width_set(table, 1);
+ enm_cred_ui_column_min_width_set(table, 1);
label = elm_label_add(table);
elm_object_text_set(label, _("Password"));
@@ -357,7 +324,7 @@ _dialog_new(E_NM_Agent_Request *req, const char *ssid)
elm_table_pack(table, entry, 1, 0, 1, 1);
evas_object_show(entry);
ad->psk_entry = entry;
- _entry_text_set_plain(entry,
+ enm_cred_ui_entry_text_set(entry,
enm_config_field_value_get(ad->conn_path,
ad->setting_name,
"psk"));
@@ -367,7 +334,7 @@ _dialog_new(E_NM_Agent_Request *req, const char *ssid)
elm_check_state_set(check, EINA_FALSE);
evas_object_size_hint_align_set(check, EVAS_HINT_FILL, 0.5);
evas_object_smart_callback_add(check, "changed",
- _show_password_cb, entry);
+ enm_cred_ui_show_password_cb, entry);
elm_table_pack(table, check, 1, 1, 1, 1);
evas_object_show(check);
@@ -471,7 +438,7 @@ _vpn_dialog_new(E_NM_Agent_Request *req, const char *conn_name,
evas_object_size_hint_align_set(table, EVAS_HINT_FILL, 0.0);
elm_box_pack_end(box, table);
evas_object_show(table);
- _field_column_min_width_set(table, 1);
+ enm_cred_ui_column_min_width_set(table, 1);
for (unsigned int i = 0; i < n_fields; i++)
{
@@ -497,7 +464,7 @@ _vpn_dialog_new(E_NM_Agent_Request *req, const char *conn_name,
evas_object_show(entry);
ad->field_entries[i] = entry;
- _entry_text_set_plain(entry,
+ enm_cred_ui_entry_text_set(entry,
enm_config_field_value_get(ad->conn_path,
ad->setting_name,
field));
diff --git a/src/modules/networkmanager/enm_cred_ui.c b/src/modules/networkmanager/enm_cred_ui.c
new file mode 100644
index 000000000..418a2d887
--- /dev/null
+++ b/src/modules/networkmanager/enm_cred_ui.c
@@ -0,0 +1,54 @@
+#include "e.h"
+#include "enm_cred_ui.h"
+
+/* Shared widget handling for the credential dialogs — see enm_cred_ui.h. */
+
+void
+enm_cred_ui_column_min_width_set(Evas_Object *table, int col)
+{
+ Evas_Object *rect;
+
+ if (!table) return;
+
+ rect = evas_object_rectangle_add(evas_object_evas_get(table));
+ evas_object_color_set(rect, 0, 0, 0, 0);
+ evas_object_size_hint_min_set(rect, 300 * e_scale, 1);
+ evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, 0);
+ evas_object_size_hint_align_set(rect, EVAS_HINT_FILL, 0.0);
+ elm_table_pack(table, rect, col, 0, 1, 1);
+ evas_object_show(rect);
+}
+
+void
+enm_cred_ui_entry_text_set(Evas_Object *entry, const char *text)
+{
+ char *markup;
+
+ if (!entry || !text || !text[0]) return;
+
+ markup = elm_entry_utf8_to_markup(text);
+ if (!markup) return;
+ elm_entry_entry_set(entry, markup);
+ elm_entry_cursor_end_set(entry);
+ free(markup);
+}
+
+char *
+enm_cred_ui_entry_text_get(Evas_Object *entry)
+{
+ const char *markup;
+
+ if (!entry) return NULL;
+ markup = elm_entry_entry_get(entry);
+ if (!markup) return NULL;
+ return elm_entry_markup_to_utf8(markup);
+}
+
+void
+enm_cred_ui_show_password_cb(void *data, Evas_Object *obj,
+ void *event EINA_UNUSED)
+{
+ Evas_Object *entry = data;
+
+ elm_entry_password_set(entry, !elm_check_state_get(obj));
+}
diff --git a/src/modules/networkmanager/enm_cred_ui.h b/src/modules/networkmanager/enm_cred_ui.h
new file mode 100644
index 000000000..37011d4eb
--- /dev/null
+++ b/src/modules/networkmanager/enm_cred_ui.h
@@ -0,0 +1,29 @@
+#ifndef ENM_CRED_UI_H
+#define ENM_CRED_UI_H
+
+#include "e.h"
+
+/*
+ * Shared bits of the two credential dialogs.
+ *
+ * There are two of them because the requests are not the same shape: the
+ * NetworkManager agent is asked for named secrets it labels and orders
+ * itself and can prefill from saved config, while connman describes its
+ * fields on the wire and says which are required and which are
+ * alternatives. Only the widget handling is common, and that is what lives
+ * here - both dialogs are Elementary, and should look alike.
+ */
+
+/* Stop a table column collapsing onto the width of its content. */
+void enm_cred_ui_column_min_width_set(Evas_Object *table, int col);
+
+/* Set entry text from a plain (non-markup) string. */
+void enm_cred_ui_entry_text_set(Evas_Object *entry, const char *text);
+
+/* Read entry text back as a plain string. Caller frees; may return NULL. */
+char *enm_cred_ui_entry_text_get(Evas_Object *entry);
+
+/* "changed" callback for a show-password check; data is the entry. */
+void enm_cred_ui_show_password_cb(void *data, Evas_Object *obj, void *event);
+
+#endif /* ENM_CRED_UI_H */
diff --git a/src/modules/networkmanager/enm_net_connman_agent.c b/src/modules/networkmanager/enm_net_connman_agent.c
index 23f408f25..f7b6f98be 100644
--- a/src/modules/networkmanager/enm_net_connman_agent.c
+++ b/src/modules/networkmanager/enm_net_connman_agent.c
@@ -3,14 +3,16 @@
#include "enm_net.h"
#include "e_mod_main.h"
#include "enm_net_connman.h"
+#include "enm_cred_ui.h"
/*
* ConnMan secret agent — see enm_net_connman.h.
*
- * Adapted from the old connman module's agent. ConnMan's RequestInput
- * describes the fields it wants rather than naming a fixed credential, so
- * the dialog is generated from the request: mandatory fields land on the
- * first page, alternates (WPS instead of a passphrase, say) on a second.
+ * ConnMan's RequestInput describes the fields it wants rather than naming a
+ * fixed credential, so the dialog is generated from the request: a labelled
+ * entry per field, required ones and alternates (a WPS PIN instead of a
+ * passphrase, say) together, and whatever gets filled in is what is sent
+ * back.
*/
/*
@@ -44,9 +46,9 @@
typedef struct _Cm_Agent_Input
{
- char *key;
- char *value; /* written by the entry widget */
- int show_password;
+ char *key;
+ Evas_Object *entry;
+ Eina_Bool alternate; /* one of a set of choices, not required */
} Cm_Agent_Input;
typedef struct _Cm_Field
@@ -60,6 +62,9 @@ typedef struct _Cm_Field
typedef struct _Cm_Agent
{
E_Dialog *dialog;
+ Evas_Object *table; /* rows of label + entry */
+ int rows;
+ Eina_List *inputs; /* Cm_Agent_Input */
Eldbus_Service_Interface *iface;
Eldbus_Message *msg; /* the in-flight RequestInput */
Eldbus_Connection *conn;
@@ -78,6 +83,30 @@ _agent_of(const Eldbus_Service_Interface *iface)
return eldbus_service_object_data_get(iface, CM_AGENT_KEY);
}
+/* connman names its fields for the wire, not for people. */
+static const char *
+_field_label_get(const char *name)
+{
+ if (!name) return "";
+ if (!strcmp(name, "Passphrase")) return _("Password");
+ if (!strcmp(name, "Password")) return _("Password");
+ if (!strcmp(name, "Identity")) return _("Identity");
+ if (!strcmp(name, "Username")) return _("Username");
+ if (!strcmp(name, "WPS")) return _("WPS PIN");
+ if (!strcmp(name, "Name")) return _("Network name");
+ if (!strcmp(name, "PreviousPassphrase")) return _("Previous password");
+ return name;
+}
+
+static Eina_Bool
+_field_is_secret(const Cm_Field *field)
+{
+ if (field->type && !strcmp(field->type, "psk")) return EINA_TRUE;
+ if (field->name && !strcmp(field->name, "Passphrase")) return EINA_TRUE;
+ if (field->name && !strcmp(field->name, "Password")) return EINA_TRUE;
+ return EINA_FALSE;
+}
+
/* -------------------------------------------------------------------------- */
/* Reply building */
/* -------------------------------------------------------------------------- */
@@ -100,37 +129,47 @@ _dialog_ok_cb(void *data, E_Dialog *dialog)
{
Cm_Agent *agent = data;
Cm_Agent_Input *input;
- Evas_Object *toolbook, *list;
Eldbus_Message_Iter *iter, *array;
- Eina_List *input_list, *l;
Eldbus_Message *reply;
-
- toolbook = agent->dialog->content_object;
-
- /* Whichever page is showing is the one the user filled in. */
- list = evas_object_data_get(toolbook, "mandatory");
- if ((!list) || (!evas_object_visible_get(list)))
- {
- list = evas_object_data_get(toolbook, "alternate");
- if ((!list) || (!evas_object_visible_get(list)))
- {
- ERR("could not find the filled-in agent page");
- e_object_del(E_OBJECT(dialog));
- return;
- }
- }
+ Eina_List *l;
+ Eina_Bool any = EINA_FALSE;
+ char *val;
agent->canceled = EINA_FALSE;
- input_list = evas_object_data_get(list, "input_list");
+
+ if (!agent->msg)
+ {
+ e_object_del(E_OBJECT(dialog));
+ return;
+ }
reply = eldbus_message_method_return_new(agent->msg);
iter = eldbus_message_iter_get(reply);
eldbus_message_iter_arguments_append(iter, "a{sv}", &array);
- EINA_LIST_FOREACH(input_list, l, input)
- _dict_append_str(array, input->key, input->value);
- eldbus_message_iter_container_close(iter, array);
+ /* Alternates are alternatives to each other - a WPS PIN instead of a
+ * passphrase, say - so send back what was actually filled in and leave the
+ * rest out rather than handing connman a set of empty answers. */
+ EINA_LIST_FOREACH(agent->inputs, l, input)
+ {
+ val = enm_cred_ui_entry_text_get(input->entry);
+ if (val && val[0])
+ {
+ _dict_append_str(array, input->key, val);
+ any = EINA_TRUE;
+ }
+ free(val);
+ }
+ /* Nothing typed at all: still answer with the required fields so connman
+ * gets a well-formed reply instead of waiting out its timeout. */
+ if (!any)
+ {
+ EINA_LIST_FOREACH(agent->inputs, l, input)
+ if (!input->alternate) _dict_append_str(array, input->key, "");
+ }
+
+ eldbus_message_iter_container_close(iter, array);
eldbus_connection_send(agent->conn, reply, NULL, NULL, -1);
e_object_del(E_OBJECT(dialog));
@@ -156,6 +195,15 @@ _dialog_key_down_cb(void *data, Evas *e EINA_UNUSED,
else if (!strcmp(ev->key, "Escape")) _dialog_cancel_cb(agent, agent->dialog);
}
+static void
+_entry_activated_cb(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event EINA_UNUSED)
+{
+ Cm_Agent *agent = data;
+
+ if (agent->dialog) _dialog_ok_cb(agent, agent->dialog);
+}
+
static void
_dialog_send_cancel(Cm_Agent *agent)
{
@@ -172,6 +220,7 @@ _dialog_del_cb(void *data)
{
E_Dialog *dialog = data;
Cm_Agent *agent = e_object_data_get(E_OBJECT(dialog));
+ Cm_Agent_Input *input;
if (!agent) return;
@@ -182,31 +231,16 @@ _dialog_del_cb(void *data)
if (agent->msg) eldbus_message_unref(agent->msg);
agent->msg = NULL;
agent->dialog = NULL;
-}
+ agent->table = NULL;
+ agent->rows = 0;
-static void
-_page_del_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj,
- void *event_info EINA_UNUSED)
-{
- Cm_Agent_Input *input;
- Eina_List *input_list;
-
- input_list = evas_object_data_get(obj, "input_list");
- EINA_LIST_FREE(input_list, input)
+ EINA_LIST_FREE(agent->inputs, input)
{
free(input->key);
free(input);
}
}
-static void
-_show_password_cb(void *data, Evas_Object *obj, void *event EINA_UNUSED)
-{
- Evas_Object *entry = data;
-
- e_widget_entry_password_set(entry, !e_widget_check_checked_get(obj));
-}
-
/* -------------------------------------------------------------------------- */
/* Dialog */
/* -------------------------------------------------------------------------- */
@@ -214,15 +248,11 @@ _show_password_cb(void *data, Evas_Object *obj, void *event EINA_UNUSED)
static void
_dialog_field_add(Cm_Agent *agent, Cm_Field *field)
{
- Evas_Object *toolbook, *list, *framelist, *entry, *check;
+ Evas_Object *label, *entry, *check;
Cm_Agent_Input *input;
- Eina_List *input_list;
Eina_Bool mandatory;
- char header[128];
- Evas *evas;
- evas = evas_object_evas_get(agent->dialog->win);
- toolbook = agent->dialog->content_object;
+ if (!agent->table) return;
mandatory = !strcmp(field->requirement, "mandatory");
/* "informational" fields carry no input, and anything else is not
@@ -237,97 +267,106 @@ _dialog_field_add(Cm_Agent *agent, Cm_Field *field)
input = E_NEW(Cm_Agent_Input, 1);
if (!input) return;
input->key = strdup(field->name);
+ input->alternate = !mandatory;
- entry = e_widget_entry_add(agent->dialog->win, &(input->value),
- NULL, NULL, NULL);
+ label = elm_label_add(agent->table);
+ elm_object_text_set(label, _field_label_get(field->name));
+ evas_object_size_hint_weight_set(label, 0, 0);
+ evas_object_size_hint_align_set(label, 1.0, 0.5);
+ elm_table_pack(agent->table, label, 0, agent->rows, 1, 1);
+ evas_object_show(label);
+
+ entry = elm_entry_add(agent->table);
+ elm_entry_single_line_set(entry, EINA_TRUE);
+ elm_entry_scrollable_set(entry, EINA_TRUE);
+ evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0);
+ evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, 0.5);
+ evas_object_smart_callback_add(entry, "activated", _entry_activated_cb,
+ agent);
+ elm_table_pack(agent->table, entry, 1, agent->rows, 1, 1);
evas_object_show(entry);
-
- list = evas_object_data_get(toolbook, field->requirement);
- if (!list)
- {
- list = e_widget_list_add(evas, 0, 0);
- e_widget_toolbook_page_append(toolbook, NULL, field->name,
- list, 1, 1, 1, 1, 0.5, 0.0);
- evas_object_data_set(toolbook, field->requirement, list);
-
- e_widget_toolbook_page_show(toolbook, 0);
- evas_object_event_callback_add(list, EVAS_CALLBACK_DEL,
- _page_del_cb, NULL);
-
- if (mandatory) e_widget_focus_set(entry, 1);
- }
-
- input_list = evas_object_data_get(list, "input_list");
- input_list = eina_list_append(input_list, input);
- evas_object_data_set(list, "input_list", input_list);
-
- snprintf(header, sizeof(header), _("%s required to access network:"),
- field->name);
- framelist = e_widget_framelist_add(evas, header, 0);
- evas_object_show(framelist);
- e_widget_list_object_append(list, framelist, 1, 1, 0.5);
- e_widget_framelist_object_append(framelist, entry);
+ agent->rows++;
+ input->entry = entry;
+ enm_cred_ui_entry_text_set(entry, field->value);
/* Mask anything that is actually a secret, and offer to unmask it. */
- if ((!strcmp(field->name, "Passphrase")) ||
- (!strcmp(field->name, "Password")) ||
- (field->type && !strcmp(field->type, "psk")))
+ if (_field_is_secret(field))
{
- e_widget_entry_password_set(entry, 1);
+ elm_entry_password_set(entry, EINA_TRUE);
- check = e_widget_check_add(evas, _("Show password"),
- &(input->show_password));
+ check = elm_check_add(agent->table);
+ elm_object_text_set(check, _("Show password"));
+ elm_check_state_set(check, EINA_FALSE);
+ evas_object_size_hint_align_set(check, EVAS_HINT_FILL, 0.5);
+ evas_object_smart_callback_add(check, "changed",
+ enm_cred_ui_show_password_cb, entry);
+ elm_table_pack(agent->table, check, 1, agent->rows, 1, 1);
evas_object_show(check);
- e_widget_framelist_object_append(framelist, check);
- evas_object_smart_callback_add(check, "changed", _show_password_cb,
- entry);
+ agent->rows++;
}
- e_util_win_auto_resize_fill(agent->dialog->win);
+ agent->inputs = eina_list_append(agent->inputs, input);
+ if (mandatory && (eina_list_count(agent->inputs) == 1))
+ elm_object_focus_set(entry, EINA_TRUE);
}
+/* Build the chrome and an empty table; fields land in it afterwards, once
+ * the request has been parsed, and _dialog_show puts it on screen. */
static E_Dialog *
_dialog_new(Cm_Agent *agent)
{
- Evas_Object *toolbook;
+ Evas_Object *frame, *table;
E_Dialog *dialog;
- Evas *evas;
- int mw, mh;
dialog = e_dialog_new(NULL, "E", "connman_request_input");
if (!dialog) return NULL;
- e_dialog_resizable_set(dialog, 1);
+ e_dialog_resizable_set(dialog, 0);
- e_dialog_title_set(dialog, _("Input requested"));
- e_dialog_border_icon_set(dialog, "dialog-ask");
+ e_dialog_title_set(dialog, _("Password Required"));
+ e_dialog_border_icon_set(dialog, "dialog-password");
- e_dialog_button_add(dialog, _("Ok"), NULL, _dialog_ok_cb, agent);
+ e_dialog_button_add(dialog, _("Connect"), NULL, _dialog_ok_cb, agent);
e_dialog_button_add(dialog, _("Cancel"), NULL, _dialog_cancel_cb, agent);
agent->canceled = EINA_TRUE; /* closing the window means cancel */
- evas = evas_object_evas_get(dialog->win);
+ frame = elm_frame_add(dialog->win);
+ elm_object_text_set(frame, _("Credentials required to connect:"));
+ evas_object_size_hint_weight_set(frame, EVAS_HINT_EXPAND, 0);
+ evas_object_size_hint_align_set(frame, EVAS_HINT_FILL, EVAS_HINT_FILL);
- toolbook = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
- evas_object_show(toolbook);
+ table = elm_table_add(frame);
+ elm_table_padding_set(table, 8 * e_scale, 4 * e_scale);
+ evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, 0);
+ evas_object_size_hint_align_set(table, EVAS_HINT_FILL, 0.0);
+ elm_object_content_set(frame, table);
+ evas_object_show(table);
+ enm_cred_ui_column_min_width_set(table, 1);
- e_widget_size_min_get(toolbook, &mw, &mh);
- if (mw < 260) mw = 260;
- if (mh < 130) mh = 130;
- e_dialog_content_set(dialog, toolbook, mw, mh);
- e_dialog_show(dialog);
+ agent->table = table;
+ agent->rows = 0;
- evas_object_event_callback_add(dialog->bg_object, EVAS_CALLBACK_KEY_DOWN,
- _dialog_key_down_cb, agent);
+ evas_object_show(frame);
+ e_dialog_content_set(dialog, frame, 0, 0);
e_object_del_attach_func_set(E_OBJECT(dialog), _dialog_del_cb);
e_object_data_set(E_OBJECT(dialog), agent);
- e_dialog_button_focus_num(dialog, 0);
- elm_win_center(dialog->win, 1, 1);
-
return dialog;
}
+static void
+_dialog_show(Cm_Agent *agent)
+{
+ if (!agent->dialog) return;
+
+ enm_popups_del();
+ e_dialog_show(agent->dialog);
+ evas_object_event_callback_add(agent->dialog->bg_object,
+ EVAS_CALLBACK_KEY_DOWN,
+ _dialog_key_down_cb, agent);
+ elm_win_center(agent->dialog->win, 1, 1);
+}
+
/* -------------------------------------------------------------------------- */
/* D-Bus methods */
/* -------------------------------------------------------------------------- */
@@ -455,8 +494,6 @@ _m_request_input(const Eldbus_Service_Interface *iface,
if (agent->msg) eldbus_message_unref(agent->msg);
agent->msg = eldbus_message_ref((Eldbus_Message *)msg);
- enm_popups_del();
-
if (agent->dialog) e_object_del(E_OBJECT(agent->dialog));
agent->dialog = _dialog_new(agent);
if (!agent->dialog) goto err;
@@ -484,11 +521,26 @@ _m_request_input(const Eldbus_Service_Interface *iface,
_dialog_field_add(agent, &field);
}
+ if (!agent->inputs)
+ {
+ WRN("RequestInput asked for nothing we can prompt for");
+ goto err;
+ }
+
+ _dialog_show(agent);
+
/* Replied to later, from the dialog. */
return NULL;
err:
WRN("could not parse RequestInput");
+ if (agent->dialog)
+ {
+ /* Take the reply out of the dialog's hands first - it is answered
+ * below, and the del callback would otherwise cancel it too. */
+ agent->canceled = EINA_FALSE;
+ e_object_del(E_OBJECT(agent->dialog));
+ }
if (agent->msg)
{
eldbus_message_unref(agent->msg);
diff --git a/src/modules/networkmanager/meson.build b/src/modules/networkmanager/meson.build
index bb30ffcfc..f6ba1f465 100644
--- a/src/modules/networkmanager/meson.build
+++ b/src/modules/networkmanager/meson.build
@@ -2,6 +2,8 @@ src = ""
'e_mod_main.c',
'e_mod_config.c',
'agent.c',
+ 'enm_cred_ui.c',
+ 'enm_cred_ui.h',
'enm_net.c',
'enm_net.h',
'enm_net_nm.c',
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.