# HG changeset patch # User Chris Cannam # Date 1211217791 0 # Node ID f329416bf1a529b678453f69df0a3135b6192853 # Parent 590b899b7e45094aad9d1479e4ea5fda7fb5d446 * Permit holding Shift while dragging an instant or other edited thing, to override the initial drag resistance (for #1928943 sticky time instants) * better handling of updates during progressive decode load * ready() signal from model (used by vect) diff -r 590b899b7e45 -r f329416bf1a5 layer/TimeInstantLayer.cpp --- a/layer/TimeInstantLayer.cpp Fri May 16 13:27:07 2008 +0000 +++ b/layer/TimeInstantLayer.cpp Mon May 19 17:23:11 2008 +0000 @@ -35,6 +35,8 @@ #include #include +#define DEBUG_TIME_INSTANT_LAYER 1 + TimeInstantLayer::TimeInstantLayer() : SingleColourLayer(), m_model(0), @@ -57,7 +59,9 @@ connectSignals(m_model); +#ifdef DEBUG_TIME_INSTANT_LAYER std::cerr << "TimeInstantLayer::setModel(" << model << ")" << std::endl; +#endif emit modelReplaced(); } @@ -446,7 +450,9 @@ void TimeInstantLayer::drawStart(View *v, QMouseEvent *e) { +#ifdef DEBUG_TIME_INSTANT_LAYER std::cerr << "TimeInstantLayer::drawStart(" << e->x() << ")" << std::endl; +#endif if (!m_model) return; @@ -467,7 +473,9 @@ void TimeInstantLayer::drawDrag(View *v, QMouseEvent *e) { +#ifdef DEBUG_TIME_INSTANT_LAYER std::cerr << "TimeInstantLayer::drawDrag(" << e->x() << ")" << std::endl; +#endif if (!m_model || !m_editing) return; @@ -482,7 +490,9 @@ void TimeInstantLayer::drawEnd(View *, QMouseEvent *e) { +#ifdef DEBUG_TIME_INSTANT_LAYER std::cerr << "TimeInstantLayer::drawEnd(" << e->x() << ")" << std::endl; +#endif if (!m_model || !m_editing) return; QString newName = tr("Add Point at %1 s") .arg(RealTime::frame2RealTime(m_editingPoint.frame, @@ -541,7 +551,9 @@ void TimeInstantLayer::editStart(View *v, QMouseEvent *e) { +#ifdef DEBUG_TIME_INSTANT_LAYER std::cerr << "TimeInstantLayer::editStart(" << e->x() << ")" << std::endl; +#endif if (!m_model) return; @@ -561,7 +573,9 @@ void TimeInstantLayer::editDrag(View *v, QMouseEvent *e) { +#ifdef DEBUG_TIME_INSTANT_LAYER std::cerr << "TimeInstantLayer::editDrag(" << e->x() << ")" << std::endl; +#endif if (!m_model || !m_editing) return; @@ -582,7 +596,9 @@ void TimeInstantLayer::editEnd(View *, QMouseEvent *e) { +#ifdef DEBUG_TIME_INSTANT_LAYER std::cerr << "TimeInstantLayer::editEnd(" << e->x() << ")" << std::endl; +#endif if (!m_model || !m_editing) return; if (m_editingCommand) { QString newName = tr("Move Point to %1 s") diff -r 590b899b7e45 -r f329416bf1a5 view/Pane.cpp --- a/view/Pane.cpp Fri May 16 13:27:07 2008 +0000 +++ b/view/Pane.cpp Mon May 19 17:23:11 2008 +0000 @@ -1557,14 +1557,25 @@ if (!m_editing) { + bool resist = true; + + if ((e->modifiers() & Qt::ShiftModifier)) { + m_shiftPressed = true; + // ... but don't set it false if shift has been + // released -- we want the state when we started + // dragging to be used most of the time + } + + if (m_shiftPressed) resist = false; + DragMode newDragMode = updateDragMode (m_dragMode, m_clickPos, e->pos(), - true, // can move horiz - true, // can move vert - true, // resist horiz - true); // resist vert + true, // can move horiz + true, // can move vert + resist, // resist horiz + resist); // resist vert if (newDragMode != UnresolvedDrag) { diff -r 590b899b7e45 -r f329416bf1a5 view/View.cpp --- a/view/View.cpp Fri May 16 13:27:07 2008 +0000 +++ b/view/View.cpp Mon May 19 17:23:11 2008 +0000 @@ -1385,20 +1385,25 @@ int completion = i->first->getCompletion(this); QString text = i->first->getPropertyContainerName(); + Model *model = i->first->getModel(); + RangeSummarisableTimeValueModel *wfm = + dynamic_cast(model); + if (completion >= 100) { //!!! - Model *model = i->first->getModel(); - RangeSummarisableTimeValueModel *wfm = - dynamic_cast(model); if (wfm || (wfm = dynamic_cast (model->getSourceModel()))) { completion = wfm->getAlignmentCompletion(); + std::cerr << "View::checkProgress: Alignment completion = " << completion << std::endl; if (completion < 100) { text = tr("Alignment"); } } + + } else if (wfm) { + update(); // ensure duration &c gets updated } if (completion >= 100) {