From 2bdafc72cb68a040817f1a648e6416c52ba8cc76 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 17 Feb 2019 23:46:39 -0800 Subject: [PATCH] preview generator updates the appropriate ui when done --- io/previewgenerator.cpp | 4 ++++ panels/project.cpp | 3 +++ project/sequence.cpp | 13 ++++++++++++- project/sequence.h | 2 ++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/io/previewgenerator.cpp b/io/previewgenerator.cpp index e04e5e340..1d4aab8bc 100644 --- a/io/previewgenerator.cpp +++ b/io/previewgenerator.cpp @@ -197,6 +197,10 @@ void PreviewGenerator::finalize_media() { } else { olive::media_icon_service->SetMediaIcon(media, ICON_TYPE_VIDEO); } + + if (olive::ActiveSequence != nullptr) { + olive::ActiveSequence->RefreshClips(media); + } } } diff --git a/panels/project.cpp b/panels/project.cpp index df4dc0d3c..3f41708f0 100644 --- a/panels/project.cpp +++ b/panels/project.cpp @@ -221,6 +221,9 @@ Project::Project(QWidget *parent) : connect(directory_up, SIGNAL(clicked(bool)), this, SLOT(go_up_dir())); connect(icon_view, SIGNAL(changed_root()), this, SLOT(set_up_dir_enabled())); + connect(olive::media_icon_service.get(), SIGNAL(IconChanged()), icon_view->viewport(), SLOT(update())); + connect(olive::media_icon_service.get(), SIGNAL(IconChanged()), tree_view->viewport(), SLOT(update())); + update_view_type(); Retranslate(); diff --git a/project/sequence.cpp b/project/sequence.cpp index cd671b712..e3d9633d7 100644 --- a/project/sequence.cpp +++ b/project/sequence.cpp @@ -64,7 +64,18 @@ long Sequence::getEndFrame() { end = c->timeline_out; } } - return end; + return end; +} + +void Sequence::RefreshClips(Media *m) { + for (int i=0;imedia == m)) { + c->refresh(); + } + } } void Sequence::getTrackLimits(int* video_tracks, int* audio_tracks) { diff --git a/project/sequence.h b/project/sequence.h index bdb150305..e242a0dcc 100644 --- a/project/sequence.h +++ b/project/sequence.h @@ -42,6 +42,8 @@ public: int audio_frequency; int audio_layout; + void RefreshClips(Media* m = nullptr); + QVector selections; long playhead;