From 84012d5b4b2d181941c077b2cff223f3bd47c9ea Mon Sep 17 00:00:00 2001 From: Werner Schweer Date: Wed, 6 Feb 2013 18:37:18 +0100 Subject: [PATCH] add 'show staff' to palette cell properties --- mscore/cellproperties.ui | 111 +++++++++++++++++++++------------------ mscore/palette.cpp | 26 +++++---- 2 files changed, 76 insertions(+), 61 deletions(-) diff --git a/mscore/cellproperties.ui b/mscore/cellproperties.ui index 06e9855999..ee8f7b10b2 100644 --- a/mscore/cellproperties.ui +++ b/mscore/cellproperties.ui @@ -6,8 +6,8 @@ 0 0 - 413 - 161 + 461 + 199 @@ -50,6 +50,40 @@ false + + + + Name: + + + + + + + Content Offset + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + Content scale + + + @@ -70,56 +104,6 @@ - - - - Content Offset - - - - - - - Qt::Vertical - - - - 20 - 0 - - - - - - - - Content scale - - - - - - - 0.010000000000000 - - - 10.000000000000000 - - - 0.100000000000000 - - - - - - - Name: - - - - - - @@ -140,6 +124,29 @@ + + + + + + + 0.010000000000000 + + + 10.000000000000000 + + + 0.100000000000000 + + + + + + + draw Staff + + + diff --git a/mscore/palette.cpp b/mscore/palette.cpp index ee1f0bbb2a..5df39cccfd 100644 --- a/mscore/palette.cpp +++ b/mscore/palette.cpp @@ -1025,7 +1025,6 @@ void Palette::write(const QString& p) void Palette::read(XmlReader& e) { -// QString name = e.attribute("name"); while (e.readNextStartElement()) { const QStringRef& t(e.name()); if (t == "gridWidth") @@ -1042,7 +1041,9 @@ void Palette::read(XmlReader& e) e.skipCurrentElement(); else if (t == "Cell") { QString name = e.attribute("name"); - bool drawStaff = false; + Element* element = 0; + QString tag; + bool drawStaff = false; double xoffset = 0.0; double yoffset = 0.0; qreal mag = 1.0; @@ -1056,10 +1057,10 @@ void Palette::read(XmlReader& e) yoffset = e.readDouble(); else if (t == "mag") mag = e.readDouble(); -//TODOxx else if (t == "tag") -// tag = e.value(); + else if (t == "tag") + tag = e.readElementText(); else { - Element* element = Element::name2Element(t, gscore); + element = Element::name2Element(t, gscore); if (element == 0) { e.unknown(); return; @@ -1075,10 +1076,15 @@ void Palette::read(XmlReader& e) } } } - cells.back()->drawStaff = drawStaff; - cells.back()->xoffset = xoffset; - cells.back()->yoffset = yoffset; - cells.back()->mag = mag; + if (!element) + cells.append(new PaletteCell()); // add empty cell + else { + cells.back()->tag = tag; + cells.back()->drawStaff = drawStaff; + cells.back()->xoffset = xoffset; + cells.back()->yoffset = yoffset; + cells.back()->mag = mag; + } } else e.unknown(); @@ -1613,6 +1619,7 @@ PaletteCellProperties::PaletteCellProperties(PaletteCell* p, QWidget* parent) xoffset->setValue(cell->xoffset); yoffset->setValue(cell->yoffset); scale->setValue(cell->mag); + drawStaff->setChecked(cell->drawStaff); name->setText(p->name); } @@ -1626,5 +1633,6 @@ void PaletteCellProperties::accept() cell->yoffset = yoffset->value(); cell->mag = scale->value(); cell->name = name->text(); + cell->drawStaff = drawStaff->isChecked(); QDialog::accept(); }