From: Uwe Hermann Date: Sat, 21 Apr 2018 21:30:44 +0000 (+0200) Subject: output/csv: Make the label values option a list. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7c59d8f310ebfbdc2647247bd7e4b40013a6bd38;p=libsigrok.git output/csv: Make the label values option a list. This allows UIs to display a drop-down with all possible choices, instead of forcing the user to look up / remember all of them. --- diff --git a/src/output/csv.c b/src/output/csv.c index dce630c6..f8923112 100644 --- a/src/output/csv.c +++ b/src/output/csv.c @@ -643,6 +643,8 @@ static struct sr_option options[] = { static const struct sr_option *get_options(void) { + GSList *l = NULL; + if (!options[0].def) { options[0].def = g_variant_ref_sink(g_variant_new_string("")); options[1].def = g_variant_ref_sink(g_variant_new_boolean(TRUE)); @@ -652,6 +654,10 @@ static const struct sr_option *get_options(void) options[5].def = g_variant_ref_sink(g_variant_new_string(";")); options[6].def = g_variant_ref_sink(g_variant_new_boolean(TRUE)); options[7].def = g_variant_ref_sink(g_variant_new_string("units")); + l = g_slist_append(l, g_variant_ref_sink(g_variant_new_string("units"))); + l = g_slist_append(l, g_variant_ref_sink(g_variant_new_string("channel"))); + l = g_slist_append(l, g_variant_ref_sink(g_variant_new_string("off"))); + options[7].values = l; options[8].def = g_variant_ref_sink(g_variant_new_boolean(TRUE)); options[9].def = g_variant_ref_sink(g_variant_new_boolean(FALSE)); options[10].def = g_variant_ref_sink(g_variant_new_boolean(TRUE));