Commit c8d328e8 authored by Jakob Leben's avatar Jakob Leben

Qt: save settings for playlist-selector/art splitter

...to enable permanent hiding of art display
parent 4d4dd098
...@@ -46,7 +46,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par ) ...@@ -46,7 +46,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
setContentsMargins( 3, 3, 3, 3 ); setContentsMargins( 3, 3, 3, 3 );
/* Left Part and design */ /* Left Part and design */
QSplitter *leftW = new QSplitter( Qt::Vertical, this ); leftSplitter = new QSplitter( Qt::Vertical, this );
/* Source Selector */ /* Source Selector */
selector = new PLSelector( this, p_intf ); selector = new PLSelector( this, p_intf );
...@@ -55,7 +55,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par ) ...@@ -55,7 +55,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
selBox->addWidget( selector ); selBox->addWidget( selector );
QGroupBox *selGroup = new QGroupBox( qtr( "Media Browser") ); QGroupBox *selGroup = new QGroupBox( qtr( "Media Browser") );
selGroup->setLayout( selBox ); selGroup->setLayout( selBox );
leftW->addWidget( selGroup ); leftSplitter->addWidget( selGroup );
/* Create a Container for the Art Label /* Create a Container for the Art Label
in order to have a beautiful resizing for the selector above it */ in order to have a beautiful resizing for the selector above it */
...@@ -74,7 +74,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par ) ...@@ -74,7 +74,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
artContLay->addWidget( art, 1 ); artContLay->addWidget( art, 1 );
leftW->addWidget( artContainer ); leftSplitter->addWidget( artContainer );
/* Initialisation of the playlist */ /* Initialisation of the playlist */
playlist_t * p_playlist = THEPL; playlist_t * p_playlist = THEPL;
...@@ -92,7 +92,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par ) ...@@ -92,7 +92,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
rightPanel->setRoot( p_root ); rightPanel->setRoot( p_root );
/* Add the two sides of the QSplitter */ /* Add the two sides of the QSplitter */
addWidget( leftW ); addWidget( leftSplitter );
addWidget( rightPanel ); addWidget( rightPanel );
QList<int> sizeList; QList<int> sizeList;
...@@ -101,7 +101,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par ) ...@@ -101,7 +101,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
//setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding ); //setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding );
setStretchFactor( 0, 0 ); setStretchFactor( 0, 0 );
setStretchFactor( 1, 3 ); setStretchFactor( 1, 3 );
leftW->setMaximumWidth( 250 ); leftSplitter->setMaximumWidth( 250 );
setCollapsible( 1, false ); setCollapsible( 1, false );
/* In case we want to keep the splitter informations */ /* In case we want to keep the splitter informations */
...@@ -110,6 +110,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par ) ...@@ -110,6 +110,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
// getSettings()->beginGroup( "playlist" ); // getSettings()->beginGroup( "playlist" );
getSettings()->beginGroup("Playlist"); getSettings()->beginGroup("Playlist");
restoreState( getSettings()->value("splitterSizes").toByteArray()); restoreState( getSettings()->value("splitterSizes").toByteArray());
leftSplitter->restoreState( getSettings()->value("leftSplitterGeometry").toByteArray() );
getSettings()->endGroup(); getSettings()->endGroup();
setAcceptDrops( true ); setAcceptDrops( true );
...@@ -122,6 +123,7 @@ PlaylistWidget::~PlaylistWidget() ...@@ -122,6 +123,7 @@ PlaylistWidget::~PlaylistWidget()
{ {
getSettings()->beginGroup("Playlist"); getSettings()->beginGroup("Playlist");
getSettings()->setValue( "splitterSizes", saveState() ); getSettings()->setValue( "splitterSizes", saveState() );
getSettings()->setValue( "leftSplitterGeometry", leftSplitter->saveState() );
getSettings()->endGroup(); getSettings()->endGroup();
msg_Dbg( p_intf, "Playlist Destroyed" ); msg_Dbg( p_intf, "Playlist Destroyed" );
} }
......
...@@ -66,6 +66,7 @@ private: ...@@ -66,6 +66,7 @@ private:
ArtLabel *art; ArtLabel *art;
StandardPLPanel *rightPanel; StandardPLPanel *rightPanel;
QPushButton *addButton; QPushButton *addButton;
QSplitter *leftSplitter;
protected: protected:
intf_thread_t *p_intf; intf_thread_t *p_intf;
virtual void dropEvent( QDropEvent *); virtual void dropEvent( QDropEvent *);
......
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