hide thermometer when there is no temperature info...

SVN revision: 12772
This commit is contained in:
Carsten Haitzler 2005-01-05 07:56:56 +00:00
parent a8fecbd451
commit 477d160e1f
3 changed files with 21 additions and 5 deletions

View File

@ -5596,15 +5596,15 @@ collections {
} }
programs { programs {
program { program {
name: "on"; name: "known";
signal: "enable"; signal: "known";
source: ""; source: "";
action: STATE_SET "default" 0.0; action: STATE_SET "default" 0.0;
target: "fade_clip"; target: "fade_clip";
} }
program { program {
name: "off"; name: "unknown";
signal: "disable"; signal: "unknown";
source: ""; source: "";
action: STATE_SET "faded" 0.0; action: STATE_SET "faded" 0.0;
target: "fade_clip"; target: "fade_clip";

View File

@ -602,6 +602,8 @@ _temperature_face_init(Temperature_Face *ef)
edje_object_size_min_calc(ef->temp_object, &bw, &bh); edje_object_size_min_calc(ef->temp_object, &bw, &bh);
ef->minsize = bh; ef->minsize = bh;
ef->minsize = bw; ef->minsize = bw;
ef->have_temp = -1;
_temperature_face_reconfigure(ef); _temperature_face_reconfigure(ef);
@ -747,10 +749,22 @@ _temperature_cb_check(void *data)
therms = e_file_ls("/proc/acpi/thermal_zone"); therms = e_file_ls("/proc/acpi/thermal_zone");
if (!therms) if (!therms)
{ {
/* disable therm object */ if (ef->have_temp != 0)
{
/* disable therm object */
edje_object_signal_emit(ef->temp_object, "unknown", "");
edje_object_part_text_set(ef->temp_object, "reading", "NO TEMP");
ef->have_temp = 0;
}
} }
else else
{ {
if (ef->have_temp != 1)
{
/* disable therm object */
edje_object_signal_emit(ef->temp_object, "known", "");
ef->have_temp = 1;
}
while (therms) while (therms)
{ {
char buf[4096], units[32]; char buf[4096], units[32];

View File

@ -41,6 +41,8 @@ struct _Temperature_Face
Evas_Coord xx, yy; Evas_Coord xx, yy;
Evas_Coord fx, fy, fw; Evas_Coord fx, fy, fw;
int have_temp;
Ecore_Timer *temperature_check_timer; Ecore_Timer *temperature_check_timer;
Ecore_Event_Handler *ev_handler_container_resize; Ecore_Event_Handler *ev_handler_container_resize;