Commit de1d714f authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: Better restore of the playlist State

parent 5174f448
...@@ -325,7 +325,6 @@ void StandardPLPanel::createTreeView() ...@@ -325,7 +325,6 @@ void StandardPLPanel::createTreeView()
else if( m == COLUMN_DURATION ) treeView->header()->resizeSection( c, 80 ); else if( m == COLUMN_DURATION ) treeView->header()->resizeSection( c, 80 );
} }
} }
getSettings()->endGroup();
/* Connections for the TreeView */ /* Connections for the TreeView */
CONNECT( treeView, activated( const QModelIndex& ), CONNECT( treeView, activated( const QModelIndex& ),
......
...@@ -254,8 +254,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -254,8 +254,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
} }
/* Playlist */ /* Playlist */
int i_plVis = settings->value( "playlist-visible", 0 ).toInt(); int i_plVis = settings->value( "playlist-visible", false ).toBool();
settings->endGroup(); settings->endGroup();
if( i_plVis ) togglePlaylist(); if( i_plVis ) togglePlaylist();
...@@ -274,18 +273,9 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -274,18 +273,9 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
MainInterface::~MainInterface() MainInterface::~MainInterface()
{ {
/* Unsure we hide the videoWidget before destroying it */ /* Unsure we hide the videoWidget before destroying it */
if( stackCentralOldWidget == playlistWidget ) if( stackCentralOldWidget == videoWidget )
showBg(); showBg();
/* Save playlist state */
if( playlistWidget )
{
if( !isPlDocked() )
QVLCTools::saveWidgetPosition( p_intf, "Playlist", playlistWidget );
delete playlistWidget;
}
#ifdef WIN32 #ifdef WIN32
if( himl ) if( himl )
ImageList_Destroy( himl ); ImageList_Destroy( himl );
...@@ -306,7 +296,22 @@ MainInterface::~MainInterface() ...@@ -306,7 +296,22 @@ MainInterface::~MainInterface()
/* Save states */ /* Save states */
settings->beginGroup( "MainWindow" ); settings->beginGroup( "MainWindow" );
settings->setValue( "pl-dock-status", b_plDocked ); settings->setValue( "pl-dock-status", b_plDocked );
settings->setValue( "playlist-visible", (int)playlistVisible ); /* Save playlist state */
if( playlistWidget )
{
if( isPlDocked() )
{
QVLCTools::saveWidgetPosition( p_intf, "Playlist", playlistWidget );
settings->setValue( "playlist-visible", playlistVisible );
}
else
{
settings->setValue( "playlist-visible", playlistWidget->isVisible() ); // FIXME
}
delete playlistWidget;
}
settings->setValue( "adv-controls", settings->setValue( "adv-controls",
getControlsVisibilityStatus() & CONTROLS_ADVANCED ); getControlsVisibilityStatus() & CONTROLS_ADVANCED );
......
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