]> git.sesse.net Git - vlc/commitdiff
Qt4 - PlaylistWidget use a much nicer QSplitter. Removes also too much class inherita...
authorJean-Baptiste Kempf <jb@videolan.org>
Wed, 1 Aug 2007 18:08:23 +0000 (18:08 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 1 Aug 2007 18:08:23 +0000 (18:08 +0000)
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/components/playlist/panels.hpp
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/qt4.hpp

index 58e14ea278f261576d1184d53e3be0b3b1493690..fed0f35912c9d59204246f5010b039e3688b6c0e 100644 (file)
@@ -278,30 +278,35 @@ void ControlsWidget::fullscreen()
 #include "components/playlist/selector.hpp"
 
 PlaylistWidget::PlaylistWidget( intf_thread_t *_p_intf ) :
-                                BasePlaylistWidget ( _p_intf)
+                                p_intf ( _p_intf)
 {
-    QVBoxLayout *left = new QVBoxLayout( );
+    /* Left Part and design */
+    QWidget *leftW = new QWidget( this );
+    QVBoxLayout *left = new QVBoxLayout( leftW );
 
+    /* Source Selector */
     selector = new PLSelector( this, p_intf, THEPL );
     selector->setMaximumWidth( 130 );
     left->addWidget( selector );
 
+    /* Art label */
     art = new QLabel( "" );
     art->setMinimumHeight( 128 );
     art->setMinimumWidth( 128 );
     art->setMaximumHeight( 128 );
     art->setMaximumWidth( 128 );
     art->setScaledContents( true );
-
     art->setPixmap( QPixmap( ":/noart.png" ) );
     left->addWidget( art );
 
+    /* Initialisation of the playlist */
     playlist_item_t *p_root = playlist_GetPreferredNode( THEPL,
                                                 THEPL->p_local_category );
 
     rightPanel = qobject_cast<PLPanel *>(new StandardPLPanel( this,
                               p_intf, THEPL, p_root ) );
 
+    /* Connects */
     CONNECT( selector, activated( int ), rightPanel, setRoot( int ) );
 
     CONNECT( qobject_cast<StandardPLPanel *>(rightPanel)->model,
@@ -315,10 +320,11 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_intf ) :
              this, SIGNAL( rootChanged( int ) ) );
     emit rootChanged( p_root->i_id );
 
-    QHBoxLayout *layout = new QHBoxLayout(this);
-    layout->addLayout( left, 0 );
-    layout->addWidget( rightPanel, 10 );
-    setLayout( layout );
+    /* Add the two sides of the QSplitter */
+    addWidget( leftW );
+    addWidget( rightPanel );
+
+    /* FIXME Sizing to do */
 }
 
 void PlaylistWidget::setArt( QString url )
index 16a1dd4866051347ef3c6ad8b21481bff8bfaa15..9896eb8e8aed7f4f304c3b54c7862f51ca8c4fd2 100644 (file)
@@ -119,16 +119,17 @@ private slots:
 
 /******************** Playlist Widgets ****************/
 #include <QModelIndex>
+#include <QSplitter>
 class QSignalMapper;
 class PLSelector;
 class PLPanel;
 class QPushButton;
 
-class PlaylistWidget : public BasePlaylistWidget
+class PlaylistWidget : public QSplitter
 {
     Q_OBJECT;
 public:
-    PlaylistWidget( intf_thread_t * );
+    PlaylistWidget( intf_thread_t *_p_i ) ;
     virtual ~PlaylistWidget();
     QSize widgetSize;
     virtual QSize sizeHint() const;
@@ -138,6 +139,8 @@ private:
     QPushButton *addButton;
     QLabel *art;
     QString prevArt;
+protected:
+     intf_thread_t *p_intf;
 private slots:
     void setArt( QString );
 signals:
index 6f21ffcb6e16dc5d27eb72b4e1b99ef2cb1ff04f..a3410bcfa0bb91772e6a958c8cadf83a533c1de3 100644 (file)
@@ -27,6 +27,7 @@
 #include <vlc/vlc.h>
 
 #include "qt4.hpp"
+#include "../interface_widgets.hpp"
 
 #include <QModelIndex>
 #include <QWidget>
@@ -42,7 +43,7 @@ class PLPanel: public QWidget
 {
     Q_OBJECT;
 public:
-    PLPanel( BasePlaylistWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
+    PLPanel( PlaylistWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
     {
         p_intf = _p_intf;
         parent = p;
@@ -50,7 +51,7 @@ public:
     virtual ~PLPanel() {};
 protected:
     intf_thread_t *p_intf;
-    BasePlaylistWidget *parent;
+    QFrame *parent;
 public slots:
     virtual void setRoot( int ) = 0;
 };
@@ -61,7 +62,7 @@ class StandardPLPanel: public PLPanel
 {
     Q_OBJECT;
 public:
-    StandardPLPanel( BasePlaylistWidget *, intf_thread_t *,
+    StandardPLPanel( PlaylistWidget *, intf_thread_t *,
                      playlist_t *,playlist_item_t * );
     virtual ~StandardPLPanel();
 protected:
index 315b7cd83ed9c2fa292ead03fe89c18b08b834e8..594f4c09597262a48b26b0f6ef82bd34586c362a 100644 (file)
@@ -43,7 +43,7 @@
 
 #include <assert.h>
 
-StandardPLPanel::StandardPLPanel( BasePlaylistWidget *_parent,
+StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
                                   intf_thread_t *_p_intf,
                                   playlist_t *p_playlist,
                                   playlist_item_t *p_root ):
index a3947ee520697b412802ffe745b534cc0c2b95c1..3be7d17d0eddb91be623a27aa956a1551cb1d833 100644 (file)
@@ -108,6 +108,7 @@ public:
 };
 
 /* Ugly to put it here, but don't want more files ... */
+#if 0
 #include <QFrame>
 class BasePlaylistWidget : public QFrame
 {
@@ -117,5 +118,5 @@ public:
 protected:
     intf_thread_t *p_intf;
 };
-
+#endif
 #endif