Mercurial > hg > svgui
comparison layer/Layer.cpp @ 1266:a34a2a25907c
Untabify
author | Chris Cannam |
---|---|
date | Thu, 01 Mar 2018 18:02:22 +0000 |
parents | 4fe7a09be0fe |
children | 1d7921b1852f |
comparison
equal
deleted
inserted
replaced
1265:6e724c81f18f | 1266:a34a2a25907c |
---|---|
50 { | 50 { |
51 connect(model, SIGNAL(modelChanged()), | 51 connect(model, SIGNAL(modelChanged()), |
52 this, SIGNAL(modelChanged())); | 52 this, SIGNAL(modelChanged())); |
53 | 53 |
54 connect(model, SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t)), | 54 connect(model, SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t)), |
55 this, SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t))); | 55 this, SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t))); |
56 | 56 |
57 connect(model, SIGNAL(completionChanged()), | 57 connect(model, SIGNAL(completionChanged()), |
58 this, SIGNAL(modelCompletionChanged())); | 58 this, SIGNAL(modelCompletionChanged())); |
59 | 59 |
60 connect(model, SIGNAL(alignmentCompletionChanged()), | 60 connect(model, SIGNAL(alignmentCompletionChanged()), |
61 this, SIGNAL(modelAlignmentCompletionChanged())); | 61 this, SIGNAL(modelAlignmentCompletionChanged())); |
62 } | 62 } |
63 | 63 |
64 QString | 64 QString |
65 Layer::getPropertyContainerIconName() const | 65 Layer::getPropertyContainerIconName() const |
66 { | 66 { |
67 return LayerFactory::getInstance()->getLayerIconName | 67 return LayerFactory::getInstance()->getLayerIconName |
68 (LayerFactory::getInstance()->getLayerType(this)); | 68 (LayerFactory::getInstance()->getLayerType(this)); |
69 } | 69 } |
70 | 70 |
71 void | 71 void |
72 Layer::setPresentationName(QString name) | 72 Layer::setPresentationName(QString name) |
73 { | 73 { |
83 QString layerName = factory->getLayerPresentationName | 83 QString layerName = factory->getLayerPresentationName |
84 (factory->getLayerType(this)); | 84 (factory->getLayerType(this)); |
85 | 85 |
86 QString modelName; | 86 QString modelName; |
87 if (getModel()) modelName = getModel()->objectName(); | 87 if (getModel()) modelName = getModel()->objectName(); |
88 | 88 |
89 QString text; | 89 QString text; |
90 if (modelName != "") { | 90 if (modelName != "") { |
91 text = QString("%1: %2").arg(modelName).arg(layerName); | 91 text = QString("%1: %2").arg(modelName).arg(layerName); |
92 } else { | 92 } else { |
93 text = layerName; | 93 text = layerName; |
94 } | 94 } |
95 | 95 |
96 return text; | 96 return text; |
97 } | 97 } |
98 | 98 |
99 void | 99 void |
100 Layer::setObjectName(const QString &name) | 100 Layer::setObjectName(const QString &name) |
107 Layer::getPlayParameters() | 107 Layer::getPlayParameters() |
108 { | 108 { |
109 // cerr << "Layer (" << this << ", " << objectName() << ")::getPlayParameters: model is "<< getModel() << endl; | 109 // cerr << "Layer (" << this << ", " << objectName() << ")::getPlayParameters: model is "<< getModel() << endl; |
110 const Model *model = getModel(); | 110 const Model *model = getModel(); |
111 if (model) { | 111 if (model) { |
112 return PlayParameterRepository::getInstance()->getPlayParameters(model); | 112 return PlayParameterRepository::getInstance()->getPlayParameters(model); |
113 } | 113 } |
114 return 0; | 114 return 0; |
115 } | 115 } |
116 | 116 |
117 void | 117 void |
598 extraAttributes = QString("%1 presentationName=\"%2\"") | 598 extraAttributes = QString("%1 presentationName=\"%2\"") |
599 .arg(extraAttributes).arg(encodeEntities(m_presentationName)); | 599 .arg(extraAttributes).arg(encodeEntities(m_presentationName)); |
600 } | 600 } |
601 | 601 |
602 stream << QString("<layer id=\"%2\" type=\"%1\" name=\"%3\" model=\"%4\" %5") | 602 stream << QString("<layer id=\"%2\" type=\"%1\" name=\"%3\" model=\"%4\" %5") |
603 .arg(encodeEntities(LayerFactory::getInstance()->getLayerTypeName | 603 .arg(encodeEntities(LayerFactory::getInstance()->getLayerTypeName |
604 (LayerFactory::getInstance()->getLayerType(this)))) | 604 (LayerFactory::getInstance()->getLayerType(this)))) |
605 .arg(getObjectExportId(this)) | 605 .arg(getObjectExportId(this)) |
606 .arg(encodeEntities(objectName())) | 606 .arg(encodeEntities(objectName())) |
607 .arg(getObjectExportId(getModel())) | 607 .arg(getObjectExportId(getModel())) |
608 .arg(extraAttributes); | 608 .arg(extraAttributes); |
609 | 609 |
610 if (m_measureRects.empty()) { | 610 if (m_measureRects.empty()) { |
611 stream << QString("/>\n"); | 611 stream << QString("/>\n"); |
612 return; | 612 return; |
613 } | 613 } |
632 extraAttributes = QString("%1 presentationName=\"%2\"") | 632 extraAttributes = QString("%1 presentationName=\"%2\"") |
633 .arg(extraAttributes).arg(encodeEntities(m_presentationName)); | 633 .arg(extraAttributes).arg(encodeEntities(m_presentationName)); |
634 } | 634 } |
635 | 635 |
636 stream << QString("<layer id=\"%2\" type=\"%1\" name=\"%3\" model=\"%4\" %5/>\n") | 636 stream << QString("<layer id=\"%2\" type=\"%1\" name=\"%3\" model=\"%4\" %5/>\n") |
637 .arg(encodeEntities(LayerFactory::getInstance()->getLayerTypeName | 637 .arg(encodeEntities(LayerFactory::getInstance()->getLayerTypeName |
638 (LayerFactory::getInstance()->getLayerType(this)))) | 638 (LayerFactory::getInstance()->getLayerType(this)))) |
639 .arg(getObjectExportId(this)) | 639 .arg(getObjectExportId(this)) |
640 .arg(encodeEntities(objectName())) | 640 .arg(encodeEntities(objectName())) |
641 .arg(getObjectExportId(getModel())) | 641 .arg(getObjectExportId(getModel())) |
642 .arg(extraAttributes); | 642 .arg(extraAttributes); |
643 } | 643 } |
644 | 644 |