This is an automated email from the git hooks/post-receive script.
git pushed a commit to reference refs/pull/125/head
in repository enlightenment.
View the commit online.
commit d0b91ef85e658010da2f67baea784135f4e55277
Author: [email protected] <[email protected]>
AuthorDate: Sat Mar 7 12:23:50 2026 -0700
feat: support both ConnMan and NetworkManager in network service detection
The first-run wizard now detects both ConnMan and NetworkManager services
in parallel, enabling users to choose either network manager. When only
NetworkManager is available, it automatically configures Enlightenment to
use the NetworkManager module instead of ConnMan.
Detection behavior:
- If ConnMan found: prefer it, remove NetworkManager module
- If only NetworkManager found: use it, remove ConnMan module
- If neither found: show recommendation to install either service
- If network modules not compiled: explain available options
Introduces helper functions _remove_module() and _add_module() to cleanly
manage module configuration. Updates wizard title to reflect broader scope.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
src/modules/wizard/page_110.c | 274 ++++++++++++++++++++++++++----------------
1 file changed, 173 insertions(+), 101 deletions(-)
diff --git a/src/modules/wizard/page_110.c b/src/modules/wizard/page_110.c
index 5307d6790..cd325adc6 100644
--- a/src/modules/wizard/page_110.c
+++ b/src/modules/wizard/page_110.c
@@ -1,9 +1,45 @@
-/* Setup if we need connman? */
+/* Setup if we need connman or networkmanager? */
#include "e_wizard.h"
#include "e_wizard_api.h"
static void
-_recommend_connman(E_Wizard_Page *pg EINA_UNUSED)
+_remove_module(const char *name)
+{
+ E_Config_Module *em;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(e_config->modules, l, em)
+ {
+ if (!em->name) continue;
+ if (!strcmp(em->name, name))
+ {
+ e_config->modules = eina_list_remove_list(e_config->modules, l);
+ if (em->name) eina_stringshare_del(em->name);
+ free(em);
+ break;
+ }
+ }
+}
+
+static void
+_add_module(const char *name)
+{
+ E_Config_Module *em;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(e_config->modules, l, em)
+ {
+ if ((em->name) && (!strcmp(em->name, name)))
+ return;
+ }
+ em = E_NEW(E_Config_Module, 1);
+ em->name = eina_stringshare_add(name);
+ em->enabled = 1;
+ e_config->modules = eina_list_append(e_config->modules, em);
+}
+
+static void
+_recommend_nm(E_Wizard_Page *pg EINA_UNUSED)
{
Evas_Object *of, *ob;
@@ -12,54 +48,35 @@ _recommend_connman(E_Wizard_Page *pg EINA_UNUSED)
of = elm_frame_add(e_comp->elm);
ob = elm_label_add(of);
elm_object_content_set(of, ob);
-#if defined(USE_MODULE_CONNMAN) || defined(USE_MODULE_WIRELESS)
- elm_object_text_set(of, _("Connman network service not found"));
-
-
- elm_object_text_set(ob, _("Install/Enable Connman service for network management support"));
+#if defined(USE_MODULE_CONNMAN) || defined(USE_MODULE_WIRELESS) || defined(USE_MODULE_NETWORKMANAGER)
+ elm_object_text_set(of, _("No network service found"));
+ elm_object_text_set(ob,
+ _("Install/Enable ConnMan or NetworkManager for network management support"));
#else
- elm_object_text_set(of, _("Connman and Wireless modules disabled"));
- elm_object_text_set(ob, _("Install one of these modules for network management support"));
+ elm_object_text_set(of, _("Network modules disabled"));
+ elm_object_text_set(ob,
+ _("Enlightenment supports ConnMan and NetworkManager.<br>"
+ "Install one of these modules for network management support"));
#endif
evas_object_show(ob);
evas_object_show(of);
api->wizard_page_show(of);
-// pg->data = ""
api->wizard_button_next_enable_set(1);
}
static Eldbus_Connection *conn;
static Eldbus_Pending *pending_connman;
-static Ecore_Timer *connman_timeout = NULL;
+static Eldbus_Pending *pending_nm;
+static Ecore_Timer *check_timeout = NULL;
-static Eina_Bool
-_connman_fail(void *data)
-{
- E_Wizard_Page *pg = data;
- E_Config_Module *em;
- Eina_List *l;
+static Eina_Bool connman_found = EINA_FALSE;
+static Eina_Bool nm_found = EINA_FALSE;
+static Eina_Bool connman_done = EINA_FALSE;
+static Eina_Bool nm_done = EINA_FALSE;
- EINA_LIST_FOREACH(e_config->modules, l, em)
- {
- if (!em->name) continue;
- if (!strcmp(em->name, "connman"))
- {
- e_config->modules = eina_list_remove_list
- (e_config->modules, l);
- if (em->name) eina_stringshare_del(em->name);
- free(em);
- break;
- }
- }
-
- e_config_save_queue();
-
- connman_timeout = NULL;
- _recommend_connman(pg);
- return EINA_FALSE;
-}
+static void _check_results(E_Wizard_Page *pg);
static Eina_Bool
_page_next_call(void *data EINA_UNUSED)
@@ -68,90 +85,147 @@ _page_next_call(void *data EINA_UNUSED)
return ECORE_CALLBACK_CANCEL;
}
+static void
+_check_results(E_Wizard_Page *pg)
+{
+ if (!connman_done || !nm_done) return;
+
+ if (check_timeout)
+ {
+ ecore_timer_del(check_timeout);
+ check_timeout = NULL;
+ }
+
+ if (connman_found)
+ {
+ _remove_module("networkmanager");
+ e_config_save_queue();
+ api->wizard_button_next_enable_set(1);
+ ecore_idler_add(_page_next_call, NULL);
+ }
+ else if (nm_found)
+ {
+ _remove_module("connman");
+ _add_module("networkmanager");
+ e_config_save_queue();
+ api->wizard_button_next_enable_set(1);
+ ecore_idler_add(_page_next_call, NULL);
+ }
+ else
+ {
+ _remove_module("connman");
+ _remove_module("networkmanager");
+ e_config_save_queue();
+ _recommend_nm(pg);
+ }
+}
+
+static Eina_Bool
+_check_fail(void *data)
+{
+ check_timeout = NULL;
+ if (pending_connman)
+ {
+ eldbus_pending_cancel(pending_connman);
+ pending_connman = NULL;
+ }
+ if (pending_nm)
+ {
+ eldbus_pending_cancel(pending_nm);
+ pending_nm = NULL;
+ }
+ connman_done = EINA_TRUE;
+ nm_done = EINA_TRUE;
+ _check_results(data);
+ return EINA_FALSE;
+}
+
static void
_check_connman_owner(void *data, const Eldbus_Message *msg,
Eldbus_Pending *pending EINA_UNUSED)
{
const char *id;
pending_connman = NULL;
-
- if (connman_timeout)
- {
- ecore_timer_del(connman_timeout);
- connman_timeout = NULL;
- }
+ connman_done = EINA_TRUE;
if (eldbus_message_error_get(msg, NULL, NULL))
- goto fail;
-
+ goto done;
if (!eldbus_message_arguments_get(msg, "s", &id))
- goto fail;
-
+ goto done;
if (id[0] != ':')
- goto fail;
+ goto done;
- api->wizard_button_next_enable_set(1);
- ecore_idler_add(_page_next_call, NULL);
- return;
-
-fail:
- _connman_fail(data);
+ connman_found = EINA_TRUE;
+done:
+ _check_results(data);
}
-/*
-E_API int
-wizard_page_init(E_Wizard_Page *pg EINA_UNUSED, Eina_Bool *need_xdg_desktops EINA_UNUSED, Eina_Bool *need_xdg_icons EINA_UNUSED)
+static void
+_check_nm_owner(void *data, const Eldbus_Message *msg,
+ Eldbus_Pending *pending EINA_UNUSED)
{
- return 1;
+ const char *id;
+ pending_nm = NULL;
+ nm_done = EINA_TRUE;
+
+ if (eldbus_message_error_get(msg, NULL, NULL))
+ goto done;
+ if (!eldbus_message_arguments_get(msg, "s", &id))
+ goto done;
+ if (id[0] != ':')
+ goto done;
+
+ nm_found = EINA_TRUE;
+done:
+ _check_results(data);
}
-E_API int
-wizard_page_shutdown(E_Wizard_Page *pg EINA_UNUSED)
-{
- return 1;
-}
-*/
E_API int
wizard_page_show(E_Wizard_Page *pg)
{
- Eina_Bool have_connman = EINA_FALSE;
+ Eina_Bool checking = EINA_FALSE;
-#if defined(USE_MODULE_CONNMAN) || defined(USE_MODULE_WIRELESS)
+ connman_found = EINA_FALSE;
+ nm_found = EINA_FALSE;
+ connman_done = EINA_FALSE;
+ nm_done = EINA_FALSE;
+
+#if defined(USE_MODULE_CONNMAN) || defined(USE_MODULE_WIRELESS) || defined(USE_MODULE_NETWORKMANAGER)
conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
#endif
if (conn)
{
- if (pending_connman)
- eldbus_pending_cancel(pending_connman);
-
+#if defined(USE_MODULE_CONNMAN) || defined(USE_MODULE_WIRELESS)
pending_connman = eldbus_name_owner_get(conn, "net.connman",
- _check_connman_owner, pg);
- if (connman_timeout)
- ecore_timer_del(connman_timeout);
- connman_timeout = ecore_timer_loop_add(0.5, _connman_fail, pg);
- have_connman = EINA_TRUE;
+ _check_connman_owner, pg);
+ checking = EINA_TRUE;
+#else
+ connman_done = EINA_TRUE;
+#endif
+#if defined(USE_MODULE_NETWORKMANAGER)
+ pending_nm = eldbus_name_owner_get(conn, "org.freedesktop.NetworkManager",
+ _check_nm_owner, pg);
+ checking = EINA_TRUE;
+#else
+ nm_done = EINA_TRUE;
+#endif
+ }
+
+ if (checking)
+ {
+ if (check_timeout)
+ ecore_timer_del(check_timeout);
+ check_timeout = ecore_timer_loop_add(0.5, _check_fail, pg);
api->wizard_button_next_enable_set(0);
}
- if (!have_connman)
+ else
{
- E_Config_Module *em;
- Eina_List *l;
- EINA_LIST_FOREACH(e_config->modules, l, em)
- {
- if (!em->name) continue;
- if (!strcmp(em->name, "connman"))
- {
- e_config->modules = eina_list_remove_list
- (e_config->modules, l);
- if (em->name) eina_stringshare_del(em->name);
- free(em);
- break;
- }
- }
- e_config_save_queue();
- _recommend_connman(pg);
+ connman_done = EINA_TRUE;
+ nm_done = EINA_TRUE;
+ _check_results(pg);
}
- api->wizard_title_set(_("Checking to see if Connman exists"));
+
+ api->wizard_title_set(_("Checking for network services"));
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
}
@@ -163,10 +237,15 @@ wizard_page_hide(E_Wizard_Page *pg EINA_UNUSED)
eldbus_pending_cancel(pending_connman);
pending_connman = NULL;
}
- if (connman_timeout)
+ if (pending_nm)
{
- ecore_timer_del(connman_timeout);
- connman_timeout = NULL;
+ eldbus_pending_cancel(pending_nm);
+ pending_nm = NULL;
+ }
+ if (check_timeout)
+ {
+ ecore_timer_del(check_timeout);
+ check_timeout = NULL;
}
if (conn)
eldbus_connection_unref(conn);
@@ -174,10 +253,3 @@ wizard_page_hide(E_Wizard_Page *pg EINA_UNUSED)
return 1;
}
-/*
-E_API int
-wizard_page_apply(E_Wizard_Page *pg EINA_UNUSED)
-{
- return 1;
-}
-*/
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.