forked from enlightenment/enlightenment
remove acpi debugging and label lid state properly in the ui!
SVN revision: 68223
This commit is contained in:
parent
0377e75f9a
commit
0add92b38a
|
@ -208,7 +208,6 @@ _e_acpi_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||||
strncpy(sdata, str, (int)(p - str));
|
strncpy(sdata, str, (int)(p - str));
|
||||||
sdata[p - str] = 0;
|
sdata[p - str] = 0;
|
||||||
/* parse out this acpi string into separate pieces */
|
/* parse out this acpi string into separate pieces */
|
||||||
printf("DBG ACPI: ACPI Event string: '%s'\n", sdata);
|
|
||||||
if (sscanf(sdata, "%1023s %1023s %x %x",
|
if (sscanf(sdata, "%1023s %1023s %x %x",
|
||||||
device, bus, &sig, &status) == 4)
|
device, bus, &sig, &status) == 4)
|
||||||
{
|
{
|
||||||
|
@ -321,8 +320,6 @@ _e_acpi_lid_status_get(const char *device, const char *bus)
|
||||||
snprintf(buff, sizeof(buff), "/proc/acpi/%s/%s/state", device, bus);
|
snprintf(buff, sizeof(buff), "/proc/acpi/%s/%s/state", device, bus);
|
||||||
if (!(f = fopen(buff, "r"))) return E_ACPI_LID_UNKNOWN;
|
if (!(f = fopen(buff, "r"))) return E_ACPI_LID_UNKNOWN;
|
||||||
|
|
||||||
printf("DBG ACPI: Lid state string: '%s'\n", buff);
|
|
||||||
|
|
||||||
/* read the line from state file */
|
/* read the line from state file */
|
||||||
buff[0] = '\0';
|
buff[0] = '\0';
|
||||||
ret = fgets(buff, 1024, f);
|
ret = fgets(buff, 1024, f);
|
||||||
|
@ -336,8 +333,6 @@ _e_acpi_lid_status_get(const char *device, const char *bus)
|
||||||
while (isalnum(buff[i])) i++;
|
while (isalnum(buff[i])) i++;
|
||||||
buff[i] = 0;
|
buff[i] = 0;
|
||||||
|
|
||||||
printf("DBG ACPI: Lid string '%s'\n", ret);
|
|
||||||
|
|
||||||
/* compare value from state file and return something sane */
|
/* compare value from state file and return something sane */
|
||||||
if (!strcmp(ret, "open")) return E_ACPI_LID_OPEN;
|
if (!strcmp(ret, "open")) return E_ACPI_LID_OPEN;
|
||||||
else if (!strcmp(ret, "closed")) return E_ACPI_LID_CLOSED;
|
else if (!strcmp(ret, "closed")) return E_ACPI_LID_CLOSED;
|
||||||
|
|
|
@ -358,8 +358,9 @@ _binding_label_get(E_Config_Binding_Acpi *bind)
|
||||||
return _("Fan");
|
return _("Fan");
|
||||||
if (bind->type == E_ACPI_TYPE_LID)
|
if (bind->type == E_ACPI_TYPE_LID)
|
||||||
{
|
{
|
||||||
if (bind->status == 0) return _("Lid Closed");
|
if (bind->status == E_ACPI_LID_UNKNOWN) return _("Lid Unknown");
|
||||||
if (bind->status == 1) return _("Lid Opened");
|
if (bind->status == E_ACPI_LID_CLOSED) return _("Lid Closed");
|
||||||
|
if (bind->status == E_ACPI_LID_OPEN) return _("Lid Opened");
|
||||||
return _("Lid");
|
return _("Lid");
|
||||||
}
|
}
|
||||||
if (bind->type == E_ACPI_TYPE_POWER)
|
if (bind->type == E_ACPI_TYPE_POWER)
|
||||||
|
|
Loading…
Reference in New Issue