Commit 134e65b8 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/menus.cpp: added "Open Capture Device..." and...

* modules/gui/wxwindows/menus.cpp: added "Open Capture Device..." and "Preferences..." entries in the popup menu.
parent 095c755b
......@@ -65,11 +65,6 @@ public:
void Clear();
private:
/* Event handlers (these functions should _not_ be virtual) */
void OnClose( wxCommandEvent& event );
void OnShowDialog( wxCommandEvent& event );
void OnEntrySelected( wxCommandEvent& event );
wxMenu *Menu::CreateDummyMenu();
void Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t *, bool );
......@@ -95,6 +90,8 @@ enum
OpenFile_Event,
OpenDisc_Event,
OpenNet_Event,
OpenCapture_Event,
Preferences_Event,
FirstAutoGenerated_Event = wxID_HIGHEST + 1999,
SettingsMenu_Events = wxID_HIGHEST + 5000,
AudioMenu_Events = wxID_HIGHEST + 2000,
......@@ -111,6 +108,8 @@ BEGIN_EVENT_TABLE(MenuEvtHandler, wxEvtHandler)
EVT_MENU(OpenFile_Event, MenuEvtHandler::OnShowDialog)
EVT_MENU(OpenDisc_Event, MenuEvtHandler::OnShowDialog)
EVT_MENU(OpenNet_Event, MenuEvtHandler::OnShowDialog)
EVT_MENU(OpenCapture_Event, MenuEvtHandler::OnShowDialog)
EVT_MENU(Preferences_Event, MenuEvtHandler::OnShowDialog)
EVT_MENU(-1, MenuEvtHandler::OnMenuEvent)
END_EVENT_TABLE()
......@@ -121,6 +120,7 @@ wxMenu *OpenStreamMenu( intf_thread_t *p_intf )
menu->Append( OpenFile_Event, wxU(_("Open &File...")) );
menu->Append( OpenDisc_Event, wxU(_("Open &Disc...")) );
menu->Append( OpenNet_Event, wxU(_("Open &Network Stream...")) );
menu->Append( OpenCapture_Event, wxU(_("Open &Capture Device...")) );
return menu;
}
......@@ -245,12 +245,11 @@ void PopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
Menu popupmenu( p_intf, PopupMenu_Events );
popupmenu.Populate( i, ppsz_varnames, pi_objects );
#if 1
/* Add static entries */
popupmenu.AppendSeparator();
popupmenu.Append( MenuDummy_Event, wxU("Open..."),
OpenStreamMenu( p_intf ), wxT("") );
#endif
popupmenu.Append( Preferences_Event, wxU(_("&Preferences...")) );
p_intf->p_sys->p_popup_menu = &popupmenu;
p_parent->PopupMenu( &popupmenu, pos.x, pos.y );
......@@ -794,36 +793,6 @@ wxMenu *Menu::CreateChoicesMenu( char *psz_var, vlc_object_t *p_object,
return menu;
}
void Menu::OnShowDialog( wxCommandEvent& event )
{
if( p_intf->p_sys->pf_show_dialog )
{
int i_id;
switch( event.GetId() )
{
case OpenFileSimple_Event:
i_id = INTF_DIALOG_FILE_SIMPLE;
break;
case OpenFile_Event:
i_id = INTF_DIALOG_FILE;
break;
case OpenDisc_Event:
i_id = INTF_DIALOG_DISC;
break;
case OpenNet_Event:
i_id = INTF_DIALOG_NET;
break;
default:
i_id = INTF_DIALOG_FILE;
break;
}
p_intf->p_sys->pf_show_dialog( p_intf, i_id, 1, 0 );
}
}
/*****************************************************************************
* A small helper class which intercepts all popup menu events
*****************************************************************************/
......@@ -859,6 +828,12 @@ void MenuEvtHandler::OnShowDialog( wxCommandEvent& event )
case OpenNet_Event:
i_id = INTF_DIALOG_NET;
break;
case OpenCapture_Event:
i_id = INTF_DIALOG_CAPTURE;
break;
case Preferences_Event:
i_id = INTF_DIALOG_PREFS;
break;
default:
i_id = INTF_DIALOG_FILE;
break;
......
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