Commit bfd69f94 authored by Christophe Courtaut's avatar Christophe Courtaut

Enable and update cell when metadata parsed

parent 19fa3631
......@@ -52,6 +52,8 @@ ImportMediaListController::addMedia( Media* media )
addCell( cell );
m_mediaCellList->insert( media->getUuid(), cell );
if ( media->baseClip() == NULL )
connect( media, SIGNAL( metaDataComputed( Media* ) ), cell, SLOT( enableCell() ) );
}
void
......
......@@ -40,6 +40,7 @@ MediaCellView::MediaCellView( const QUuid& uuid, QWidget *parent ) :
connect( m_ui->arrow,
SIGNAL( clicked( QWidget*, QMouseEvent* ) ),
SLOT( arrowButtonClicked( QWidget*, QMouseEvent* ) ) );
setEnabled( false );
}
MediaCellView::~MediaCellView()
......@@ -200,3 +201,9 @@ MediaCellView::containsClip()
SIGNAL( clicked( QWidget*, QMouseEvent* ) ), this,
SLOT( arrowButtonClicked( QWidget*, QMouseEvent* ) ) );
}
void
MediaCellView::enableCell()
{
this->setEnabled( true );
}
......@@ -79,6 +79,7 @@ signals:
public slots:
void deleteButtonClicked( QWidget* sender, QMouseEvent* event );
void arrowButtonClicked( QWidget* sender, QMouseEvent* event );
void enableCell();
};
......
......@@ -52,13 +52,14 @@ void MediaListViewController::newMediaLoaded( const QUuid& uuid )
this, SLOT( mediaDeletion( QUuid ) ) );
connect( cell, SIGNAL( arrowClicked( const QUuid& ) ),
this, SLOT( showClipList( const QUuid& ) ) );
connect( media, SIGNAL( snapshotComputed( Media* ) ),
this, SLOT( updateCell( Media* ) ) );
cell->setNbClips( media->clips()->size() );
cell->setThumbnail( media->getSnapshot() );
cell->setTitle( media->getFileName() );
cell->setLength( media->getLengthMS() );
if ( media->baseClip() != NULL )
cell->setEnabled(true);
addCell(cell);
m_cells->insert( media->getUuid(), cell );
}
......@@ -100,7 +101,12 @@ void MediaListViewController::updateCell( Media* media )
{
MediaCellView* cell = qobject_cast<MediaCellView*>( m_cells->value( media->getUuid(), NULL ) );
if ( cell != NULL )
{
cell->setNbClips( media->clips()->size() );
cell->setLength( media->getLengthMS() );
cell->setThumbnail( media->getSnapshot() );
cell->setEnabled(true);
}
}
void MediaListViewController::showClipList( const QUuid& uuid )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment