~siretart/vlc/ubuntu

« back to all changes in this revision

Viewing changes to modules/gui/qt4/components/playlist/standardpanel.cpp

  • Committer: Reinhard Tartler
  • Date: 2008-09-26 06:45:40 UTC
  • mto: (21.2.1 vlc-0.9.3)
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: siretart@tauware.de-20080926064540-0sd8zwmig33ksmy4
Tags: upstream-ubuntu-0.9.3
Import upstream version 0.9.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * standardpanel.cpp : The "standard" playlist panel : just a treeview
3
3
 ****************************************************************************
4
4
 * Copyright (C) 2000-2005 the VideoLAN team
5
 
 * $Id$
 
5
 * $Id: e3ed5a61827aed9a8c252f4f0235a014b784230f $
6
6
 *
7
7
 * Authors: Clément Stenac <zorglub@videolan.org>
8
8
 *
75
75
    view->setDropIndicatorShown( true );
76
76
    view->setAutoScroll( true );
77
77
 
 
78
 
 
79
    getSettings()->beginGroup("Playlist");
78
80
#if HAS_QT43
79
81
    if( getSettings()->contains( "headerState" ) )
80
82
    {
81
 
        view->header()->restoreState( getSettings()->value( "headerState" ).toByteArray() );
82
 
        msg_Dbg( p_intf, "exists" );
 
83
        view->header()->restoreState(
 
84
                getSettings()->value( "headerState" ).toByteArray() );
83
85
    }
84
86
    else
85
87
#endif
91
93
        view->header()->setClickable( true );
92
94
        view->header()->setContextMenuPolicy( Qt::CustomContextMenu );
93
95
    }
 
96
    getSettings()->endGroup();
94
97
 
95
98
    /* Connections for the TreeView */
96
99
    CONNECT( view, activated( const QModelIndex& ) ,
274
277
 
275
278
    QMenu selectColMenu;
276
279
 
277
 
#define ADD_META_ACTION( meta ) {                                              \
278
 
    QAction* option = selectColMenu.addAction( qfu( psz_column_title( meta ) ) );     \
279
 
    option->setCheckable( true );                                              \
280
 
    option->setChecked( model->shownFlags() & meta );                          \
281
 
    ContextUpdateMapper->setMapping( option, meta );                           \
282
 
    CONNECT( option, triggered(), ContextUpdateMapper, map() );                \
283
 
}
284
 
 
285
280
    CONNECT( ContextUpdateMapper, mapped( int ),  model, viewchanged( int ) );
286
281
 
287
 
    ADD_META_ACTION( COLUMN_NUMBER );
288
 
    ADD_META_ACTION( COLUMN_TITLE );
289
 
    ADD_META_ACTION( COLUMN_DURATION );
290
 
    ADD_META_ACTION( COLUMN_ARTIST );
291
 
    ADD_META_ACTION( COLUMN_GENRE );
292
 
    ADD_META_ACTION( COLUMN_ALBUM );
293
 
    ADD_META_ACTION( COLUMN_TRACK_NUMBER );
294
 
    ADD_META_ACTION( COLUMN_DESCRIPTION );
295
 
 
296
 
#undef ADD_META_ACTION
 
282
    int i_column = 1;
 
283
    for( i_column = 1; i_column != COLUMN_END; i_column<<=1 )
 
284
    {
 
285
        QAction* option = selectColMenu.addAction(
 
286
            qfu( psz_column_title( i_column ) ) );
 
287
        option->setCheckable( true );
 
288
        option->setChecked( model->shownFlags() & i_column );
 
289
        ContextUpdateMapper->setMapping( option, i_column );
 
290
        CONNECT( option, triggered(), ContextUpdateMapper, map() );
 
291
    }
297
292
 
298
293
    selectColMenu.exec( QCursor::pos() );
299
294
}
361
356
StandardPLPanel::~StandardPLPanel()
362
357
{
363
358
#if HAS_QT43
364
 
    getSettings()->beginGroup("playlistdialog");
 
359
    getSettings()->beginGroup("Playlist");
365
360
    getSettings()->setValue( "headerState", view->header()->saveState() );
366
361
    getSettings()->endGroup();
367
362
#endif