Commit 8fc1be22 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Remember playlist's size.

parent 46c88072
......@@ -38,8 +38,8 @@
* Playlist Widget. The embedded playlist
**********************************************************************/
PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QSettings *settings ) :
p_intf ( _p_i )
PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QSettings *settings, QWidget *_parent ) :
p_intf ( _p_i ), parent( _parent )
{
/* Left Part and design */
QSplitter *leftW = new QSplitter( Qt::Vertical, this );
......@@ -126,9 +126,9 @@ PlaylistWidget::~PlaylistWidget()
void PlaylistWidget::savingSettings( QSettings *settings )
{
settings->beginGroup( "playlist" );
settings->setValue( "pos", pos() );
settings->setValue( "size", size() );
settings->setValue("splitterSizes", saveState() );
settings->setValue( "pos", parent->pos() );
settings->setValue( "size", parent->size() );
settings->setValue( "splitterSizes", saveState() );
settings->endGroup();
}
......@@ -41,7 +41,7 @@ class PlaylistWidget : public QSplitter
{
Q_OBJECT;
public:
PlaylistWidget( intf_thread_t *_p_i, QSettings *settings ) ;
PlaylistWidget( intf_thread_t *_p_i, QSettings *settings, QWidget *parent ) ;
virtual ~PlaylistWidget();
QSize sizeHint() const;
void savingSettings( QSettings *settings );
......@@ -51,6 +51,7 @@ private:
QPushButton *addButton;
QLabel *art;
QString prevArt;
QWidget *parent;
protected:
intf_thread_t *p_intf;
private slots:
......
......@@ -47,16 +47,14 @@ PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf )
QHBoxLayout *l = new QHBoxLayout( centralWidget() );
QSettings *settings = new QSettings( "vlc", "vlc-qt-interface" );
PlaylistWidget *plw = new PlaylistWidget( p_intf, settings );
PlaylistWidget *plw = new PlaylistWidget( p_intf, settings, this );
l->addWidget( plw );
readSettings( "playlist", QSize( 600,700 ) );
}
PlaylistDialog::~PlaylistDialog()
{
writeSettings( "playlist" );
}
{}
void PlaylistDialog::dropEvent( QDropEvent *event )
{
......
......@@ -397,9 +397,6 @@ void MainInterface::handleMainUi( QSettings *settings )
if( videoEmbeddedFlag )
{
videoWidget = new VideoWidget( p_intf );
//videoWidget->widgetSize = QSize( 16, 16 );
//videoWidget->hide();
//videoWidget->resize( videoWidget->widgetSize );
mainLayout->insertWidget( 0, videoWidget );
p_intf->pf_request_window = ::DoRequest;
......@@ -702,7 +699,7 @@ void MainInterface::togglePlaylist()
If no playlist exist, then create one and attach it to the DockPL*/
if( !playlistWidget )
{
playlistWidget = new PlaylistWidget( p_intf, settings );
playlistWidget = new PlaylistWidget( p_intf, settings, dockPL );
/* Add it to the parent DockWidget */
dockPL->setWidget( playlistWidget );
......@@ -718,6 +715,10 @@ void MainInterface::togglePlaylist()
dockPL->setFloating( true );
}
settings->endGroup();
settings->beginGroup( "playlist" );
dockPL->move( settings->value( "pos", QPoint( 0,0 ) ).toPoint() );
dockPL->resize( settings->value( "size", QSize( 400, 300 ) ).toSize() );
settings->endGroup();
dockPL->show();
}
else
......
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