comparison layer/TextLayer.cpp @ 587:4806715f7a19

Seems to be a bad idea to use plain DEBUG symbol on OS/X (system wants it)
author Chris Cannam
date Tue, 14 Jun 2011 15:27:05 +0100
parents f4960f8ce798
children 3437e0fad7ae 1d526ba11a24
comparison
equal deleted inserted replaced
586:1ae54a29e59e 587:4806715f7a19
49 if (m_model == model) return; 49 if (m_model == model) return;
50 m_model = model; 50 m_model = model;
51 51
52 connectSignals(m_model); 52 connectSignals(m_model);
53 53
54 // DEBUG << "TextLayer::setModel(" << model << ")" << endl; 54 // SVDEBUG << "TextLayer::setModel(" << model << ")" << endl;
55 55
56 emit modelReplaced(); 56 emit modelReplaced();
57 } 57 }
58 58
59 Layer::PropertyList 59 Layer::PropertyList
329 brushColour.setHsv(h, s, 255, 100); 329 brushColour.setHsv(h, s, 255, 100);
330 330
331 QColor penColour; 331 QColor penColour;
332 penColour = v->getForeground(); 332 penColour = v->getForeground();
333 333
334 // DEBUG << "TextLayer::paint: resolution is " 334 // SVDEBUG << "TextLayer::paint: resolution is "
335 // << m_model->getResolution() << " frames" << endl; 335 // << m_model->getResolution() << " frames" << endl;
336 336
337 QPoint localPos; 337 QPoint localPos;
338 TextModel::Point illuminatePoint(0); 338 TextModel::Point illuminatePoint(0);
339 bool shouldIlluminate; 339 bool shouldIlluminate;
411 } 411 }
412 412
413 void 413 void
414 TextLayer::drawStart(View *v, QMouseEvent *e) 414 TextLayer::drawStart(View *v, QMouseEvent *e)
415 { 415 {
416 // DEBUG << "TextLayer::drawStart(" << e->x() << "," << e->y() << ")" << endl; 416 // SVDEBUG << "TextLayer::drawStart(" << e->x() << "," << e->y() << ")" << endl;
417 417
418 if (!m_model) { 418 if (!m_model) {
419 DEBUG << "TextLayer::drawStart: no model" << endl; 419 SVDEBUG << "TextLayer::drawStart: no model" << endl;
420 return; 420 return;
421 } 421 }
422 422
423 long frame = v->getFrameForX(e->x()); 423 long frame = v->getFrameForX(e->x());
424 if (frame < 0) frame = 0; 424 if (frame < 0) frame = 0;
437 } 437 }
438 438
439 void 439 void
440 TextLayer::drawDrag(View *v, QMouseEvent *e) 440 TextLayer::drawDrag(View *v, QMouseEvent *e)
441 { 441 {
442 // DEBUG << "TextLayer::drawDrag(" << e->x() << "," << e->y() << ")" << endl; 442 // SVDEBUG << "TextLayer::drawDrag(" << e->x() << "," << e->y() << ")" << endl;
443 443
444 if (!m_model || !m_editing) return; 444 if (!m_model || !m_editing) return;
445 445
446 long frame = v->getFrameForX(e->x()); 446 long frame = v->getFrameForX(e->x());
447 if (frame < 0) frame = 0; 447 if (frame < 0) frame = 0;
456 } 456 }
457 457
458 void 458 void
459 TextLayer::drawEnd(View *v, QMouseEvent *) 459 TextLayer::drawEnd(View *v, QMouseEvent *)
460 { 460 {
461 // DEBUG << "TextLayer::drawEnd(" << e->x() << "," << e->y() << ")" << endl; 461 // SVDEBUG << "TextLayer::drawEnd(" << e->x() << "," << e->y() << ")" << endl;
462 if (!m_model || !m_editing) return; 462 if (!m_model || !m_editing) return;
463 463
464 bool ok = false; 464 bool ok = false;
465 QString label = QInputDialog::getText(v, tr("Enter label"), 465 QString label = QInputDialog::getText(v, tr("Enter label"),
466 tr("Please enter a new label:"), 466 tr("Please enter a new label:"),
521 } 521 }
522 522
523 void 523 void
524 TextLayer::editStart(View *v, QMouseEvent *e) 524 TextLayer::editStart(View *v, QMouseEvent *e)
525 { 525 {
526 // DEBUG << "TextLayer::editStart(" << e->x() << "," << e->y() << ")" << endl; 526 // SVDEBUG << "TextLayer::editStart(" << e->x() << "," << e->y() << ")" << endl;
527 527
528 if (!m_model) return; 528 if (!m_model) return;
529 529
530 if (!getPointToDrag(v, e->x(), e->y(), m_editingPoint)) { 530 if (!getPointToDrag(v, e->x(), e->y(), m_editingPoint)) {
531 return; 531 return;
570 } 570 }
571 571
572 void 572 void
573 TextLayer::editEnd(View *, QMouseEvent *) 573 TextLayer::editEnd(View *, QMouseEvent *)
574 { 574 {
575 // DEBUG << "TextLayer::editEnd(" << e->x() << "," << e->y() << ")" << endl; 575 // SVDEBUG << "TextLayer::editEnd(" << e->x() << "," << e->y() << ")" << endl;
576 if (!m_model || !m_editing) return; 576 if (!m_model || !m_editing) return;
577 577
578 if (m_editingCommand) { 578 if (m_editingCommand) {
579 579
580 QString newName = m_editingCommand->getName(); 580 QString newName = m_editingCommand->getName();