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