MediaLibraryWidget.cpp 2.13 KB
Newer Older
Thomas Boquet's avatar
Thomas Boquet committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/*****************************************************************************
 * MediaLibraryWidget.cpp
 *****************************************************************************
 * Copyright (C) 2008-2009 the VLMC team
 *
 * 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 24 25 26
#include "MediaLibraryWidget.h"

MediaLibraryWidget::MediaLibraryWidget( QWidget* parent ) : QWidget( parent )
{
27 28
    m_nav = new StackViewController( this );
    MediaListViewController* list = new MediaListViewController( m_nav );
29
    Library*  library = Library::getInstance();
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
30
    connect( list, SIGNAL( mediaSelected( Media* ) ), this, SLOT( mediaSelection( Media* ) ) );
31 32
    connect( list, SIGNAL( mediaDeleted( const QUuid& ) ), library, SLOT( removingMediaAsked( const QUuid& ) ) );
    connect( library, SIGNAL( mediaRemoved( QUuid ) ), list, SLOT( mediaRemoved( const QUuid& ) ) );
33
    connect( m_nav, SIGNAL( importRequired() ), this, SIGNAL( importRequired() ) );
34
    m_nav->pushViewController( list );
Thomas Boquet's avatar
Thomas Boquet committed
35 36 37 38
}

MediaLibraryWidget::~MediaLibraryWidget()
{
39
    delete m_nav;
Thomas Boquet's avatar
Thomas Boquet committed
40
}
41 42 43 44 45

const ViewController*       MediaLibraryWidget::getCurrentViewController()
{
    return m_nav->getCurrentViewController();
}
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
46 47 48 49 50 51 52 53 54 55

void    MediaLibraryWidget::mediaSelection( Media* media )
{
    emit mediaSelected( media );
}

void    MediaLibraryWidget::clipSelection( Clip* clip )
{
    emit clipSelected( clip );
}