mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-25 12:10:03 +00:00
wireless_link_bar: convert to callbacks.barval
This commit is contained in:
parent
c85295202b
commit
a11a1a1253
@ -233,7 +233,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
||||
obj->callbacks.print = &print_wireless_link_qual_perc;
|
||||
END OBJ(wireless_link_bar, &update_net_stats)
|
||||
parse_net_stat_bar_arg(obj, arg, free_at_crash);
|
||||
obj->callbacks.print = &print_wireless_link_bar;
|
||||
obj->callbacks.barval = &wireless_link_barval;
|
||||
#endif /* HAVE_IWLIB */
|
||||
|
||||
#endif /* __linux__ */
|
||||
|
@ -298,15 +298,14 @@ void print_wireless_link_qual_perc(struct text_object *obj, char *p, int p_max_s
|
||||
spaced_print(p, p_max_size, "unk", 5);
|
||||
}
|
||||
}
|
||||
void print_wireless_link_bar(struct text_object *obj, char *p, int p_max_size)
|
||||
uint8_t wireless_link_barval(struct text_object *obj)
|
||||
{
|
||||
struct net_stat *ns = obj->data.opaque;
|
||||
|
||||
if (!ns)
|
||||
return;
|
||||
return 0;
|
||||
|
||||
new_bar(obj, p, p_max_size,
|
||||
((double) ns->link_qual / ns->link_qual_max) * 255.0);
|
||||
return round_to_int((double) (ns->link_qual / ns->link_qual_max) * 255.0);
|
||||
}
|
||||
#endif /* HAVE_IWLIB */
|
||||
#endif /* __linux__ */
|
||||
|
@ -83,7 +83,7 @@ void print_wireless_ap(struct text_object *, char *, int);
|
||||
void print_wireless_link_qual(struct text_object *, char *, int);
|
||||
void print_wireless_link_qual_max(struct text_object *, char *, int);
|
||||
void print_wireless_link_qual_perc(struct text_object *, char *, int);
|
||||
void print_wireless_link_bar(struct text_object *, char *, int);
|
||||
uint8_t wireless_link_barval(struct text_object *);
|
||||
#endif /* HAVE_IWLIB */
|
||||
#endif /* __linux__ */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user