Commit 7b64c064 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - PlaylistWidget use a much nicer QSplitter. Removes also too much class...

Qt4 - PlaylistWidget use a much nicer QSplitter. Removes also too much class inheritance and hierarchy.

parent bd4b7150
......@@ -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 )
......
......@@ -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:
......
......@@ -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:
......
......@@ -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 ):
......
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment