Commit f13b848e authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen
Browse files

The length is now updated in the MediaCell

parent 2b0ede49
......@@ -131,7 +131,9 @@ void ImportController::clipSelection( const QUuid& uuid )
void ImportController::updateMediaRequested( Media* media )
{
m_mediaListController->getCell( media->getUuid() )->setThumbnail( media->getSnapshot() );
ImportMediaCellView* cell = m_mediaListController->getCell( media->getUuid() );
cell->setThumbnail( media->getSnapshot() );
cell->setLength( media->getLengthMS() );
}
void ImportController::setUIMetaData( Media* media )
{
......
......@@ -24,6 +24,8 @@
#include "ui_MediaCellView.h"
#include "Library.h"
#include "ClipProperty.h"
#include <QTime>
#include <QDebug>
MediaCellView::MediaCellView( const QUuid& uuid, QWidget *parent ) :
......@@ -134,3 +136,10 @@ void MediaCellView::deleteButtonClicked( QWidget*, QMouseEvent* )
{
emit cellDeleted( uuid() );
}
void MediaCellView::setLength( qint64 length )
{
QTime duration;
duration = duration.addMSecs( length );
m_ui->length->setText( duration.toString( "hh:mm:ss" ) );
}
......@@ -44,6 +44,11 @@ public:
void setTitle( const QString& title );
void setThumbnail( const QPixmap& pixmap );
const QPixmap* getThumbnail() const;
/**
* \brief Set the length displayed in the cell
* \param length The media length, in ms.
*/
void setLength( qint64 length );
QString title() const;
const QUuid& uuid() const;
const ClickableLabel* nextButton() const;
......
......@@ -23,6 +23,7 @@ void MediaListViewController::newMediaLoaded( Media* media )
cell->setThumbnail( media->getSnapshot() );
cell->setTitle( media->getFileName() );
cell->setLength( media->getLengthMS() );
addCell(cell);
m_cells->insert( media->getUuid(), cell );
}
......
......@@ -155,7 +155,7 @@
</font>
</property>
<property name="text">
<string>42</string>
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
......@@ -185,7 +185,7 @@
</font>
</property>
<property name="text">
<string>24m45</string>
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
......
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