added option to footagecombobox to only show footage that's ready

This commit is contained in:
itsmattkc
2019-08-09 12:41:55 +10:00
parent 1616166fbc
commit c38bd7a1bb
2 changed files with 16 additions and 3 deletions
+12 -3
View File
@@ -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<quintptr>(child));
Footage* footage = static_cast<Footage*>(child);
if (!only_show_ready_footage_ || footage->status() == Footage::kReady) {
QAction* footage_action = m->addAction(child->name());
footage_action->setData(reinterpret_cast<quintptr>(child));
}
}
}
}
@@ -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