void StandardPLPanel::showView( int i_view ) { switch( i_view ) { case TREE_VIEW: { if( treeView == NULL ) createTreeView(); currentView = treeView; break; } case ICON_VIEW: { if( iconView == NULL ) createIconView(); currentView = iconView; break; } case LIST_VIEW: { if( listView == NULL ) createListView(); currentView = listView; break; } default: return; } viewStack->setCurrentWidget( currentView ); viewActions[i_view]->setChecked( true ); browseInto(); gotoPlayingItem(); }
void StandardPLPanel::showView( int i_view ) { switch( i_view ) { case ICON_VIEW: { if( iconView == NULL ) createIconView(); currentView = iconView; break; } case LIST_VIEW: { if( listView == NULL ) createListView(); currentView = listView; break; } case PICTUREFLOW_VIEW: { if( picFlowView == NULL ) createCoverView(); currentView = picFlowView; break; } default: case TREE_VIEW: { if( treeView == NULL ) createTreeView(); currentView = treeView; break; } } changeModel( false ); viewStack->setCurrentWidget( currentView ); browseInto(); gotoPlayingItem(); }
void StandardPLPanel::showView( int i_view ) { bool b_treeViewCreated = false; switch( i_view ) { case ICON_VIEW: { if( iconView == NULL ) createIconView(); currentView = iconView; break; } case LIST_VIEW: { if( listView == NULL ) createListView(); currentView = listView; break; } case PICTUREFLOW_VIEW: { if( picFlowView == NULL ) createCoverView(); currentView = picFlowView; break; } default: case TREE_VIEW: { if( treeView == NULL ) { createTreeView(); b_treeViewCreated = true; } currentView = treeView; break; } } changeModel( false ); /* Restoring the header Columns must come after changeModel */ if( b_treeViewCreated ) { assert( treeView ); if( getSettings()->contains( "Playlist/headerStateV2" ) ) { treeView->header()->restoreState(getSettings() ->value( "Playlist/headerStateV2" ).toByteArray() ); /* if there is allready stuff in playlist, we don't sort it and we reset sorting */ if( model->rowCount() ) { treeView->header()->setSortIndicator( -1 , Qt::AscendingOrder ); } } else { for( int m = 1, c = 0; m != COLUMN_END; m <<= 1, c++ ) { treeView->setColumnHidden( c, !( m & COLUMN_DEFAULT ) ); if( m == COLUMN_TITLE ) treeView->header()->resizeSection( c, 200 ); else if( m == COLUMN_DURATION ) treeView->header()->resizeSection( c, 80 ); } } } viewStack->setCurrentWidget( currentView ); browseInto(); gotoPlayingItem(); }