mirror of
https://github.com/mpv-player/mpv
synced 2025-04-11 04:01:31 +00:00
Remove redundant option 'auto-close' from cmdlist and filesel.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25533 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
1686f19335
commit
1fbd5fb5f4
@ -35,20 +35,17 @@ struct list_entry_s {
|
|||||||
|
|
||||||
struct menu_priv_s {
|
struct menu_priv_s {
|
||||||
menu_list_priv_t p;
|
menu_list_priv_t p;
|
||||||
int auto_close;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ST_OFF(m) M_ST_OFF(struct menu_priv_s, m)
|
#define ST_OFF(m) M_ST_OFF(struct menu_priv_s, m)
|
||||||
|
|
||||||
static struct menu_priv_s cfg_dflt = {
|
static struct menu_priv_s cfg_dflt = {
|
||||||
MENU_LIST_PRIV_DFLT,
|
MENU_LIST_PRIV_DFLT,
|
||||||
0,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static m_option_t cfg_fields[] = {
|
static m_option_t cfg_fields[] = {
|
||||||
MENU_LIST_PRIV_FIELDS,
|
MENU_LIST_PRIV_FIELDS,
|
||||||
{ "title",M_ST_OFF(struct menu_priv_s,p.title), CONF_TYPE_STRING, 0, 0, 0, NULL },
|
{ "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 }
|
{ NULL, NULL, NULL, 0,0,0,NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -62,13 +59,8 @@ static void read_cmd(menu_t* menu,int cmd) {
|
|||||||
break;
|
break;
|
||||||
} // fallback on ok if right is not defined
|
} // fallback on ok if right is not defined
|
||||||
case MENU_CMD_OK:
|
case MENU_CMD_OK:
|
||||||
if(mpriv->p.current->ok) {
|
if (mpriv->p.current->ok)
|
||||||
if (mp_input_parse_and_queue_cmds(mpriv->p.current->ok))
|
mp_input_parse_and_queue_cmds(mpriv->p.current->ok);
|
||||||
{
|
|
||||||
if (mpriv->auto_close)
|
|
||||||
mp_input_queue_cmd (mp_input_parse_cmd ("menu hide"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case MENU_CMD_LEFT:
|
case MENU_CMD_LEFT:
|
||||||
if(mpriv->p.current->left) {
|
if(mpriv->p.current->left) {
|
||||||
|
@ -45,7 +45,6 @@ struct menu_priv_s {
|
|||||||
char* title;
|
char* title;
|
||||||
char* file_action;
|
char* file_action;
|
||||||
char* dir_action;
|
char* dir_action;
|
||||||
int auto_close;
|
|
||||||
char** actions;
|
char** actions;
|
||||||
char* filter;
|
char* filter;
|
||||||
};
|
};
|
||||||
@ -58,7 +57,6 @@ static struct menu_priv_s cfg_dflt = {
|
|||||||
"Select a file: %p",
|
"Select a file: %p",
|
||||||
"loadfile '%p'",
|
"loadfile '%p'",
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
@ -71,7 +69,6 @@ static m_option_t cfg_fields[] = {
|
|||||||
{ "title", ST_OFF(title), CONF_TYPE_STRING, 0, 0, 0, NULL },
|
{ "title", ST_OFF(title), CONF_TYPE_STRING, 0, 0, 0, NULL },
|
||||||
{ "file-action", ST_OFF(file_action), CONF_TYPE_STRING, 0, 0, 0, NULL },
|
{ "file-action", ST_OFF(file_action), CONF_TYPE_STRING, 0, 0, 0, NULL },
|
||||||
{ "dir-action", ST_OFF(dir_action), CONF_TYPE_STRING, 0, 0, 0, NULL },
|
{ "dir-action", ST_OFF(dir_action), CONF_TYPE_STRING, 0, 0, 0, NULL },
|
||||||
{ "auto-close", ST_OFF(auto_close), CONF_TYPE_FLAG, 0, 0, 1, NULL },
|
|
||||||
{ "actions", ST_OFF(actions), CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
|
{ "actions", ST_OFF(actions), CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
|
||||||
{ "filter", ST_OFF(filter), CONF_TYPE_STRING, 0, 0, 0, NULL},
|
{ "filter", ST_OFF(filter), CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||||
{ NULL, NULL, NULL, 0,0,0,NULL }
|
{ NULL, NULL, NULL, 0,0,0,NULL }
|
||||||
@ -354,10 +351,7 @@ static void read_cmd(menu_t* menu,int cmd) {
|
|||||||
char *action = mpriv->p.current->d ? mpriv->dir_action:mpriv->file_action;
|
char *action = mpriv->p.current->d ? mpriv->dir_action:mpriv->file_action;
|
||||||
sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt);
|
sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt);
|
||||||
str = replace_path(action, filename);
|
str = replace_path(action, filename);
|
||||||
if (mp_input_parse_and_queue_cmds(str)) {
|
mp_input_parse_and_queue_cmds(str);
|
||||||
if(mpriv->auto_close)
|
|
||||||
menu->cl = 1;
|
|
||||||
}
|
|
||||||
if (str != action)
|
if (str != action)
|
||||||
free(str);
|
free(str);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user