aboutsummaryrefslogtreecommitdiffstats
path: root/src/hci
diff options
context:
space:
mode:
Diffstat (limited to 'src/hci')
-rw-r--r--src/hci/commands/dynui_cmd.c7
-rw-r--r--src/hci/tui/menu_ui.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/hci/commands/dynui_cmd.c b/src/hci/commands/dynui_cmd.c
index dbaa669ef..557c5db5d 100644
--- a/src/hci/commands/dynui_cmd.c
+++ b/src/hci/commands/dynui_cmd.c
@@ -148,6 +148,7 @@ static int item_exec ( int argc, char **argv ) {
struct item_options opts;
struct dynamic_ui *dynui;
struct dynamic_item *item;
+ unsigned int flags = 0;
char *name = NULL;
char *text = NULL;
int rc;
@@ -174,8 +175,10 @@ static int item_exec ( int argc, char **argv ) {
goto err_parse_dynui;
/* Add dynamic user interface item */
- item = add_dynui_item ( dynui, name, ( text ? text : "" ),
- opts.key, opts.is_default );
+ if ( opts.is_default )
+ flags |= DYNUI_DEFAULT;
+ item = add_dynui_item ( dynui, name, ( text ? text : "" ), flags,
+ opts.key );
if ( ! item ) {
rc = -ENOMEM;
goto err_add_dynui_item;
diff --git a/src/hci/tui/menu_ui.c b/src/hci/tui/menu_ui.c
index 00cdab8df..b7b52ee62 100644
--- a/src/hci/tui/menu_ui.c
+++ b/src/hci/tui/menu_ui.c
@@ -267,7 +267,7 @@ int show_menu ( struct dynamic_ui *dynui, unsigned long timeout,
if ( strcmp ( select, item->name ) == 0 )
ui.scroll.current = ui.scroll.count;
} else {
- if ( item->is_default )
+ if ( item->flags & DYNUI_DEFAULT )
ui.scroll.current = ui.scroll.count;
}
}