Qt4 - Right-Click menus for the main interface. Not implemented yet.
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 19 Aug 2007 16:20:13 +0000 (16:20 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 19 Aug 2007 16:20:13 +0000 (16:20 +0000)
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp

index ceeb093..3b5e392 100644 (file)
@@ -146,7 +146,12 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     statusBar()->addWidget( nameLabel, 8 );
     statusBar()->addPermanentWidget( speedLabel, 0 );
     statusBar()->addPermanentWidget( timeLabel, 2 );
-
+    speedLabel->setContextMenuPolicy ( Qt::CustomContextMenu );
+    timeLabel->setContextMenuPolicy ( Qt::CustomContextMenu );
+    CONNECT( speedLabel, customContextMenuRequested( QPoint ),
+             this, showSpeedMenu( QPoint ) );
+    CONNECT( timeLabel, customContextMenuRequested( QPoint ),
+             this, showTimeMenu( QPoint ) );
     /* Systray */
     sysTray = NULL;
     if( config_GetInt( p_intf, "qt-start-minimized") )
@@ -420,6 +425,22 @@ void MainInterface::resizeEvent( QResizeEvent *e )
         playlistWidget->updateGeometry();
     }
 }
+/****************************************************************************
+ * Small right-click menus
+ ****************************************************************************/
+void MainInterface::showSpeedMenu( QPoint pos )
+{
+    QMenu menu( this );
+    menu.addAction( "Not Implemented Yet" );
+    menu.exec( QCursor::pos() );
+}
+
+void MainInterface::showTimeMenu( QPoint pos )
+{
+    QMenu menu( this );
+    menu.addAction( "Not Implemented Yet" );
+    menu.exec( QCursor::pos() );
+}
 
 /*****************************************************************************
  * Systray Icon and Systray Menu
index 99a3f7a..77ab8e7 100644 (file)
@@ -139,6 +139,8 @@ private slots:
     void updateSystrayMenu( int );
     void updateSystrayTooltipName( QString );
     void updateSystrayTooltipStatus( int );
+    void showSpeedMenu( QPoint );
+    void showTimeMenu( QPoint );
 };