Commit 9be6878a authored by Damien Fouilleul's avatar Damien Fouilleul

- Qt4: fix popup menu

parent 31439d7a
...@@ -105,7 +105,7 @@ void DialogsProvider::customEvent( QEvent *event ) ...@@ -105,7 +105,7 @@ void DialogsProvider::customEvent( QEvent *event )
extendedDialog(); break; extendedDialog(); break;
/* We might want to make it better with custom functions */ /* We might want to make it better with custom functions */
case INTF_DIALOG_POPUPMENU: case INTF_DIALOG_POPUPMENU:
QVLCMenu::PopupMenu( p_intf ); break; QVLCMenu::PopupMenu( p_intf, (de->i_arg != 0) ); break;
case INTF_DIALOG_AUDIOPOPUPMENU: case INTF_DIALOG_AUDIOPOPUPMENU:
QVLCMenu::AudioPopupMenu( p_intf ); break; QVLCMenu::AudioPopupMenu( p_intf ); break;
case INTF_DIALOG_VIDEOPOPUPMENU: case INTF_DIALOG_VIDEOPOPUPMENU:
......
...@@ -504,8 +504,13 @@ void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf ) ...@@ -504,8 +504,13 @@ void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf )
p_intf->p_sys->p_popup_menu = NULL; p_intf->p_sys->p_popup_menu = NULL;
} }
void QVLCMenu::PopupMenu( intf_thread_t *p_intf ) void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
{ {
if( show )
{
// create a popup if there is none
if( ! p_intf->p_sys->p_popup_menu )
{
POPUP_BOILERPLATE; POPUP_BOILERPLATE;
if( p_input ) if( p_input )
{ {
...@@ -544,8 +549,15 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf ) ...@@ -544,8 +549,15 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf )
POPUP_STATIC_ENTRIES; POPUP_STATIC_ENTRIES;
p_intf->p_sys->p_popup_menu = menu; p_intf->p_sys->p_popup_menu = menu;
menu->popup( QCursor::pos() ); }
p_intf->p_sys->p_popup_menu->popup( QCursor::pos() );
}
else
{
// destroy popup if there is one
delete p_intf->p_sys->p_popup_menu;
p_intf->p_sys->p_popup_menu = NULL; p_intf->p_sys->p_popup_menu = NULL;
}
} }
#undef PUSH_VAR #undef PUSH_VAR
......
...@@ -79,7 +79,7 @@ public: ...@@ -79,7 +79,7 @@ public:
static void AudioPopupMenu( intf_thread_t * ); static void AudioPopupMenu( intf_thread_t * );
static void VideoPopupMenu( intf_thread_t * ); static void VideoPopupMenu( intf_thread_t * );
static void MiscPopupMenu( intf_thread_t * ); static void MiscPopupMenu( intf_thread_t * );
static void PopupMenu( intf_thread_t * ); static void PopupMenu( intf_thread_t *, bool );
static void DoAction( intf_thread_t *, QObject * ); static void DoAction( intf_thread_t *, QObject * );
private: private:
......
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