Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/modules/temperature


Modified Files:
        e_mod_config.c e_mod_main.c e_mod_main.h 


Log Message:


patches (see devel list) :)

===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/temperature/e_mod_config.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- e_mod_config.c      3 Sep 2006 07:40:45 -0000       1.23
+++ e_mod_config.c      21 Oct 2006 02:32:14 -0000      1.24
@@ -29,6 +29,7 @@
    int high_temp;
 
    int sensor;
+   int acpizone;
 };
 
 /* Protos */
@@ -67,6 +68,7 @@
 _fill_data(E_Config_Dialog_Data *cfdata) 
 {
    double p;
+   Ecore_List *therms;
    
    cfdata->units = temperature_config->units;
    if (temperature_config->units == CELCIUS) 
@@ -117,6 +119,20 @@
        else if (!strcmp(temperature_config->sensor_name, "temp3")) 
          cfdata->sensor = 2;
      }
+   cfdata->acpizone= 0;
+   if (temperature_config->acpi_sel)
+     {
+       therms = ecore_file_ls("/proc/acpi/thermal_zone");
+       char *tzone;
+       int n = 0;
+       while ((tzone = ecore_list_next(therms)))
+         {
+          if (!strcmp(temperature_config->acpi_sel, tzone))
+            cfdata->acpizone = n;
+          else n++;
+        }
+       ecore_list_destroy(therms);
+     }
 }
 
 static void *
@@ -293,6 +309,25 @@
               }
          }
      }
+   else
+     {
+       if (!ecore_list_is_empty(therms))
+         {
+            of = e_widget_framelist_add(evas, _("ACPI Temperature"), 0);
+            rg = e_widget_radio_group_new(&(cfdata->acpizone));
+            char *tzone;
+            int n = 0;
+            while ((tzone = ecore_list_next(therms)))
+              {
+                 ob = e_widget_radio_add(evas, _(tzone), n, rg);
+                 e_widget_framelist_object_append(of, ob);
+                 n++;
+              }
+            e_widget_list_object_append(o, of, 1, 1, 0.5);
+            ecore_list_destroy(therms);
+            therms = NULL;
+         }
+     }
    if (therms) ecore_list_destroy(therms);
 #endif
 
@@ -381,6 +416,23 @@
        temperature_config->sensor_name = evas_stringshare_add("temp3");
        break;
      }
+   if (temperature_config->acpi_sel)
+     evas_stringshare_del(temperature_config->acpi_sel);
+   temperature_config->acpi_sel = NULL;
+   int n = 0;
+   Ecore_List *therms;
+   char *tzone;
+   therms = ecore_file_ls("/proc/acpi/thermal_zone");
+   if ((therms) || !ecore_list_is_empty(therms))
+     {
+       while ((tzone = ecore_list_next(therms)))
+         {
+          if (n == cfdata->acpizone)
+            temperature_config->acpi_sel = evas_stringshare_add(tzone);
+          n++;
+        }
+     } 
+   ecore_list_destroy(therms);  
    _temperature_face_cb_config_updated();
    e_config_save_queue();
    return 1;
===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/temperature/e_mod_main.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -3 -r1.70 -r1.71
--- e_mod_main.c        18 Sep 2006 03:49:45 -0000      1.70
+++ e_mod_main.c        21 Oct 2006 02:32:14 -0000      1.71
@@ -276,7 +276,7 @@
          {
             char *p, *q;
             FILE *f;
-
+            name = temperature_config->acpi_sel;
             snprintf(buf, sizeof(buf), 
"/proc/acpi/thermal_zone/%s/temperature", name);
             f = fopen(buf, "rb");
             if (f)
@@ -403,6 +403,7 @@
    E_CONFIG_VAL(D, T, high, INT);
    E_CONFIG_VAL(D, T, sensor_name, STR);
    E_CONFIG_VAL(D, T, units, INT);
+   E_CONFIG_VAL(D, T, acpi_sel, STR);
 
    temperature_config = e_config_domain_load("module.temperature", conf_edd);
    if (!temperature_config)
@@ -413,6 +414,7 @@
        temperature_config->high = 80;
        temperature_config->sensor_name = evas_stringshare_add("temp1");
        temperature_config->units = CELCIUS;
+       temperature_config->acpi_sel = evas_stringshare_add("TZ1");
      }
    E_CONFIG_LIMIT(temperature_config->poll_time, 0.5, 1000.0);
    E_CONFIG_LIMIT(temperature_config->low, 0, 100);
===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/temperature/e_mod_main.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- e_mod_main.h        6 Jun 2006 15:25:13 -0000       1.23
+++ e_mod_main.h        21 Oct 2006 02:32:14 -0000      1.24
@@ -18,6 +18,7 @@
    double           poll_time;
    int              low, high;
    const char      *sensor_name;
+   const char     *acpi_sel;
    Unit             units;
    /* just config state */
    E_Module        *module;



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to