From c1d46330ea607d21337a79e6d1c79e65d0bbed77 Mon Sep 17 00:00:00 2001 From: ben Date: Sun, 25 Jun 2006 21:24:46 +0000 Subject: [PATCH] support for auto_close parameter in menu command list (geexbox patch) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18823 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmenu/menu_cmdlist.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libmenu/menu_cmdlist.c b/libmenu/menu_cmdlist.c index 57b78e1e14..5d266d014e 100644 --- a/libmenu/menu_cmdlist.c +++ b/libmenu/menu_cmdlist.c @@ -35,15 +35,20 @@ struct list_entry_s { struct menu_priv_s { menu_list_priv_t p; + int auto_close; }; +#define ST_OFF(m) M_ST_OFF(struct menu_priv_s, m) + static struct menu_priv_s cfg_dflt = { - MENU_LIST_PRIV_DFLT + MENU_LIST_PRIV_DFLT, + 0, }; static m_option_t cfg_fields[] = { MENU_LIST_PRIV_FIELDS, { "title",M_ST_OFF(struct menu_priv_s,p.title), CONF_TYPE_STRING, 0, 0, 0, NULL }, + { "auto-close", ST_OFF(auto_close), CONF_TYPE_FLAG, 0, 0, 1, NULL }, { NULL, NULL, NULL, 0,0,0,NULL } }; @@ -61,7 +66,11 @@ static void read_cmd(menu_t* menu,int cmd) { if(mpriv->p.current->ok) { mp_cmd_t* c = mp_input_parse_cmd(mpriv->p.current->ok); if(c) + { + if (mpriv->auto_close) + mp_input_queue_cmd (mp_input_parse_cmd ("menu hide")); mp_input_queue_cmd(c); + } } } break; case MENU_CMD_LEFT: