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:
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user