From 10962a57ff7652aba71f606229304558270da095 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Thu, 19 Feb 2009 21:51:46 +0800 Subject: [PATCH] Qt: add the popup menu in the main interface --- modules/gui/qt4/main_interface.cpp | 10 ++++++++++ modules/gui/qt4/main_interface.hpp | 1 + 2 files changed, 11 insertions(+) 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 ); -- 2.39.2