Enlightenment CVS committal

Author  : devilhorns
Project : e_modules
Module  : cpu

Dir     : e_modules/cpu


Modified Files:
        Makefile.am cpu.edc e_mod_main.c 


Log Message:
Fix edc formatting.
If there is just one cpu, set the text & exit.

===================================================================
RCS file: /cvs/e/e_modules/cpu/Makefile.am,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- Makefile.am 15 Nov 2007 19:36:54 -0000      1.22
+++ Makefile.am 14 Feb 2008 19:42:46 -0000      1.23
@@ -14,6 +14,7 @@
 EXTRA_DIST = $(files_DATA) \
 cpu.edc \
 VeraMono.ttf \
+VeraBd.ttf \
 cpu.png \
 e_modules-cpu.spec
 
===================================================================
RCS file: /cvs/e/e_modules/cpu/cpu.edc,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- cpu.edc     14 Feb 2008 19:23:19 -0000      1.21
+++ cpu.edc     14 Feb 2008 19:42:46 -0000      1.22
@@ -27,58 +27,35 @@
          {
             part
               {
-                 name:           "fade_clip";
-                 type:           RECT;
-                 mouse_events:   0;
-                 description
-                   {
-                      state: "default" 0.0;
-                      color: 255 255 255 255;
-                   }
-              }
-            part
-              {
                  name: "cpu";
-                 clip_to: "fade_clip";
                  description
                    {
                       state: "default" 0.0;
                       aspect: 1.0 1.0;
                       aspect_preference: BOTH;
                       align: 0.5 0.5;
-                      image
-                        {
-                           normal: "cpu.png";
-                        }
+                      image.normal: "cpu.png";
                    }
               }
             part
               {
-                 name:           "load";
-                 type:           TEXTBLOCK;
-                 effect:         SOFT_SHADOW;
+                 name: "load";
+                 type: TEXTBLOCK;
+                 effect: OUTLINE_SOFT_SHADOW;
                  mouse_events: 0;
-                 clip_to: "fade_clip";
                  description
                    {
                       state: "default" 0.0;
                       align: 0.5 0.5;
-                      rel1
-                        {
-                           relative: 0.0  0.0;
-                           to: "cpu";
-                        }
-                      rel2
-                        {
-                           relative: 1.0  1.0;
-                           to: "cpu";
-                        }
+                      rel1.to: "cpu";
+                      rel2.to: "cpu";
                        text
                          {
-                            style:    "cpu_style";
-                            min:      0 1;
+                            style: "cpu_style";
+                            min: 0 1;
                          }
                     }
                }
           }
      }
+}
===================================================================
RCS file: /cvs/e/e_modules/cpu/e_mod_main.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- e_mod_main.c        14 Feb 2008 19:23:19 -0000      1.46
+++ e_mod_main.c        14 Feb 2008 19:42:46 -0000      1.47
@@ -69,7 +69,6 @@
    char buf[4096];
 
    cpu_count = _get_cpu_count();
-   printf("Cpus: %d\n", cpu_count);
 
    inst = E_NEW(Instance, 1);   
    inst->ci = _config_item_get(id);
@@ -214,11 +213,15 @@
 
    _get_cpu_load();
 
-   if (cpu_count == 1)
-     snprintf(str, sizeof(str), "<br>%d%%", cpu_stats[0]);
+   if (cpu_count == 1) 
+     {
+        snprintf(str, sizeof(str), "<br>%d%%", cpu_stats[0]);
+        edje_object_part_text_set(cpu->o_icon, "load", str);
+        return 1;
+     }
    else
      snprintf(str, sizeof(str), "%d%%", cpu_stats[0]);
-   
+
    i = 1;
    while (i < cpu_count)
      {
@@ -300,15 +303,10 @@
    */
 
    if (cpu_count > 1) 
-     {
-        /* I had to add another %lu (linux 2.6.17) */
-        fscanf(stat, "%s %lu %lu %lu %lu %lu %lu %lu %lu %lu", dummy, &new_u, 
&new_n, &new_s, &new_i, &new_wa, &new_hi, &new_si, &dummy2, &dummy3);
-     }
+     fscanf(stat, "%s %lu %lu %lu %lu %lu %lu %lu %lu %lu", dummy, &new_u, 
&new_n, &new_s, &new_i, &new_wa, &new_hi, &new_si, &dummy2, &dummy3);
 
    while (i < cpu_count)
      {
-
-        /* I had to add another %lu (linux 2.6.17) */
        if (fscanf(stat, "%s %lu %lu %lu %lu %lu %lu %lu %lu %lu", dummy, 
&new_u, &new_n,
             &new_s, &new_i, &new_wa, &new_hi, &new_si, &dummy2, &dummy3) < 5)
          {



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to