]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/menus.cpp
Various strings change and capitalisation changes to match the guidelines.
[vlc] / modules / gui / qt4 / menus.cpp
index 2e6e3194a8b49f49cf6b4b81cf8784da62898785..5962c192d2c540098a64a7b7da9dcb7b78501a8d 100644 (file)
 #include <QSignalMapper>
 #include <QSystemTrayIcon>
 
+/*
+  This file defines the main menus and the pop-up menu (right-click menu)
+  and the systray menu (in that order in the file)
+
+  There are 3 menus that have to be rebuilt everytime there are called:
+  Audio, Video, Navigation
+  3 functions are building those menus: AudioMenu, VideoMenu, NavigMenu
+  and 3 functions associated are collecting the objects :
+  InputAutoMenuBuilder, AudioAutoMenuBuilder, VideoAutoMenuBuilder.
+
+  A QSignalMapper decides when to rebuild those menus cf MenuFunc in the .hpp
+  Just before one of those menus are aboutToShow(), they are rebuild.
+
+
+  */
+
 enum
 {
     ITEM_NORMAL,
@@ -312,7 +328,7 @@ QMenu *QVLCMenu::PlaylistMenu( intf_thread_t *p_intf, MainInterface *mi )
     addDPStaticEntry( menu, qtr( I_PL_SAVE ), "", "", SLOT( saveAPlaylist() ),
         "Ctrl+Y" );
     menu->addSeparator();
-    menu->addAction( qtr( "Undock from interface" ), mi,
+    menu->addAction( qtr( "Undock from Interface" ), mi,
                      SLOT( undockPlaylist() ), qtr( "Ctrl+U" ) );
     return menu;
 }
@@ -355,19 +371,19 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf,
     if( mi )
     {
         /* Minimal View */
-        QAction *action=menu->addAction( qtr( "Minimal View..." ), mi,
-                SLOT( toggleMinimalView() ), qtr( "Ctrl+H" ) );
+        QAction *action = menu->addAction( qtr( "Minimal View..." ), mi,
+                                SLOT( toggleMinimalView() ), qtr( "Ctrl+H" ) );
         action->setCheckable( true );
         if( mi->getControlsVisibilityStatus() & CONTROLS_VISIBLE )
             action->setChecked( true );
 
         /* FullScreen View */
         action = menu->addAction( qtr( "Toggle Fullscreen Interface" ), mi,
-                SLOT( toggleFullScreen() ), qtr( "F11" ) );
+                                  SLOT( toggleFullScreen() ), QString( "F11" ) );
 
         /* Advanced Controls */
-        action = menu->addAction( qtr( "Advanced controls" ), mi,
-                SLOT( toggleAdvanced() ) );
+        action = menu->addAction( qtr( "Advanced Controls" ), mi,
+                                  SLOT( toggleAdvanced() ) );
         action->setCheckable( true );
         if( mi->getControlsVisibilityStatus() & CONTROLS_ADVANCED )
             action->setChecked( true );
@@ -596,7 +612,7 @@ QMenu *QVLCMenu::HelpMenu( QMenu *current )
     addDPStaticEntry( menu, qtr( "Help..." ) , "",
         ":/pixmaps/menus_help_16px.png", SLOT( helpDialog() ), "F1" );
 #ifdef UPDATE_CHECK
-    addDPStaticEntry( menu, qtr( "Check for updates..." ) , "", "",
+    addDPStaticEntry( menu, qtr( "Check for Updates..." ) , "", "",
                       SLOT( updateDialog() ), "");
 #endif
     menu->addSeparator();
@@ -649,7 +665,7 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu,
             ":/pixmaps/previous_16px.png", SLOT( prev() ) );
     addMIMStaticEntry( p_intf, menu, qtr( "Next" ), "",
             ":/pixmaps/next_16px.png", SLOT( next() ) );
-    }
+}
 
 void QVLCMenu::PopupMenuStaticEntries( intf_thread_t *p_intf, QMenu *menu )
 {
@@ -785,9 +801,9 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
                             qtr( "Leave Fullscreen" ),"" , ITEM_NORMAL,
                             p_vout->i_object_id, val, VLC_VAR_BOOL,
                             b_isFullscreen );
+                vlc_object_release( p_vout );
             }
 
-            vlc_object_release( p_vout );
             menu->addSeparator();
 
             vlc_object_yield( p_input );
@@ -820,9 +836,9 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
         {
             submenu = new QMenu( qtr( "Interface" ), menu );
             submenu->addAction( QIcon( ":/pixmaps/playlist_16px.png" ),
-                 qtr( "Show Playlist" ), mi, SLOT( togglePlaylist() ) );
+                     qtr( "Show Playlist" ), mi, SLOT( togglePlaylist() ) );
             addDPStaticEntry( submenu, qtr( I_MENU_EXT ), "",
-                 ":/pixmaps/menus_settings_16px.png", SLOT( extendedDialog() ) );
+                ":/pixmaps/menus_settings_16px.png", SLOT( extendedDialog() ) );
             action = submenu->addAction( QIcon( "" ),
                  qtr( "Minimal View..." ), mi, SLOT( toggleMinimalView() ) );
             action->setCheckable( true );
@@ -869,14 +885,14 @@ void QVLCMenu::updateSystrayMenu( MainInterface *mi,
     if( mi->isVisible() || b_force_visible )
     {
         sysMenu->addAction( QIcon( ":/vlc16.png" ),
-                qtr( "Hide VLC media player in taskbar" ), mi,
-                SLOT( toggleUpdateSystrayMenu() ) );
+                            qtr( "Hide VLC media player in taskbar" ), mi,
+                            SLOT( toggleUpdateSystrayMenu() ) );
     }
     else
     {
         sysMenu->addAction( QIcon( ":/vlc16.png" ),
-                qtr( "Show VLC media player" ), mi,
-                SLOT( toggleUpdateSystrayMenu() ) );
+                            qtr( "Show VLC media player" ), mi,
+                            SLOT( toggleUpdateSystrayMenu() ) );
     }
 
     sysMenu->addSeparator();
@@ -886,7 +902,7 @@ void QVLCMenu::updateSystrayMenu( MainInterface *mi,
     addDPStaticEntry( sysMenu, qtr( "&Open Media" ), "",
             ":/pixmaps/file-wide_16px.png", SLOT( openFileDialog() ), "" );
     addDPStaticEntry( sysMenu, qtr( "&Quit" ) , "",
-        ":/pixmaps/menus_quit_16px.png", SLOT( quit() ), "" );
+            ":/pixmaps/menus_quit_16px.png", SLOT( quit() ), "" );
 
     /* Set the menu */
     mi->getSysTray()->setContextMenu( sysMenu );