Commit 17d2bc2f authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4: Playlist saving size and blablah... Close #2112

parent 74f808c3
......@@ -117,7 +117,9 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i,
// components shall never write there setting to a fixed location, may infer
// with other uses of the same component...
// getSettings()->beginGroup( "playlist" );
getSettings()->beginGroup("Playlist");
restoreState( getSettings()->value("splitterSizes").toByteArray());
getSettings()->endGroup();
setAcceptDrops( true );
setWindowTitle( qtr( "Playlist" ) );
......@@ -126,8 +128,9 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i,
PlaylistWidget::~PlaylistWidget()
{
getSettings()->beginGroup("playlistdialog");
getSettings()->beginGroup("Playlist");
getSettings()->setValue( "splitterSizes", saveState() );
getSettings()->setValue( "GlobalPos", mapToGlobal( pos() ) );
getSettings()->endGroup();
}
......
......@@ -75,11 +75,13 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
view->setDropIndicatorShown( true );
view->setAutoScroll( true );
getSettings()->beginGroup("Playlist");
#if HAS_QT43
if( getSettings()->contains( "headerState" ) )
{
view->header()->restoreState( getSettings()->value( "headerState" ).toByteArray() );
msg_Dbg( p_intf, "exists" );
view->header()->restoreState(
getSettings()->value( "headerState" ).toByteArray() );
}
else
#endif
......@@ -91,6 +93,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
view->header()->setClickable( true );
view->header()->setContextMenuPolicy( Qt::CustomContextMenu );
}
getSettings()->endGroup();
/* Connections for the TreeView */
CONNECT( view, activated( const QModelIndex& ) ,
......@@ -353,7 +356,7 @@ void StandardPLPanel::deleteSelection()
StandardPLPanel::~StandardPLPanel()
{
#if HAS_QT43
getSettings()->beginGroup("playlistdialog");
getSettings()->beginGroup("Playlist");
getSettings()->setValue( "headerState", view->header()->saveState() );
getSettings()->endGroup();
#endif
......
......@@ -742,10 +742,15 @@ void MainInterface::togglePlaylist()
if( i_pl_dock == PL_UNDOCKED )
{
playlistWidget->setWindowFlags( Qt::Window );
playlistWidget->setParent( this, Qt::Window );
/* This will restore the geometry but will not work for position,
because of parenting */
QVLCTools::restoreWidgetPosition( p_intf, "Playlist",
playlistWidget, QSize( 600, 300 ) );
/* Move it correctly then */
playlistWidget->move(
getSettings()->value( "Playlist/GlobalPos" ).toPoint() );
}
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