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
return false;
// 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
void setMetaTags( const QStringList& tags );
bool matchMetaTag( const QString& tag ) const;
const QString& getNotes() const;
void setNotes( const QString& notes );
private:
void computeLength();
......@@ -104,6 +107,7 @@ class Clip : public QObject
qint64 m_lengthSeconds;
QUuid m_uuid;
QStringList m_metaTags;
QString m_notes;
};
......
......@@ -40,14 +40,20 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) :
ui->setupUi(this);
connect( this, SIGNAL( accepted() ), this, SLOT( deleteLater() ) );
connect( this, SIGNAL( rejected() ), this, SLOT( deleteLater() ) );
//Duration
ui->durationValueLabel->setText( duration.toString( "hh:mm:ss" ) );
//Filename || title
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() )
+ " x " + QString::number( m_clip->getParent()->getHeight() ) );
//FPS
ui->fpsValueLabel->setText( QString::number( m_clip->getParent()->getFps() ) );
//Snapshot
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 );
Q_ASSERT( button != NULL);
connect( button, SIGNAL( clicked() ), this, SLOT( apply() ) );
......@@ -55,6 +61,9 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) :
QStringListModel* model = new QStringListModel( m_clip->getMetaTags(), this );
ui->metaTagsView->setModel( model );
//Notes:
ui->annotationInput->setPlainText( m_clip->getNotes() );
connect( ui->addTagsButton, SIGNAL( clicked() ), this, SLOT( addTagsRequired() ) );
connect( ui->deleteTagsButton, SIGNAL( clicked() ), this, SLOT( removeTagsRequired() ) );
}
......@@ -79,6 +88,8 @@ void ClipProperty::changeEvent( QEvent *e )
void ClipProperty::apply()
{
m_clip->setNotes( ui->annotationInput->toPlainText() );
QStringListModel* model = dynamic_cast<QStringListModel*>( ui->metaTagsView->model() );
if ( model == NULL )
return ;
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>450</width>
<height>300</height>
<height>313</height>
</rect>
</property>
<property name="windowTitle">
......@@ -166,7 +166,7 @@
</property>
</widget>
</item>
<item row="2" column="0" colspan="7">
<item row="2" column="0" colspan="6">
<widget class="QListView" name="metaTagsView">
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
......@@ -230,6 +230,16 @@
</property>
</widget>
</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>
</widget>
<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