[iconbox] Use a_strtobool()
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
162b8a690c
commit
fb1ab46eea
|
@ -105,7 +105,6 @@ typedef enum
|
||||||
WIDGET_ERROR,
|
WIDGET_ERROR,
|
||||||
WIDGET_ERROR_NOVALUE,
|
WIDGET_ERROR_NOVALUE,
|
||||||
WIDGET_ERROR_CUSTOM,
|
WIDGET_ERROR_CUSTOM,
|
||||||
WIDGET_ERROR_FORMAT_BOOL,
|
|
||||||
WIDGET_ERROR_FORMAT_FONT,
|
WIDGET_ERROR_FORMAT_FONT,
|
||||||
WIDGET_ERROR_FORMAT_COLOR,
|
WIDGET_ERROR_FORMAT_COLOR,
|
||||||
WIDGET_ERROR_FORMAT_SECTION
|
WIDGET_ERROR_FORMAT_SECTION
|
||||||
|
|
4
widget.c
4
widget.c
|
@ -230,10 +230,6 @@ uicb_widget_tell(int screen, char *arg)
|
||||||
warn("error changing property %s of widget %s, no value given\n",
|
warn("error changing property %s of widget %s, no value given\n",
|
||||||
property, widget->name);
|
property, widget->name);
|
||||||
break;
|
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:
|
case WIDGET_ERROR_FORMAT_FONT:
|
||||||
warn("error changing property %s of widget %s, must be a valid font\n",
|
warn("error changing property %s of widget %s, must be a valid font\n",
|
||||||
property, widget->name);
|
property, widget->name);
|
||||||
|
|
|
@ -79,12 +79,7 @@ iconbox_tell(widget_t *widget, char *property, char *new_value)
|
||||||
d->image = a_strdup(new_value);
|
d->image = a_strdup(new_value);
|
||||||
}
|
}
|
||||||
else if(!a_strcmp(property, "resize"))
|
else if(!a_strcmp(property, "resize"))
|
||||||
{
|
d->resize = a_strtobool(new_value);
|
||||||
if((b = cfg_parse_boolean(new_value)) != -1)
|
|
||||||
d->resize = b;
|
|
||||||
else
|
|
||||||
return WIDGET_ERROR_FORMAT_BOOL;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
return WIDGET_ERROR;
|
return WIDGET_ERROR;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue