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

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

(cherry picked from commit 17d2bc2f7804d1a23eb5e55eaff996de76777fd4)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent c5ecf50f
...@@ -117,7 +117,9 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, ...@@ -117,7 +117,9 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i,
// components shall never write there setting to a fixed location, may infer // components shall never write there setting to a fixed location, may infer
// with other uses of the same component... // with other uses of the same component...
// getSettings()->beginGroup( "playlist" ); // getSettings()->beginGroup( "playlist" );
getSettings()->beginGroup("Playlist");
restoreState( getSettings()->value("splitterSizes").toByteArray()); restoreState( getSettings()->value("splitterSizes").toByteArray());
getSettings()->endGroup();
setAcceptDrops( true ); setAcceptDrops( true );
setWindowTitle( qtr( "Playlist" ) ); setWindowTitle( qtr( "Playlist" ) );
...@@ -126,8 +128,9 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, ...@@ -126,8 +128,9 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i,
PlaylistWidget::~PlaylistWidget() PlaylistWidget::~PlaylistWidget()
{ {
getSettings()->beginGroup("playlistdialog"); getSettings()->beginGroup("Playlist");
getSettings()->setValue( "splitterSizes", saveState() ); getSettings()->setValue( "splitterSizes", saveState() );
getSettings()->setValue( "GlobalPos", mapToGlobal( pos() ) );
getSettings()->endGroup(); getSettings()->endGroup();
} }
......
...@@ -75,11 +75,13 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent, ...@@ -75,11 +75,13 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
view->setDropIndicatorShown( true ); view->setDropIndicatorShown( true );
view->setAutoScroll( true ); view->setAutoScroll( true );
getSettings()->beginGroup("Playlist");
#if HAS_QT43 #if HAS_QT43
if( getSettings()->contains( "headerState" ) ) if( getSettings()->contains( "headerState" ) )
{ {
view->header()->restoreState( getSettings()->value( "headerState" ).toByteArray() ); view->header()->restoreState(
msg_Dbg( p_intf, "exists" ); getSettings()->value( "headerState" ).toByteArray() );
} }
else else
#endif #endif
...@@ -91,6 +93,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent, ...@@ -91,6 +93,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
view->header()->setClickable( true ); view->header()->setClickable( true );
view->header()->setContextMenuPolicy( Qt::CustomContextMenu ); view->header()->setContextMenuPolicy( Qt::CustomContextMenu );
} }
getSettings()->endGroup();
/* Connections for the TreeView */ /* Connections for the TreeView */
CONNECT( view, activated( const QModelIndex& ) , CONNECT( view, activated( const QModelIndex& ) ,
...@@ -353,7 +356,7 @@ void StandardPLPanel::deleteSelection() ...@@ -353,7 +356,7 @@ void StandardPLPanel::deleteSelection()
StandardPLPanel::~StandardPLPanel() StandardPLPanel::~StandardPLPanel()
{ {
#if HAS_QT43 #if HAS_QT43
getSettings()->beginGroup("playlistdialog"); getSettings()->beginGroup("Playlist");
getSettings()->setValue( "headerState", view->header()->saveState() ); getSettings()->setValue( "headerState", view->header()->saveState() );
getSettings()->endGroup(); getSettings()->endGroup();
#endif #endif
......
...@@ -733,10 +733,15 @@ void MainInterface::togglePlaylist() ...@@ -733,10 +733,15 @@ void MainInterface::togglePlaylist()
if( i_pl_dock == PL_UNDOCKED ) 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", QVLCTools::restoreWidgetPosition( p_intf, "Playlist",
playlistWidget, QSize( 600, 300 ) ); playlistWidget, QSize( 600, 300 ) );
/* Move it correctly then */
playlistWidget->move(
getSettings()->value( "Playlist/GlobalPos" ).toPoint() );
} }
else 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