timebasedwidget/timeruler: reimplemented creating and displaying markers

This commit is contained in:
itsmattkc
2020-03-14 23:03:27 +11:00
parent a56484d3e6
commit 1c4411a4ad
9 changed files with 94 additions and 1 deletions
+22
View File
@@ -1,8 +1,10 @@
#include "timebased.h"
#include <QInputDialog>
#include <QUndoCommand>
#include "common/timecodefunctions.h"
#include "config/config.h"
#include "core.h"
#include "project/item/sequence/sequence.h"
#include "widget/timelinewidget/undo/undo.h"
@@ -366,3 +368,23 @@ void TimeBasedWidget::ClearInOutPoints()
Core::instance()->undo_stack()->push(new WorkareaSetEnabledCommand(points_, false));
}
void TimeBasedWidget::SetMarker()
{
if (!points_) {
return;
}
bool ok;
QString marker_name;
if (Config::Current()["SetNameWithMarker"].toBool()) {
marker_name = QInputDialog::getText(this, tr("Set Marker"), tr("Marker name:"), QLineEdit::Normal, QString(), &ok);
} else {
ok = true;
}
if (ok) {
points_->markers()->AddMarker(TimeRange(GetTime(), GetTime()), marker_name);
}
}