comparison layer/TextLayer.cpp @ 255:e175ade2d6b0

* double-click in navigate mode relocates the centre frame (closing #1734854)
author Chris Cannam
date Wed, 13 Jun 2007 09:19:33 +0000
parents 28c8e8e3c537
children cd2492c5fe45
comparison
equal deleted inserted replaced
254:a2ae3d93c645 255:e175ade2d6b0
585 585
586 m_editingCommand = 0; 586 m_editingCommand = 0;
587 m_editing = false; 587 m_editing = false;
588 } 588 }
589 589
590 void 590 bool
591 TextLayer::editOpen(View *v, QMouseEvent *e) 591 TextLayer::editOpen(View *v, QMouseEvent *e)
592 { 592 {
593 std::cerr << "TextLayer::editOpen" << std::endl; 593 if (!m_model) return false;
594
595 if (!m_model) return;
596 594
597 TextModel::PointList points = getLocalPoints(v, e->x(), e->y()); 595 TextModel::PointList points = getLocalPoints(v, e->x(), e->y());
598 if (points.empty()) return; 596 if (points.empty()) return false;
599 597
600 QString label = points.begin()->label; 598 QString label = points.begin()->label;
601 599
602 bool ok = false; 600 bool ok = false;
603 label = QInputDialog::getText(v, tr("Enter label"), 601 label = QInputDialog::getText(v, tr("Enter label"),
606 if (ok && label != points.begin()->label) { 604 if (ok && label != points.begin()->label) {
607 TextModel::RelabelCommand *command = 605 TextModel::RelabelCommand *command =
608 new TextModel::RelabelCommand(m_model, *points.begin(), label); 606 new TextModel::RelabelCommand(m_model, *points.begin(), label);
609 CommandHistory::getInstance()->addCommand(command); 607 CommandHistory::getInstance()->addCommand(command);
610 } 608 }
609
610 return true;
611 } 611 }
612 612
613 void 613 void
614 TextLayer::moveSelection(Selection s, size_t newStartFrame) 614 TextLayer::moveSelection(Selection s, size_t newStartFrame)
615 { 615 {