[iconbox] Use a_strtobool()

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-05-11 16:20:58 +02:00
parent 162b8a690c
commit fb1ab46eea
3 changed files with 1 additions and 11 deletions

View File

@ -105,7 +105,6 @@ typedef enum
WIDGET_ERROR,
WIDGET_ERROR_NOVALUE,
WIDGET_ERROR_CUSTOM,
WIDGET_ERROR_FORMAT_BOOL,
WIDGET_ERROR_FORMAT_FONT,
WIDGET_ERROR_FORMAT_COLOR,
WIDGET_ERROR_FORMAT_SECTION

View File

@ -230,10 +230,6 @@ uicb_widget_tell(int screen, char *arg)
warn("error changing property %s of widget %s, no value given\n",
property, widget->name);
break;
case WIDGET_ERROR_FORMAT_BOOL:
warn("error changing property %s of widget %s, must is boolean (0 or 1)\n",
property, widget->name);
break;
case WIDGET_ERROR_FORMAT_FONT:
warn("error changing property %s of widget %s, must be a valid font\n",
property, widget->name);

View File

@ -79,12 +79,7 @@ iconbox_tell(widget_t *widget, char *property, char *new_value)
d->image = a_strdup(new_value);
}
else if(!a_strcmp(property, "resize"))
{
if((b = cfg_parse_boolean(new_value)) != -1)
d->resize = b;
else
return WIDGET_ERROR_FORMAT_BOOL;
}
d->resize = a_strtobool(new_value);
else
return WIDGET_ERROR;