void BackgroundWidget::contextMenuEvent( QContextMenuEvent *event )
{
- QVLCMenu::PopupMenu( p_intf, true );
+ QVLCMenu::PopupMenu( p_intf, true, this );
event->accept();
}
QModelIndexList list = selection->selectedIndexes();
if( !model->popup( index, globalPoint, list ) )
- QVLCMenu::PopupMenu( p_intf, true );
+ QVLCMenu::PopupMenu( p_intf, true, this );
}
void StandardPLPanel::popupSelectColumn( QPoint pos )
CONNECT( SDMapper, mapped (QString), this, SDMenuAction( QString ) );
new DialogHandler (p_intf, this );
+
+ /* a root widget intended to be the ancestor of all
+ menus/actions created by the dialog_provider methods.
+ At destruction time, deleting this fake widget ensures
+ all child menus/actions are also deleted
+ */
+ root = new QWidget();
}
DialogsProvider::~DialogsProvider()
delete menusMapper;
delete menusUpdateMapper;
delete SDMapper;
+
+ delete root;
}
void DialogsProvider::quit()
vlmDialog(); break;
#endif
case INTF_DIALOG_POPUPMENU:
- QVLCMenu::PopupMenu( p_intf, (de->i_arg != 0) ); break;
+ QVLCMenu::PopupMenu( p_intf, (de->i_arg != 0), root ); break;
case INTF_DIALOG_AUDIOPOPUPMENU:
- QVLCMenu::AudioPopupMenu( p_intf ); break;
+ QVLCMenu::AudioPopupMenu( p_intf, root ); break;
case INTF_DIALOG_VIDEOPOPUPMENU:
- QVLCMenu::VideoPopupMenu( p_intf ); break;
+ QVLCMenu::VideoPopupMenu( p_intf, root ); break;
case INTF_DIALOG_MISCPOPUPMENU:
- QVLCMenu::MiscPopupMenu( p_intf ); break;
+ QVLCMenu::MiscPopupMenu( p_intf, root ); break;
case INTF_DIALOG_WIZARD:
case INTF_DIALOG_STREAMWIZARD:
openAndStreamingDialogs(); break;
static DialogsProvider *instance;
intf_thread_t *p_intf;
+ QWidget* root;
bool b_isDying;
void openDialog( int );
void MainInterface::destroyPopupMenu()
{
- QVLCMenu::PopupMenu( p_intf, false );
+ QVLCMenu::PopupMenu( p_intf, false, this );
}
void MainInterface::popupMenu( const QPoint &p )
{
- QVLCMenu::PopupMenu( p_intf, true );
+ QVLCMenu::PopupMenu( p_intf, true, this );
}
void MainInterface::toggleFSC()
QAction *action;
QMenu *menu;
+ MainInterface *mi = _mi ? _mi : p_intf->p_sys->p_mi;
+ assert( mi );
+
if( !current )
{
- menu = new QMenu( qtr( "&View" ) );
+ menu = new QMenu( qtr( "&View" ), mi );
}
else
{
}
}
- MainInterface *mi = _mi ? _mi : p_intf->p_sys->p_mi;
- assert( mi );
-
menu->addAction( QIcon( ":/menu/playlist_menu" ),
qtr( "Play&list" ), mi,
SLOT( togglePlaylist() ), qtr( "Ctrl+L" ) );
}
/* Video Tracks and Subtitles tracks */
-void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf )
+void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf, QWidget *parent )
{
POPUP_BOILERPLATE;
if( p_input )
vlc_object_release( p_vout );
}
}
- QMenu *menu = new QMenu();
+ QMenu *menu = new QMenu( parent );
CREATE_POPUP;
}
/* Audio Tracks */
-void QVLCMenu::AudioPopupMenu( intf_thread_t *p_intf )
+void QVLCMenu::AudioPopupMenu( intf_thread_t *p_intf, QWidget *parent )
{
POPUP_BOILERPLATE;
if( p_input )
if( p_aout )
vlc_object_release( p_aout );
}
- QMenu *menu = new QMenu();
+ QMenu *menu = new QMenu( parent );
CREATE_POPUP;
}
/* Navigation stuff, and general menus ( open ), used only for skins */
-void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf )
+void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf, QWidget *parent )
{
POPUP_BOILERPLATE;
PUSH_SEPARATOR;
}
- QMenu *menu = new QMenu();
+ QMenu *menu = new QMenu( parent );
Populate( p_intf, menu, varnames, objects );
menu->addSeparator();
}
/* Main Menu that sticks everything together */
-void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
+void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show, QWidget *parent )
{
/* Delete old popup if there is one */
delete p_intf->p_sys->p_popup_menu;
}
/* */
- QMenu *menu = new QMenu();
+ QMenu *menu = new QMenu( parent );
QAction *action;
bool b_isFullscreen = false;
MainInterface *mi = p_intf->p_sys->p_mi;
static void createMenuBar( MainInterface *mi, intf_thread_t * );
/* Popups Menus */
- static void PopupMenu( intf_thread_t *, bool );
- static void AudioPopupMenu( intf_thread_t * );
- static void VideoPopupMenu( intf_thread_t * );
- static void MiscPopupMenu( intf_thread_t * );
+ static void PopupMenu( intf_thread_t *, bool, QWidget * );
+ static void AudioPopupMenu( intf_thread_t *, QWidget * );
+ static void VideoPopupMenu( intf_thread_t *, QWidget * );
+ static void MiscPopupMenu( intf_thread_t *, QWidget * );
/* Systray */
static void updateSystrayMenu( MainInterface *, intf_thread_t *,