Commit 5fb810b3 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

ClipMetadataDisplayer: Add an information icon about the workspace state.

parent 7212ddf2
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
<file alias="youtube">resources/images/youtube.png</file> <file alias="youtube">resources/images/youtube.png</file>
<file alias="network">resources/images/network.png</file> <file alias="network">resources/images/network.png</file>
<file alias="down">resources/images/down.png</file> <file alias="down">resources/images/down.png</file>
<file alias="ok">resources/images/ok.png</file>
<file alias="ko">resources/images/ko.png</file>
</qresource> </qresource>
<qresource prefix="/text"> <qresource prefix="/text">
<file>AUTHORS</file> <file>AUTHORS</file>
......
...@@ -56,6 +56,8 @@ ClipMetadataDisplayer::metadataUpdated( const Media *media ) ...@@ -56,6 +56,8 @@ ClipMetadataDisplayer::metadataUpdated( const Media *media )
m_ui->nbAudioTracksValueLabel->setText( QString::number( media->nbAudioTracks() ) ); m_ui->nbAudioTracksValueLabel->setText( QString::number( media->nbAudioTracks() ) );
//Path: //Path:
m_ui->pathValueLabel->setText( media->fileInfo()->absoluteFilePath() ); m_ui->pathValueLabel->setText( media->fileInfo()->absoluteFilePath() );
//Workspace:
workspaceStateChanged( media->isInWorkspace() );
} }
void void
...@@ -100,6 +102,17 @@ ClipMetadataDisplayer::setWatchedClip( const Clip *clip ) ...@@ -100,6 +102,17 @@ ClipMetadataDisplayer::setWatchedClip( const Clip *clip )
connect( m_watchedMedia, SIGNAL( metaDataComputed(const Media*) ), connect( m_watchedMedia, SIGNAL( metaDataComputed(const Media*) ),
this, SLOT( metadataUpdated( const Media*) ) ); this, SLOT( metadataUpdated( const Media*) ) );
} }
connect( m_watchedMedia, SIGNAL( workspaceStateChanged( bool ) ),
this, SLOT( workspaceStateChanged( bool ) ) );
}
void
ClipMetadataDisplayer::workspaceStateChanged( bool state )
{
if ( state == true )
m_ui->inProjectWorkspaceValueLabel->setPixmap( QPixmap( ":/images/ok" ).scaled( 16, 16 ) );
else
m_ui->inProjectWorkspaceValueLabel->setPixmap( QPixmap( ":/images/ko" ).scaled( 16, 16 ) );
} }
void void
......
...@@ -54,6 +54,7 @@ class ClipMetadataDisplayer : public QWidget ...@@ -54,6 +54,7 @@ class ClipMetadataDisplayer : public QWidget
private slots: private slots:
void metadataUpdated( const Media *media ); void metadataUpdated( const Media *media );
void workspaceStateChanged( bool state );
void clipDestroyed( Clip* clip ); void clipDestroyed( Clip* clip );
}; };
......
...@@ -229,7 +229,7 @@ ...@@ -229,7 +229,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="0"> <item row="8" column="0">
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
...@@ -242,6 +242,20 @@ ...@@ -242,6 +242,20 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="7" column="0">
<widget class="QLabel" name="inProjectWorkspaceLabel">
<property name="text">
<string>In project workspace</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="inProjectWorkspaceValueLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
......
...@@ -293,4 +293,5 @@ Media::setFilePath( const QString &filePath ) ...@@ -293,4 +293,5 @@ Media::setFilePath( const QString &filePath )
m_inWorkspace = false; m_inWorkspace = false;
m_workspacePath = ""; m_workspacePath = "";
} }
emit workspaceStateChanged( m_inWorkspace );
} }
...@@ -183,6 +183,7 @@ protected: ...@@ -183,6 +183,7 @@ protected:
signals: signals:
void metaDataComputed( const Media* ); void metaDataComputed( const Media* );
void audioSpectrumComputed( const QUuid& ); void audioSpectrumComputed( const QUuid& );
void workspaceStateChanged( bool );
}; };
#endif // MEDIA_H__ #endif // MEDIA_H__
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