Qt: add the playlist view selection to the main menu
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 27 Aug 2012 12:35:29 +0000 (14:35 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 27 Aug 2012 12:35:29 +0000 (14:35 +0200)
modules/gui/qt4/components/playlist/playlist.hpp
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/menus.cpp

index ea1c1ba..ff5c267 100644 (file)
@@ -57,10 +57,12 @@ public:
     void forceHide();
     void forceShow();
     QStackedWidget *artContainer;
+    StandardPLPanel      *mainView;
+
 private:
     QSplitter            *leftSplitter;
     QSplitter            *split;
-    StandardPLPanel      *mainView;
+
     PLSelector           *selector;
 
     LocationBar          *locationBar;
index 98bdb40..05f5888 100644 (file)
@@ -933,7 +933,13 @@ int MainInterface::getControlsVisibilityStatus()
 {
     if( !controls ) return 0;
     return( (controls->isVisible() ? CONTROLS_VISIBLE : CONTROLS_HIDDEN )
-                + CONTROLS_ADVANCED * controls->b_advancedVisible );
+            + CONTROLS_ADVANCED * controls->b_advancedVisible );
+}
+
+StandardPLPanel *MainInterface::getPlaylistView()
+{
+    if( !playlistWidget ) return NULL;
+    else return playlistWidget->mainView;
 }
 
 void MainInterface::setStatusBarVisibility( bool b_visible )
index 78745ce..ae0a624 100644 (file)
@@ -54,6 +54,7 @@ class SpeedControlWidget;
 class QVBoxLayout;
 class QMenu;
 class QSize;
+class StandardPLPanel;
 
 enum {
     CONTROLS_VISIBLE  = 0x1,
@@ -87,6 +88,7 @@ public:
     int getControlsVisibilityStatus();
     bool isPlDocked() { return ( b_plDocked != false ); }
     bool isInterfaceFullScreen() { return b_interfaceFullScreen; }
+    StandardPLPanel* getPlaylistView();
 
 protected:
     void dropEventPlay( QDropEvent* event, bool b_play ) { dropEventPlay(event, b_play, true); }
index af45129..f8bd1e5 100644 (file)
@@ -49,6 +49,7 @@
 #include "extensions_manager.hpp"                 /* Extensions menu */
 #include "util/qmenuview.hpp"                     /* Simple Playlist menu */
 #include "components/playlist/playlist_model.hpp" /* PLModel getter */
+#include "components/playlist/standardpanel.hpp"  /* PLView getter */
 
 #include <QMenu>
 #include <QMenuBar>
@@ -474,6 +475,8 @@ QMenu *VLCMenuBar::ViewMenu( intf_thread_t *p_intf, QMenu *current, MainInterfac
             qtr( "Play&list" ), mi,
             SLOT( togglePlaylist() ), qtr( "Ctrl+L" ) );
 
+    if( mi->getPlaylistView() )
+        menu->addMenu( StandardPLPanel::viewSelectionMenu( mi->getPlaylistView() ) );
     menu->addSeparator();
 
     /* Minimal View */