Enlightenment CVS committal

Author  : devilhorns
Project : e_modules
Module  : wlan

Dir     : e_modules/wlan


Modified Files:
        e_mod_main.c 


Log Message:
Fix from Spruit_elf to not graph negative values :)

===================================================================
RCS file: /cvsroot/enlightenment/e_modules/wlan/e_mod_main.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- e_mod_main.c        1 Mar 2006 16:27:22 -0000       1.11
+++ e_mod_main.c        4 Mar 2006 12:21:37 -0000       1.12
@@ -477,6 +477,8 @@
    int wlan_link = 0;
    int wlan_level = 0;
    int wlan_noise = 0;
+   int wlan_value = 0;
+   
    char in_str[100];
 
    nf = data;
@@ -510,17 +512,21 @@
    if (!found_dev)
      return 1;
 
+   wlan_value = (100 - wlan_level - wlan_noise);
+   if (wlan_level == 0)
+     wlan_value = 0;
+   
    /* Update the modules text */
    if (nf->conf->show_text)
      {
-       snprintf(in_str, sizeof(in_str), "LNK: %d%%", (100 - (wlan_level - 
wlan_noise)));
+       snprintf(in_str, sizeof(in_str), "LNK: %d%%", wlan_value);
        edje_object_part_text_set(nf->wlan_obj, "link-text", in_str);
      }   
    else
      edje_object_part_text_set(nf->wlan_obj, "link-text", "");
    
    if (nf->conf->show_graph) 
-     _wlan_face_graph_values(nf, (100 - (wlan_level - wlan_noise)));
+     _wlan_face_graph_values(nf, wlan_value);
    else
      _wlan_face_graph_clear(nf);
      




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to