nodes/clips: use node label as clip name and allow changing multiple labels at once

Merges the "clip name" and "node label" into the same entity.
This commit is contained in:
itsmattkc
2020-06-16 16:23:05 +10:00
parent cbbf1c9149
commit 41b04d976c
11 changed files with 55 additions and 70 deletions
+33
View File
@@ -27,6 +27,7 @@
#include <QFileDialog>
#include <QFileInfo>
#include <QHBoxLayout>
#include <QInputDialog>
#include <QMessageBox>
#include <QStyleFactory>
@@ -970,6 +971,38 @@ void Core::SetPreferenceForRenderMode(RenderMode::Mode mode, const QString &pref
Config::Current()[GetRenderModePreferencePrefix(mode, preference)] = value;
}
void Core::LabelNodes(const QList<Node *> &nodes) const
{
if (nodes.isEmpty()) {
return;
}
bool ok;
QString start_label = nodes.first()->GetLabel();
for (int i=1; i<nodes.size(); i++) {
if (nodes.at(i)->GetLabel() != start_label) {
// Not all the nodes share the same name, so we'll start with a blank one
start_label.clear();
break;
}
}
QString s = QInputDialog::getText(main_window_,
tr("Label Node"),
tr("Set node label"),
QLineEdit::Normal,
start_label,
&ok);
if (ok) {
foreach (Node* n, nodes) {
n->SetLabel(s);
}
}
}
SequencePtr Core::CreateNewSequenceForProject(Project* project) const
{
SequencePtr new_sequence = std::make_shared<Sequence>();