From: Uwe Hermann Date: Sat, 21 Apr 2018 21:28:58 +0000 (+0200) Subject: input/csv: Make the data format option a list. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=31c41782e4880303b046c7d4fd0532799215e303;p=libsigrok.git input/csv: Make the data format 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/input/csv.c b/src/input/csv.c index 770cb18e..fdfc2641 100644 --- a/src/input/csv.c +++ b/src/input/csv.c @@ -925,11 +925,18 @@ static struct sr_option options[] = { static const struct sr_option *get_options(void) { + GSList *l; + if (!options[0].def) { options[0].def = g_variant_ref_sink(g_variant_new_int32(0)); options[1].def = g_variant_ref_sink(g_variant_new_int32(0)); options[2].def = g_variant_ref_sink(g_variant_new_string(",")); options[3].def = g_variant_ref_sink(g_variant_new_string("bin")); + l = NULL; + l = g_slist_append(l, g_variant_ref_sink(g_variant_new_string("bin"))); + l = g_slist_append(l, g_variant_ref_sink(g_variant_new_string("hex"))); + l = g_slist_append(l, g_variant_ref_sink(g_variant_new_string("oct"))); + options[3].values = l; options[4].def = g_variant_ref_sink(g_variant_new_string(";")); options[5].def = g_variant_ref_sink(g_variant_new_uint64(0)); options[6].def = g_variant_ref_sink(g_variant_new_int32(0));