From c38bd7a1bb46af6b96112b3ec4efd11838f248f1 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 9 Aug 2019 12:41:55 +1000 Subject: [PATCH] added option to footagecombobox to only show footage that's ready --- app/widget/footagecombobox/footagecombobox.cpp | 15 ++++++++++++--- app/widget/footagecombobox/footagecombobox.h | 4 ++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/widget/footagecombobox/footagecombobox.cpp b/app/widget/footagecombobox/footagecombobox.cpp index 6dbd58d35..baf7e626e 100644 --- a/app/widget/footagecombobox/footagecombobox.cpp +++ b/app/widget/footagecombobox/footagecombobox.cpp @@ -7,7 +7,8 @@ FootageComboBox::FootageComboBox(QWidget *parent) : QComboBox(parent), root_(nullptr), - footage_(nullptr) + footage_(nullptr), + only_show_ready_footage_(true) { } @@ -45,6 +46,11 @@ void FootageComboBox::SetRoot(const Folder *p) clear(); } +void FootageComboBox::SetOnlyShowReadyFootage(bool e) +{ + only_show_ready_footage_ = e; +} + Footage *FootageComboBox::SelectedFootage() { return footage_; @@ -74,9 +80,12 @@ void FootageComboBox::TraverseFolder(const Folder *f, QMenu *m) } else if (child->type() == Item::kFootage) { - QAction* footage_action = m->addAction(child->name()); - footage_action->setData(reinterpret_cast(child)); + Footage* footage = static_cast(child); + if (!only_show_ready_footage_ || footage->status() == Footage::kReady) { + QAction* footage_action = m->addAction(child->name()); + footage_action->setData(reinterpret_cast(child)); + } } } } diff --git a/app/widget/footagecombobox/footagecombobox.h b/app/widget/footagecombobox/footagecombobox.h index 55617c4bd..5c9fa8218 100644 --- a/app/widget/footagecombobox/footagecombobox.h +++ b/app/widget/footagecombobox/footagecombobox.h @@ -17,6 +17,8 @@ public: void SetRoot(const Folder *p); + void SetOnlyShowReadyFootage(bool e); + Footage* SelectedFootage(); public slots: @@ -31,6 +33,8 @@ private: const Folder* root_; Footage* footage_; + + bool only_show_ready_footage_; }; #endif // FOOTAGECOMBOBOX_H