param view improvements

This commit is contained in:
itsmattkc
2019-07-20 15:31:20 -07:00
parent 3605a2f988
commit 9cfed140b3
6 changed files with 27 additions and 3 deletions
+10 -1
View File
@@ -33,6 +33,8 @@ ParamPanel::ParamPanel(QWidget* parent) :
void ParamPanel::SetNodes(QList<Node *> nodes)
{
view_->SetNodes(nodes);
Retranslate();
}
void ParamPanel::changeEvent(QEvent *e)
@@ -46,5 +48,12 @@ void ParamPanel::changeEvent(QEvent *e)
void ParamPanel::Retranslate()
{
SetTitle(tr("Parameter Editor"));
SetSubtitle(tr("(none)"));
if (view_->nodes().isEmpty()) {
SetSubtitle(tr("(none)"));
} else if (view_->nodes().size() == 1) {
SetSubtitle(view_->nodes().first()->Name());
} else {
SetSubtitle(tr("(multiple)"));
}
}
@@ -12,7 +12,7 @@ FootageComboBox::FootageComboBox(QWidget *parent) :
void FootageComboBox::showPopup()
{
if (root_ == nullptr) {
if (root_ == nullptr || root_->child_count() == 0) {
return;
}
@@ -40,6 +40,13 @@ void FootageComboBox::SetRoot(const Folder *p)
clear();
}
void FootageComboBox::SetFootage(Footage *f)
{
clear();
addItem(f->name());
}
void FootageComboBox::TraverseFolder(const Folder *f, QMenu *m)
{
for (int i=0;i<f->child_count();i++) {
@@ -17,6 +17,9 @@ public:
void SetRoot(const Folder *p);
public slots:
void SetFootage(Footage* f);
signals:
void FootageChanged(Footage* f);
@@ -71,3 +71,8 @@ void NodeParamView::SetNodes(QList<Node *> nodes)
}
}
}
const QList<Node *> &NodeParamView::nodes()
{
return nodes_;
}
+1
View File
@@ -33,6 +33,7 @@ public:
NodeParamView(QWidget* parent);
void SetNodes(QList<Node*> nodes);
const QList<Node*>& nodes();
private:
QVBoxLayout* layout_;
@@ -188,7 +188,6 @@ QList<QWidget*> NodeParamViewItem::CreateWidget(NodeInput* input)
footage_combobox->SetRoot(pp->project()->root());
// End test code
// Pretty hacky way of getting the root folder for this node's sequence
//const Folder* root_folder = static_cast<const Folder*>(static_cast<Sequence*>(input->parent()->parent())->root());
//footage_combobox->SetRoot(root_folder);