MediaLibraryWidget.cpp 1.9 KB
Newer Older
Thomas Boquet's avatar
Thomas Boquet committed
1 2 3
/*****************************************************************************
 * MediaLibraryWidget.cpp
 *****************************************************************************
Ludovic Fauvet's avatar
Ludovic Fauvet committed
4
 * Copyright (C) 2008-2010 VideoLAN
Thomas Boquet's avatar
Thomas Boquet committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 *
 * Authors: Thomas Boquet <thomas.boquet@gmail.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

Thomas Boquet's avatar
Thomas Boquet committed
23
#include "MediaLibraryWidget.h"
Ludovic Fauvet's avatar
Ludovic Fauvet committed
24 25 26 27 28
#include "StackViewController.h"
#include "MediaListViewController.h"

#include "Media.h"
#include "Clip.h"
Thomas Boquet's avatar
Thomas Boquet committed
29 30 31

MediaLibraryWidget::MediaLibraryWidget( QWidget* parent ) : QWidget( parent )
{
32
    Library*  library = Library::getInstance();
33 34 35

    m_nav = new StackViewController( this );
    MediaListViewController* list = new MediaListViewController( m_nav, library );
36
    //Media
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
37 38 39 40
    connect( list, SIGNAL( clipSelected( Clip* ) ),
             this, SIGNAL( clipSelected( Clip* ) ) );
    connect( m_nav, SIGNAL( importRequired() ),
             this, SIGNAL( importRequired() ) );
41
    m_nav->pushViewController( list );
42
    setMinimumWidth( 280 );
Thomas Boquet's avatar
Thomas Boquet committed
43 44 45 46
}

MediaLibraryWidget::~MediaLibraryWidget()
{
47
    delete m_nav;
Thomas Boquet's avatar
Thomas Boquet committed
48
}
49 50 51 52 53

const ViewController*       MediaLibraryWidget::getCurrentViewController()
{
    return m_nav->getCurrentViewController();
}