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.
This commit is contained in:
Uwe Hermann 2018-04-21 23:28:58 +02:00
parent d52107a159
commit 31c41782e4
1 changed files with 7 additions and 0 deletions

View File

@ -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));