Commit 9899297c authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Clear PreviewWidget when removing a clip from the library

parent 9728b189
......@@ -88,12 +88,15 @@ void LibraryWidget::removeMedia( const QUuid& uuid )
{
case Media::Audio:
m_ui.listWidgetAudio->removeItemWidget( item );
m_ui.listWidgetAudio->unsetSelectedClip();
break;
case Media::Image:
m_ui.listWidgetImage->removeItemWidget( item );
m_ui.listWidgetImage->unsetSelectedClip();
break;
case Media::Video:
m_ui.listWidgetVideo->removeItemWidget( item );
m_ui.listWidgetVideo->unsetSelectedClip();
break;
}
m_clips->removeOne( item );
......
......@@ -122,3 +122,8 @@ void MediaListWidget::paintEvent( QPaintEvent* event )
}
QListWidget::paintEvent( event );
}
void MediaListWidget::unsetSelectedClip()
{
emit selectedClipChanged( NULL );
}
......@@ -39,6 +39,7 @@ class MediaListWidget : public QListWidget
public:
MediaListWidget( QWidget* parent = 0 );
void setType( Media::FileType fileType );
void unsetSelectedClip();
protected:
virtual void mousePressEvent( QMouseEvent* event );
......
......@@ -51,6 +51,11 @@ ClipRenderer::~ClipRenderer()
void ClipRenderer::setMedia( Media* media )
{
m_selectedMedia = media;
if ( media == NULL )
{
m_previewLabel->clear();
return ;
}
m_begin = 0;
m_end = media->getNbFrames();
if ( m_isRendering == true )
......@@ -65,6 +70,12 @@ void ClipRenderer::setMedia( Media* media )
void ClipRenderer::setClip( Clip* clip )
{
if ( clip == NULL )
{
m_selectedMedia = NULL;
m_previewLabel->clear();
return ;
}
m_selectedMedia = clip->getParent();
m_begin = clip->getBegin();
m_end = clip->getEnd();
......
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