This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository enlightenment.

View the commit online.

commit 97b1675ef05140bedf4ac354b666258fad2e957b
Author: [email protected] <[email protected]>
AuthorDate: Tue Apr 14 22:02:51 2026 -0600

    feat(networkmanager): provide own theme file and add namespaced band-label part
    
    Replaces the symlink to connman's EDJ with a dedicated NetworkManager
    theme file containing only the gadget class icon. This addresses Raster's
    concern about relying on connman namespace and breaking symlink dependency.
    
    Changes:
    - New e-module-networkmanager.edc and module_icon.png (compiled via
      edje_cmd custom_target in meson.build, following shot/vkbd patterns)
    - module.desktop: Icon name corrected from e-module-connman to
      e-module-networkmanager (was a bug in the module manager UI)
    - e_mod_main.c: e_nm_theme_path() returns new filename
    - e_mod_main.c: new _enm_band_label_set() helper that guards both
      e.text.band-label (raster's preferred namespaced name, future NM theme)
      and band_label (legacy connman fallback) with edje_object_part_exists(),
      preventing spurious ERR logs. All three call sites migrated.
    
    Addresses PR #125 review comments from Raster regarding namespace
    cleanup and theme file separation.
    
    Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
---
 src/modules/networkmanager/e-module-connman.edj    |   1 -
 .../networkmanager/e-module-networkmanager.edc     |  21 +++++++++++++++++++
 src/modules/networkmanager/e_mod_main.c            |  23 ++++++++++++++++-----
 src/modules/networkmanager/meson.build             |  19 +++++++++++++++--
 src/modules/networkmanager/module.desktop          |   2 +-
 src/modules/networkmanager/module_icon.png         | Bin 0 -> 1668 bytes
 6 files changed, 57 insertions(+), 9 deletions(-)

diff --git a/src/modules/networkmanager/e-module-connman.edj b/src/modules/networkmanager/e-module-connman.edj
deleted file mode 120000
index 2b9df6e2c..000000000
--- a/src/modules/networkmanager/e-module-connman.edj
+++ /dev/null
@@ -1 +0,0 @@
-../connman/e-module-connman.edj
\ No newline at end of file
diff --git a/src/modules/networkmanager/e-module-networkmanager.edc b/src/modules/networkmanager/e-module-networkmanager.edc
new file mode 100644
index 000000000..dec90f2a4
--- /dev/null
+++ b/src/modules/networkmanager/e-module-networkmanager.edc
@@ -0,0 +1,21 @@
+images {
+   image: "module_icon.png" COMP;
+}
+
+collections {
+   group {
+      name: "icon";
+      max: 24 24;
+      parts {
+         part {
+            name: "image";
+            mouse_events: 0;
+            type: IMAGE;
+            description {
+               state: "default" 0.0;
+               image.normal: "module_icon.png";
+            }
+         }
+      }
+   }
+}
diff --git a/src/modules/networkmanager/e_mod_main.c b/src/modules/networkmanager/e_mod_main.c
index cf825f3b7..d9dcea655 100644
--- a/src/modules/networkmanager/e_mod_main.c
+++ b/src/modules/networkmanager/e_mod_main.c
@@ -13,6 +13,19 @@ int _e_nm_log_dom = -1;
 static void _enm_traffic_timer_start(E_NM_Module_Context *ctxt);
 static void _enm_traffic_timer_stop(E_NM_Module_Context *ctxt);
 
+/* Set the WiFi band label on whichever part the loaded theme exposes.
+ * Guarded with edje_object_part_exists so we don't emit ERR logs for the
+ * part that isn't present.  The module is compatible with connman's legacy
+ * "band_label" and the new namespaced "e.text.band-label". */
+static inline void
+_enm_band_label_set(Evas_Object *o, const char *text)
+{
+   if (edje_object_part_exists(o, "e.text.band-label"))
+     edje_object_part_text_set(o, "e.text.band-label", text);
+   if (edje_object_part_exists(o, "band_label"))
+     edje_object_part_text_set(o, "band_label", text);
+}
+
 const char *
 e_nm_theme_path(void)
 {
@@ -20,7 +33,7 @@ e_nm_theme_path(void)
 
    if (_theme_path) return _theme_path;
    if (!networkmanager_mod || !networkmanager_mod->dir) return NULL;
-   snprintf(buf, sizeof(buf), "%s/e-module-connman.edj",
+   snprintf(buf, sizeof(buf), "%s/e-module-networkmanager.edj",
             networkmanager_mod->dir);
    _theme_path = eina_stringshare_add(buf);
    return _theme_path;
@@ -381,7 +394,7 @@ _enm_ap_icon_new(struct NM_Manager *nm, struct NM_Access_Point *ap, Evas *evas)
         else
           band = "2.4";
 
-        edje_object_part_text_set(icon, "band_label", band);
+        _enm_band_label_set(icon, band);
      }
 
    return icon;
@@ -1032,15 +1045,15 @@ _enm_mod_manager_update_inst(E_NM_Module_Context *ctxt EINA_UNUSED,
              else
                band = "2.4G";
 
-             edje_object_part_text_set(o, "band_label", band);
+             _enm_band_label_set(o, band);
           }
         else
-          edje_object_part_text_set(o, "band_label", "");
+          _enm_band_label_set(o, "");
      }
    else
      {
         edje_object_signal_emit(o, "e,security,off", "e");
-        edje_object_part_text_set(o, "band_label", "");
+        _enm_band_label_set(o, "");
      }
 }
 
diff --git a/src/modules/networkmanager/meson.build b/src/modules/networkmanager/meson.build
index a088ce949..a691dd4da 100644
--- a/src/modules/networkmanager/meson.build
+++ b/src/modules/networkmanager/meson.build
@@ -6,10 +6,25 @@ src = ""
   'e_mod_main.h'
 )
 
-# We reuse the connman EDJ theme; no separate networkmanager EDJ is built.
+# Build our own theme file instead of symlinking connman's.
+# Only ships the gadget class icon; the full popup/gadget theme still
+# comes from the main Enlightenment theme (e/modules/networkmanager/*
+# with connman fallback).
 no_icon = true
 
+cmd = [ edje_cmd,
+        '-id', join_paths(meson.source_root(), 'src', 'modules', m),
+        '@INPUT@', '@OUTPUT@'
+      ]
+custom_target('e-module-networkmanager.edj',
+              input        : 'e-module-networkmanager.edc',
+              output       : 'e-module-networkmanager.edj',
+              command      : cmd,
+              install_dir  : _dir,
+              install_mode : 'rw-r--r--',
+              install      : true
+              )
+
 data = [
   'module.desktop',
-  'e-module-connman.edj',
 ]
diff --git a/src/modules/networkmanager/module.desktop b/src/modules/networkmanager/module.desktop
index 491ce40a5..24a51f0ad 100644
--- a/src/modules/networkmanager/module.desktop
+++ b/src/modules/networkmanager/module.desktop
@@ -3,5 +3,5 @@ Type=Link
 Name=NetworkManager
 GenericName=NetworkManager
 Comment=Control Wifi and wired networks via NetworkManager.
-Icon=e-module-connman
+Icon=e-module-networkmanager
 X-Enlightenment-ModuleType=system
diff --git a/src/modules/networkmanager/module_icon.png b/src/modules/networkmanager/module_icon.png
new file mode 100644
index 000000000..ef76f1257
Binary files /dev/null and b/src/modules/networkmanager/module_icon.png differ

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to