From 25e163a19b582424c01e10fc425e1157e09f9252 Mon Sep 17 00:00:00 2001 From: nicodvb Date: Fri, 24 Feb 2006 23:01:40 +0000 Subject: [PATCH] auto hide dvb menu if auto-close is specified in menu.conf; patch by Ben Zores ben a geexbox di org git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17683 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmenu/menu_dvbin.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libmenu/menu_dvbin.c b/libmenu/menu_dvbin.c index cdec9c72d8..7da0397aa6 100644 --- a/libmenu/menu_dvbin.c +++ b/libmenu/menu_dvbin.c @@ -39,6 +39,7 @@ struct menu_priv_s { char* file; int card; int level; + int auto_close; dvb_config_t *config; }; @@ -49,6 +50,7 @@ struct menu_priv_s { static m_option_t cfg_fields[] = { MENU_LIST_PRIV_FIELDS, { "title", ST_OFF(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 }, }; @@ -59,6 +61,7 @@ static struct menu_priv_s cfg_dflt = { "channels.conf", 0, 0, + 1, NULL, }; @@ -210,7 +213,11 @@ static void read_cmd(menu_t* menu, int cmd) c = mp_input_parse_cmd(cmd_name); if(c) - mp_input_queue_cmd(c); + { + if (mpriv->auto_close) + mp_input_queue_cmd (mp_input_parse_cmd ("menu hide")); + mp_input_queue_cmd(c); + } } } break;