diff --git a/app/widget/footagecombobox/footagecombobox.cpp b/app/widget/footagecombobox/footagecombobox.cpp index b31edf67b..ed22c5574 100644 --- a/app/widget/footagecombobox/footagecombobox.cpp +++ b/app/widget/footagecombobox/footagecombobox.cpp @@ -1,4 +1,4 @@ -/*** +/*** Olive - Non-Linear Video Editor Copyright (C) 2019 Olive Team @@ -51,12 +51,7 @@ void FootageComboBox::showPopup() QAction* selected = menu.exec(parentWidget()->mapToGlobal(pos())); if (selected != nullptr) { - // Use combobox functions to show the footage name - clear(); - - addItem(selected->text()); - - footage_ = selected->data().value(); + SetFootage(selected->data().value()); emit FootageChanged(footage_); } @@ -82,14 +77,9 @@ StreamPtr FootageComboBox::SelectedFootage() void FootageComboBox::SetFootage(StreamPtr f) { // Remove existing single item used to show the footage name - clear(); - footage_ = f; - if (footage_ != nullptr) { - // Use combobox functions to show the footage name - addItem(footage_->footage()->name()); - } + UpdateText(); } void FootageComboBox::TraverseFolder(const Folder *f, QMenu *m) @@ -112,7 +102,7 @@ void FootageComboBox::TraverseFolder(const Folder *f, QMenu *m) m->addMenu(stream_menu); foreach (StreamPtr stream, footage->streams()) { - QAction* stream_action = stream_menu->addAction(stream->description()); + QAction* stream_action = stream_menu->addAction(FootageToString(stream.get())); stream_action->setData(QVariant::fromValue(stream)); stream_action->setIcon(Stream::IconFromType(stream->type())); } @@ -121,4 +111,20 @@ void FootageComboBox::TraverseFolder(const Folder *f, QMenu *m) } } +void FootageComboBox::UpdateText() +{ + // Use combobox functions to show the footage name + clear(); + + if (footage_) { + // Use combobox functions to show the footage name + addItem(FootageToString(footage_.get())); + } +} + +QString FootageComboBox::FootageToString(Stream *f) +{ + return f->description(); +} + OLIVE_NAMESPACE_EXIT diff --git a/app/widget/footagecombobox/footagecombobox.h b/app/widget/footagecombobox/footagecombobox.h index e9cbb108e..e59952069 100644 --- a/app/widget/footagecombobox/footagecombobox.h +++ b/app/widget/footagecombobox/footagecombobox.h @@ -52,6 +52,10 @@ signals: private: void TraverseFolder(const Folder *f, QMenu* m); + void UpdateText(); + + static QString FootageToString(Stream* f); + const Folder* root_; StreamPtr footage_; diff --git a/app/widget/nodeparamview/nodeparamviewwidgetbridge.cpp b/app/widget/nodeparamview/nodeparamviewwidgetbridge.cpp index 52a46d376..74d9dea77 100644 --- a/app/widget/nodeparamview/nodeparamviewwidgetbridge.cpp +++ b/app/widget/nodeparamview/nodeparamviewwidgetbridge.cpp @@ -55,11 +55,9 @@ void NodeParamViewWidgetBridge::SetTime(const rational &time) { time_ = time; - if (!input_) { - return; + if (input_) { + UpdateWidgetValues(); } - - UpdateWidgetValues(); } const QList &NodeParamViewWidgetBridge::widgets() const @@ -174,6 +172,8 @@ void NodeParamViewWidgetBridge::CreateWidgets() for (iterator=input_->properties().begin();iterator!=input_->properties().end();iterator++) { PropertyChanged(iterator.key(), iterator.value()); } + + UpdateWidgetValues(); } void NodeParamViewWidgetBridge::SetInputValue(const QVariant &value, int track)