- currentRootId = -1;
- CONNECT( parent, rootChanged( int ), this, setCurrentRootId( int ) );
-
- /* Buttons configuration */
- QHBoxLayout *buttons = new QHBoxLayout;
-
- /* Add item to the playlist button */
- addButton = new QPushButton;
- addButton->setIcon( QIcon( ":/buttons/playlist/playlist_add" ) );
- addButton->setMaximumWidth( 30 );
- BUTTONACT( addButton, popupAdd() );
- buttons->addWidget( addButton );
-
- /* Random 2-state button */
- randomButton = new QPushButton( this );
- randomButton->setIcon( QIcon( ":/buttons/playlist/shuffle_on" ));
- randomButton->setToolTip( qtr( I_PL_RANDOM ));
- randomButton->setCheckable( true );
- randomButton->setChecked( model->hasRandom() );
- BUTTONACT( randomButton, toggleRandom() );
- buttons->addWidget( randomButton );
-
- /* Repeat 3-state button */
- repeatButton = new QPushButton( this );
- repeatButton->setToolTip( qtr( "Click to toggle between loop one, loop all" ) );
- repeatButton->setCheckable( true );
-
- if( model->hasRepeat() )
- {
- repeatButton->setIcon( QIcon( ":/buttons/playlist/repeat_one" ) );
- repeatButton->setChecked( true );
- }
- else if( model->hasLoop() )
- {
- repeatButton->setIcon( QIcon( ":/buttons/playlist/repeat_all" ) );
- repeatButton->setChecked( true );
- }
- else
- {
- repeatButton->setIcon( QIcon( ":/buttons/playlist/repeat_one" ) );
- repeatButton->setChecked( false );
- }
- BUTTONACT( repeatButton, toggleRepeat() );
- buttons->addWidget( repeatButton );
+StandardPLPanel::~StandardPLPanel()
+{
+ getSettings()->beginGroup("Playlist");
+ if( treeView )
+ getSettings()->setValue( "headerStateV2", treeView->header()->saveState() );
+ if( currentView == treeView )
+ getSettings()->setValue( "view-mode", TREE_VIEW );
+ else if( currentView == listView )
+ getSettings()->setValue( "view-mode", LIST_VIEW );
+ else if( currentView == iconView )
+ getSettings()->setValue( "view-mode", ICON_VIEW );
+ getSettings()->endGroup();
+}