Qt: fix regression about popupmenu
authorErwan Tulou <erwan10@videolan.org>
Thu, 17 Jul 2014 08:58:42 +0000 (10:58 +0200)
committerErwan Tulou <erwan10@videolan.org>
Fri, 18 Jul 2014 10:27:17 +0000 (12:27 +0200)
Always rely on the Dialog Provider to manage the popupmenu.
This fixes a regression brought by 01f2d198c11044816c1782bdfc3fe35c0ae813e2

modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/dialogs_provider.hpp
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp

index 84babdb..6d27876 100644 (file)
@@ -287,7 +287,7 @@ void BackgroundWidget::paintEvent( QPaintEvent *e )
 
 void BackgroundWidget::contextMenuEvent( QContextMenuEvent *event )
 {
-    VLCMenuBar::PopupMenu( p_intf, true );
+    THEDP->setPopupMenu();
     event->accept();
 }
 
index 19c67dc..38de867 100644 (file)
@@ -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 *********/
index bd4dd9e..7c3cf16 100644 (file)
@@ -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 )
 {
index a475b19..4327fcd 100644 (file)
@@ -140,6 +140,8 @@ public slots:
     void toolbarDialog();
     void pluginDialog();
     void epgDialog();
+    void setPopupMenu();
+    void destroyPopupMenu();
 
     void openFileGenericDialog( intf_dialog_args_t * );
 
index 43e5dcc..466e089 100644 (file)
@@ -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;
index 8a69193..f19ab0b 100644 (file)
@@ -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 = "" );