]> git.sesse.net Git - vlc/commitdiff
Qt: add the popup menu in the main interface
authorJean-Philippe Andre <jpeg@via.ecp.fr>
Thu, 19 Feb 2009 13:51:46 +0000 (21:51 +0800)
committerJean-Philippe Andre <jpeg@via.ecp.fr>
Sat, 7 Mar 2009 07:40:32 +0000 (15:40 +0800)
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp

index e91d12afafe8762acdb2cf687ba801742765e78f..5f1eb0f6a847e0cf5a280b48e2b447bf204f02b9 100644 (file)
@@ -256,6 +256,11 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     /* Playlist */
     if( b_visible ) togglePlaylist();
 
+    /* Enable the popup menu in the MI */
+    setContextMenuPolicy( Qt::CustomContextMenu );
+    CONNECT( this, customContextMenuRequested( const QPoint& ),
+             this, popupMenu() );
+
     /* Final sizing and showing */
     setMinimumWidth( __MAX( controls->sizeHint().width(),
                             menuBar()->sizeHint().width() ) );
@@ -647,6 +652,11 @@ void MainInterface::toggleFSC()
    QApplication::postEvent( fullscreenControls, eShow );
 }
 
+void MainInterface::popupMenu()
+{
+    QVLCMenu::PopupMenu( p_intf, true );
+}
+
 void MainInterface::debug()
 {
 #ifndef NDEBUG
index 4034eb5de5b724c00b096e7e7e94b0c6960592c4..6ca203c2f2e3499f23ce811b9d3d06e132f7f74b 100644 (file)
@@ -159,6 +159,7 @@ public slots:
     void toggleAdvanced();
     void toggleFullScreen();
     void toggleFSC();
+    void popupMenu();
 
     /* Manage the Video Functions from the vout threads */
     void releaseVideoSlot( void );