#include "components/playlist/standardpanel.hpp"
+#include "components/playlist/vlc_model.hpp" /* VLCModel */
#include "components/playlist/playlist_model.hpp" /* PLModel */
-#include "components/playlist/ml_model.hpp" /* MLModel */
+#include "components/playlist/ml_model.hpp" /* MLModel */
#include "components/playlist/views.hpp" /* 3 views */
#include "components/playlist/selector.hpp" /* PLSelector */
#include "menus.hpp" /* Popup */
treeView->setContextMenuPolicy( Qt::CustomContextMenu );
/* setModel after setSortingEnabled(true), or the model will sort immediately! */
- treeView->setModel( model );
getSettings()->beginGroup("Playlist");
viewStack->addWidget( treeView );
}
+void StandardPLPanel::changeModel( bool b_ml )
+{
+ VLCModel *mod;
+ if( b_ml )
+ mod = mlmodel;
+ else
+ mod = model;
+ if( currentView->model() != mod )
+ currentView->setModel( mod );
+}
+
void StandardPLPanel::showView( int i_view )
{
+
switch( i_view )
{
case TREE_VIEW:
default: return;
}
+ changeModel( false );
+
viewStack->setCurrentWidget( currentView );
browseInto();
gotoPlayingItem();
{
PlIconViewItemDelegate *delegate = new PlIconViewItemDelegate( this );
- setModel( model );
setViewMode( QListView::IconMode );
setMovement( QListView::Static );
setResizeMode( QListView::Adjust );
PlListView::PlListView( PLModel *model, QWidget *parent ) : QListView( parent )
{
- setModel( model );
setViewMode( QListView::ListMode );
setUniformItemSizes( true );
setSelectionMode( QAbstractItemView::ExtendedSelection );
picFlow->setSlideSize(QSize(128,128));
layout->addWidget( picFlow );
setSelectionMode( QAbstractItemView::SingleSelection );
- setModel( p_model );
-
}
int PicFlowView::horizontalOffset() const