+ DocClipBase *clip = NULL;
+ GenTime pos;
+ if (m_projectMonitor->isActive()) {
+ if (m_activeTimeline) {
+ ClipItem *item = m_activeTimeline->projectView()->getActiveClipUnderCursor();
+ if (item) {
+ pos = m_projectMonitor->position() - item->startPos() + item->cropStart();
+ clip = item->baseClip();
+ }
+ }
+ } else {
+ clip = m_clipMonitor->activeClip();
+ pos = m_clipMonitor->position();
+ }
+ if (!clip) {
+ m_messageLabel->setMessage(i18n("Cannot find clip to remove marker"), ErrorMessage);
+ return;
+ }
+
+ QString id = clip->getId();
+ QString oldcomment = clip->markerComment(pos);
+ if (oldcomment.isEmpty()) {
+ m_messageLabel->setMessage(i18n("No marker found at cursor time"), ErrorMessage);
+ return;
+ }
+
+ CommentedTime marker(pos, oldcomment);
+ MarkerDialog d(clip, marker, m_activeDocument->timecode(), i18n("Edit Marker"), this);
+ if (d.exec() == QDialog::Accepted) {
+ m_activeTimeline->projectView()->slotAddClipMarker(id, d.newMarker().time(), d.newMarker().comment());
+ if (d.newMarker().time() != pos) {
+ // remove old marker
+ m_activeTimeline->projectView()->slotAddClipMarker(id, pos, QString());
+ }
+ if (m_clipMonitor->isActive()) m_clipMonitor->checkOverlay();