Qt menus: add faster/slower/normal rate
authorJean-Baptiste Kempf <jb@sasmira.jbkempf.com>
Fri, 20 Feb 2009 09:22:46 +0000 (10:22 +0100)
committerJean-Baptiste Kempf <jb@sasmira.jbkempf.com>
Fri, 20 Feb 2009 13:20:14 +0000 (14:20 +0100)
modules/gui/qt4/menus.cpp

index 1db4644..a87725d 100644 (file)
@@ -721,9 +721,12 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu,
                                         intf_thread_t *p_intf,
                                         input_thread_t *p_input )
 {
+    QAction *action;
+
+    /* Play or Pause action and icon */
     if( !p_input || var_GetInteger( p_input, "state" ) != PLAYING_S )
     {
-        QAction *action = menu->addAction( qtr( "Play" ),
+        action = menu->addAction( qtr( "Play" ),
                 ActionsManager::getInstance( p_intf ), SLOT( play() ) );
         action->setIcon( QIcon( ":/play" ) );
     }
@@ -733,8 +736,24 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu,
                     ":/pause", SLOT( togglePlayPause() ) );
     }
 
+    /* Stop */
     addMIMStaticEntry( p_intf, menu, qtr( "Stop" ),
             ":/stop", SLOT( stop() ) );
+
+    /* Faster/Slower */
+    action = menu->addAction( qtr( "Faster" ), THEMIM->getIM(), SLOT( faster() ) );
+    action->setIcon( QIcon( ":/faster") );
+    menu->addAction( qtr( "Normal Speed" ), THEMIM->getIM(), SLOT( normalRate() ) );
+    action = menu->addAction( qtr( "Slower" ), THEMIM->getIM(), SLOT( slower() ) );
+    action->setIcon( QIcon( ":/slower") );
+}
+
+
+void QVLCMenu::PopupMenuPlaylistControlEntries( QMenu *menu,
+                                        intf_thread_t *p_intf,
+                                        input_thread_t *p_input )
+{
+    /* Next / Previous */
     addMIMStaticEntry( p_intf, menu, qtr( "Previous" ),
             ":/previous", SLOT( prev() ) );
     addMIMStaticEntry( p_intf, menu, qtr( "Next" ),
@@ -822,6 +841,9 @@ void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf )
     menu->addSeparator();
     PopupMenuControlEntries( menu, p_intf, p_input );
 
+    menu->addSeparator();
+    PopupMenuPlaylistControlEntries( menu, p_intf, p_input );
+
     menu->addSeparator();
     PopupMenuStaticEntries( menu );
 
@@ -850,6 +872,9 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
         PopupMenuControlEntries( menu, p_intf, p_input );
         menu->addSeparator();
 
+        PopupMenuPlaylistControlEntries( menu, p_intf, p_input );
+        menu->addSeparator();
+
         if( p_input )
         {
             vout_thread_t *p_vout = THEMIM->getVout();
@@ -989,6 +1014,7 @@ void QVLCMenu::updateSystrayMenu( MainInterface *mi,
 
     sysMenu->addSeparator();
     PopupMenuControlEntries( sysMenu, p_intf, p_input );
+    PopupMenuPlaylistControlEntries( sysMenu, p_intf, p_input );
 
     sysMenu->addSeparator();
     addDPStaticEntry( sysMenu, qtr( "&Open Media" ),