diff layer/NoteLayer.cpp @ 87:4b98bda7e94d

* Add property labels to property containers (so i18n() won't affect file format)
author Chris Cannam
date Wed, 03 May 2006 16:48:03 +0000
parents 01f27a282c90
children 453f7da3534e
line wrap: on
line diff
--- a/layer/NoteLayer.cpp	Wed May 03 14:26:26 2006 +0000
+++ b/layer/NoteLayer.cpp	Wed May 03 16:48:03 2006 +0000
@@ -69,11 +69,19 @@
 NoteLayer::getProperties() const
 {
     PropertyList list;
-    list.push_back(tr("Colour"));
-    list.push_back(tr("Vertical Scale"));
+    list.push_back("Colour");
+    list.push_back("Vertical Scale");
     return list;
 }
 
+QString
+NoteLayer::getPropertyLabel(const PropertyName &name) const
+{
+    if (name == "Colour") return tr("Colour");
+    if (name == "Vertical Scale") return tr("Vertical Scale");
+    return "";
+}
+
 Layer::PropertyType
 NoteLayer::getPropertyType(const PropertyName &) const
 {
@@ -88,7 +96,7 @@
 
     int deft = 0;
 
-    if (name == tr("Colour")) {
+    if (name == "Colour") {
 
 	if (min) *min = 0;
 	if (max) *max = 5;
@@ -100,7 +108,7 @@
 	else if (m_colour == QColor(200, 50, 255)) deft = 4;
 	else if (m_colour == QColor(255, 150, 50)) deft = 5;
 
-    } else if (name == tr("Vertical Scale")) {
+    } else if (name == "Vertical Scale") {
 	
 	if (min) *min = 0;
 	if (max) *max = 2;
@@ -119,7 +127,7 @@
 NoteLayer::getPropertyValueLabel(const PropertyName &name,
 				    int value) const
 {
-    if (name == tr("Colour")) {
+    if (name == "Colour") {
 	switch (value) {
 	default:
 	case 0: return tr("Black");
@@ -129,7 +137,7 @@
 	case 4: return tr("Purple");
 	case 5: return tr("Orange");
 	}
-    } else if (name == tr("Vertical Scale")) {
+    } else if (name == "Vertical Scale") {
 	switch (value) {
 	default:
 	case 0: return tr("Note Range In Use");
@@ -143,7 +151,7 @@
 void
 NoteLayer::setProperty(const PropertyName &name, int value)
 {
-    if (name == tr("Colour")) {
+    if (name == "Colour") {
 	switch (value) {
 	default:
 	case 0:	setBaseColour(Qt::black); break;
@@ -153,7 +161,7 @@
 	case 4: setBaseColour(QColor(200, 50, 255)); break;
 	case 5: setBaseColour(QColor(255, 150, 50)); break;
 	}
-    } else if (name == tr("Vertical Scale")) {
+    } else if (name == "Vertical Scale") {
 	setVerticalScale(VerticalScale(value));
     }
 }