Commit 2ba05d1f authored by Erwan Tulou's avatar Erwan Tulou

Qt: fix regression about popupmenu

Always rely on the Dialog Provider to manage the popupmenu.
This fixes a regression brought by 01f2d198
parent d4f58d2a
......@@ -287,7 +287,7 @@ void BackgroundWidget::paintEvent( QPaintEvent *e )
void BackgroundWidget::contextMenuEvent( QContextMenuEvent *event )
{
VLCMenuBar::PopupMenu( p_intf, true );
THEDP->setPopupMenu();
event->accept();
}
......
......@@ -157,7 +157,7 @@ void StandardPLPanel::popupPlView( const QPoint &point )
currentView->selectionModel()->select( index, QItemSelectionModel::Select );
}
if( !popup( globalPoint ) ) VLCMenuBar::PopupMenu( p_intf, true );
if( !popup( globalPoint ) ) THEDP->setPopupMenu();
}
/*********** Popup *********/
......
......@@ -316,6 +316,18 @@ void DialogsProvider::epgDialog()
EpgDialog::getInstance( p_intf )->toggleVisible();
}
void DialogsProvider::setPopupMenu()
{
delete popupMenu;
popupMenu = VLCMenuBar::PopupMenu( p_intf, true );
}
void DialogsProvider::destroyPopupMenu()
{
delete popupMenu;
popupMenu = NULL;
}
/* Generic open file */
void DialogsProvider::openFileGenericDialog( intf_dialog_args_t *p_arg )
{
......
......@@ -140,6 +140,8 @@ public slots:
void toolbarDialog();
void pluginDialog();
void epgDialog();
void setPopupMenu();
void destroyPopupMenu();
void openFileGenericDialog( intf_dialog_args_t * );
......
......@@ -159,7 +159,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
************/
VLCMenuBar::createMenuBar( this, p_intf );
CONNECT( THEMIM->getIM(), voutListChanged( vout_thread_t **, int ),
this, destroyPopupMenu() );
THEDP, destroyPopupMenu() );
createMainWidget( settings );
......@@ -429,7 +429,7 @@ void MainInterface::createMainWidget( QSettings *creationSettings )
/* Enable the popup menu in the MI */
main->setContextMenuPolicy( Qt::CustomContextMenu );
CONNECT( main, customContextMenuRequested( const QPoint& ),
this, popupMenu( const QPoint& ) );
THEDP, setPopupMenu() );
if ( depth() > 8 ) /* 8bit depth has too many issues with opacity */
/* Create the FULLSCREEN CONTROLS Widget */
......@@ -611,16 +611,6 @@ inline void MainInterface::showTab( QWidget *widget )
}
}
void MainInterface::destroyPopupMenu()
{
VLCMenuBar::PopupMenu( p_intf, false );
}
void MainInterface::popupMenu( const QPoint & )
{
VLCMenuBar::PopupMenu( p_intf, true );
}
void MainInterface::toggleFSC()
{
if( !fullscreenControls ) return;
......
......@@ -199,7 +199,6 @@ public slots:
void setStatusBarVisibility(bool b_visible);
void setPlaylistVisibility(bool b_visible);
void popupMenu( const QPoint& );
#ifdef _WIN32
void changeThumbbarButtons( int );
#endif
......@@ -217,7 +216,6 @@ public slots:
private slots:
void debug();
void destroyPopupMenu();
void recreateToolbars();
void setName( const QString& );
void setVLCWindowsTitle( const QString& title = "" );
......
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