comparison layer/ImageLayer.cpp @ 307:a66ff2059dae

* Add image layer icon (from GIMP) * If you cancel the dialog that pops up when you click to insert a new image or text point, ensure that the point is not added
author Chris Cannam
date Fri, 05 Oct 2007 16:31:30 +0000
parents 90b9cfb5b0bb
children 6de6f78b13a1
comparison
equal deleted inserted replaced
306:90b9cfb5b0bb 307:a66ff2059dae
611 // std::cerr << "ImageLayer::drawEnd(" << e->x() << "," << e->y() << ")" << std::endl; 611 // std::cerr << "ImageLayer::drawEnd(" << e->x() << "," << e->y() << ")" << std::endl;
612 if (!m_model || !m_editing) return; 612 if (!m_model || !m_editing) return;
613 613
614 bool ok = false; 614 bool ok = false;
615 615
616 ImageDialog dialog(tr("Select image"), "", tr("<no label>")); 616 ImageDialog dialog(tr("Select image"), "", "");
617 617
618 if (dialog.exec() == QDialog::Accepted) { 618 if (dialog.exec() == QDialog::Accepted) {
619 619
620 checkAddRemote(dialog.getImage()); 620 checkAddRemote(dialog.getImage());
621 621
622 ImageModel::ChangeImageCommand *command = 622 ImageModel::ChangeImageCommand *command =
623 new ImageModel::ChangeImageCommand 623 new ImageModel::ChangeImageCommand
624 (m_model, m_editingPoint, dialog.getImage(), dialog.getLabel()); 624 (m_model, m_editingPoint, dialog.getImage(), dialog.getLabel());
625 m_editingCommand->addCommand(command); 625 m_editingCommand->addCommand(command);
626 } else {
627 m_editingCommand->deletePoint(m_editingPoint);
626 } 628 }
627 629
628 m_editingCommand->finish(); 630 m_editingCommand->finish();
629 m_editingCommand = 0; 631 m_editingCommand = 0;
630 m_editing = false; 632 m_editing = false;