Commit 4e939d80 authored by Clément Stenac's avatar Clément Stenac

Forward-port and adapt [15500]

parent 9ac8ebb0
......@@ -59,7 +59,7 @@ public:
private:
wxMenu *CreateDummyMenu();
void CreateMenuItem( wxMenu *, char *, vlc_object_t * );
void CreateMenuItem( wxMenu *, const char *, vlc_object_t * );
wxMenu *CreateChoicesMenu( char *, vlc_object_t *, bool );
DECLARE_EVENT_TABLE();
......@@ -192,7 +192,8 @@ int AudioAutoMenuBuilder( vlc_object_t *p_object,
}
int IntfAutoMenuBuilder( intf_thread_t *p_intf,
vector<int> &ri_objects, vector<string> &rs_varnames )
vector<int> &ri_objects, vector<string> &rs_varnames,
bool is_popup)
{
/* vlc_object_find is needed because of the dialogs provider case */
vlc_object_t *p_object;
......@@ -200,6 +201,14 @@ int IntfAutoMenuBuilder( intf_thread_t *p_intf,
FIND_PARENT );
if( p_object != NULL )
{
if( is_popup )
{
#ifndef WIN32
PUSH_VAR( "intf-switch" );
#endif
}
else
PUSH_VAR( "intf-switch" );
PUSH_VAR( "intf-add" );
PUSH_VAR( "intf-skins" );
vlc_object_release( p_object );
......@@ -328,7 +337,7 @@ void MiscPopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
InputAutoMenuBuilder( VLC_OBJECT(p_input), ai_objects, as_varnames );
PUSH_SEPARATOR;
}
IntfAutoMenuBuilder( p_intf, ai_objects, as_varnames );
IntfAutoMenuBuilder( p_intf, ai_objects, as_varnames, true );
Menu popupmenu( p_intf, PopupMenu_Events );
popupmenu.Populate( as_varnames, ai_objects );
......@@ -381,7 +390,7 @@ void PopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
/* Interface menu */
PUSH_SEPARATOR
IntfAutoMenuBuilder( p_intf, ai_objects, as_varnames );
IntfAutoMenuBuilder( p_intf, ai_objects, as_varnames, true );
/* Build menu */
Menu popupmenu( p_intf, PopupMenu_Events );
......@@ -509,6 +518,7 @@ wxMenu *SettingsMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
FIND_PARENT );
if( p_object != NULL )
{
PUSH_VAR( "intf-switch" );
PUSH_VAR( "intf-add" );
vlc_object_release( p_object );
}
......@@ -632,6 +642,8 @@ static bool IsMenuEmpty( char *psz_var, vlc_object_t *p_object,
if( (i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE )
{
/* Very evil hack ! intf-switch can have only one value */
if( !strcmp( psz_var, "intf-switch" ) ) return FALSE;
if( val.i_int == 1 && b_root ) return TRUE;
else return FALSE;
}
......@@ -658,7 +670,7 @@ static bool IsMenuEmpty( char *psz_var, vlc_object_t *p_object,
return i_result;
}
void Menu::CreateMenuItem( wxMenu *menu, char *psz_var,
void Menu::CreateMenuItem( wxMenu *menu, const char *psz_var,
vlc_object_t *p_object )
{
wxMenuItemExt *menuitem;
......
......@@ -329,7 +329,9 @@ static void RunInterface( intf_thread_t *p_intf )
static char *ppsz_interfaces[] =
{
"skins2", "Skins 2",
#ifndef WIN32
"wxwidgets", "wxWidgets",
#endif
NULL, NULL
};
char **ppsz_parser;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment