Commit e6586f41 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Adding "notes" to clips

parent db4e8a91
...@@ -117,3 +117,13 @@ bool Clip::matchMetaTag( const QString& tag ) const ...@@ -117,3 +117,13 @@ bool Clip::matchMetaTag( const QString& tag ) const
return false; return false;
// m_metaTags.contains( tag, Qt::CaseInsensitive ); // m_metaTags.contains( tag, Qt::CaseInsensitive );
} }
const QString& Clip::getNotes() const
{
return m_notes;
}
void Clip::setNotes( const QString& notes )
{
m_notes = notes;
}
...@@ -92,6 +92,9 @@ class Clip : public QObject ...@@ -92,6 +92,9 @@ class Clip : public QObject
void setMetaTags( const QStringList& tags ); void setMetaTags( const QStringList& tags );
bool matchMetaTag( const QString& tag ) const; bool matchMetaTag( const QString& tag ) const;
const QString& getNotes() const;
void setNotes( const QString& notes );
private: private:
void computeLength(); void computeLength();
...@@ -104,6 +107,7 @@ class Clip : public QObject ...@@ -104,6 +107,7 @@ class Clip : public QObject
qint64 m_lengthSeconds; qint64 m_lengthSeconds;
QUuid m_uuid; QUuid m_uuid;
QStringList m_metaTags; QStringList m_metaTags;
QString m_notes;
}; };
......
...@@ -40,14 +40,20 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) : ...@@ -40,14 +40,20 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) :
ui->setupUi(this); ui->setupUi(this);
connect( this, SIGNAL( accepted() ), this, SLOT( deleteLater() ) ); connect( this, SIGNAL( accepted() ), this, SLOT( deleteLater() ) );
connect( this, SIGNAL( rejected() ), this, SLOT( deleteLater() ) ); connect( this, SIGNAL( rejected() ), this, SLOT( deleteLater() ) );
//Duration
ui->durationValueLabel->setText( duration.toString( "hh:mm:ss" ) ); ui->durationValueLabel->setText( duration.toString( "hh:mm:ss" ) );
//Filename || title
ui->nameValueLabel->setText( m_clip->getParent()->getFileInfo()->fileName() ); ui->nameValueLabel->setText( m_clip->getParent()->getFileInfo()->fileName() );
setWindowTitle( m_clip->getParent()->getFileInfo()->fileName() + " " + tr( "properties" ) );
//Resolution
ui->resolutionValueLabel->setText( QString::number( m_clip->getParent()->getWidth() ) ui->resolutionValueLabel->setText( QString::number( m_clip->getParent()->getWidth() )
+ " x " + QString::number( m_clip->getParent()->getHeight() ) ); + " x " + QString::number( m_clip->getParent()->getHeight() ) );
//FPS
ui->fpsValueLabel->setText( QString::number( m_clip->getParent()->getFps() ) ); ui->fpsValueLabel->setText( QString::number( m_clip->getParent()->getFps() ) );
//Snapshot
ui->snapshotLabel->setPixmap( m_clip->getParent()->getSnapshot().scaled( 128, 128, Qt::KeepAspectRatio ) ); ui->snapshotLabel->setPixmap( m_clip->getParent()->getSnapshot().scaled( 128, 128, Qt::KeepAspectRatio ) );
setWindowTitle( m_clip->getParent()->getFileInfo()->fileName() + " " + tr( "properties" ) );
//Metatags
const QPushButton* button = ui->buttonBox->button( QDialogButtonBox::Apply ); const QPushButton* button = ui->buttonBox->button( QDialogButtonBox::Apply );
Q_ASSERT( button != NULL); Q_ASSERT( button != NULL);
connect( button, SIGNAL( clicked() ), this, SLOT( apply() ) ); connect( button, SIGNAL( clicked() ), this, SLOT( apply() ) );
...@@ -55,6 +61,9 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) : ...@@ -55,6 +61,9 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) :
QStringListModel* model = new QStringListModel( m_clip->getMetaTags(), this ); QStringListModel* model = new QStringListModel( m_clip->getMetaTags(), this );
ui->metaTagsView->setModel( model ); ui->metaTagsView->setModel( model );
//Notes:
ui->annotationInput->setPlainText( m_clip->getNotes() );
connect( ui->addTagsButton, SIGNAL( clicked() ), this, SLOT( addTagsRequired() ) ); connect( ui->addTagsButton, SIGNAL( clicked() ), this, SLOT( addTagsRequired() ) );
connect( ui->deleteTagsButton, SIGNAL( clicked() ), this, SLOT( removeTagsRequired() ) ); connect( ui->deleteTagsButton, SIGNAL( clicked() ), this, SLOT( removeTagsRequired() ) );
} }
...@@ -79,6 +88,8 @@ void ClipProperty::changeEvent( QEvent *e ) ...@@ -79,6 +88,8 @@ void ClipProperty::changeEvent( QEvent *e )
void ClipProperty::apply() void ClipProperty::apply()
{ {
m_clip->setNotes( ui->annotationInput->toPlainText() );
QStringListModel* model = dynamic_cast<QStringListModel*>( ui->metaTagsView->model() ); QStringListModel* model = dynamic_cast<QStringListModel*>( ui->metaTagsView->model() );
if ( model == NULL ) if ( model == NULL )
return ; return ;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>450</width> <width>450</width>
<height>300</height> <height>313</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="7"> <item row="2" column="0" colspan="6">
<widget class="QListView" name="metaTagsView"> <widget class="QListView" name="metaTagsView">
<property name="selectionMode"> <property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum> <enum>QAbstractItemView::MultiSelection</enum>
...@@ -230,6 +230,16 @@ ...@@ -230,6 +230,16 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="6">
<widget class="QPlainTextEdit" name="annotationInput"/>
</item>
<item row="1" column="6">
<widget class="QLabel" name="annotationLabel">
<property name="text">
<string>Annotations :</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<resources> <resources>
......
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