From: Jean-Philippe Andre Date: Thu, 19 Feb 2009 13:51:46 +0000 (+0800) Subject: Qt: add the popup menu in the main interface X-Git-Tag: 1.0.0-pre1~269 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=10962a57ff7652aba71f606229304558270da095;p=vlc Qt: add the popup menu in the main interface --- diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp index e91d12afaf..5f1eb0f6a8 100644 --- a/modules/gui/qt4/main_interface.cpp +++ b/modules/gui/qt4/main_interface.cpp @@ -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 diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp index 4034eb5de5..6ca203c2f2 100644 --- a/modules/gui/qt4/main_interface.hpp +++ b/modules/gui/qt4/main_interface.hpp @@ -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 );