# HG changeset patch # User Chris Cannam # Date 1541518955 0 # Node ID 2f4476993ae624e30a751df03f2093321e070729 # Parent b6cca362bbf4d891d95cc43a7b1c323aa21dff06# Parent 78eecb19e688b2d170e5542719d06bdade3697d9 Merge from default branch diff -r b6cca362bbf4 -r 2f4476993ae6 widgets/PropertyBox.cpp --- a/widgets/PropertyBox.cpp Tue Nov 06 13:36:04 2018 +0000 +++ b/widgets/PropertyBox.cpp Tue Nov 06 15:42:35 2018 +0000 @@ -802,28 +802,35 @@ QString cname = m_container->getPropertyContainerName(); if (cname == "") return; - LevelPanToolButton *lp = qobject_cast(w); - if (lp) { - emit contextHelpChanged(tr("Adjust playback level and pan of %1").arg(cname)); - return; + QString help; + QString mainText; + QString extraText; + QString editText; + + QString wname = w->objectName(); + QString propertyLabel; + if (wname != "") { + propertyLabel = m_container->getPropertyLabel(wname); } - QString wname = w->objectName(); + LevelPanToolButton *lp = qobject_cast(w); + AudioDial *dial = qobject_cast(w); - if (wname == "playParamButton") { + if (lp) { + + mainText = tr("Adjust playback level and pan of %1").arg(cname); + editText = tr("click then drag to adjust, ctrl+click to reset"); + + } else if (wname == "playParamButton") { + PlayParameters *params = m_container->getPlayParameters(); if (params) { - emit contextHelpChanged - (tr("Change sound used for playback (currently \"%1\")") - .arg(params->getPlayClipId())); - return; + help = tr("Change sound used for playback (currently \"%1\")") + .arg(params->getPlayClipId()); } - } - - QString extraText; - - AudioDial *dial = qobject_cast(w); - if (dial) { + + } else if (dial) { + double mv = dial->mappedValue(); QString unit = ""; if (dial->rangeMapper()) unit = dial->rangeMapper()->getUnit(); @@ -832,25 +839,45 @@ } else { extraText = tr(" (current value: %1)").arg(mv); } + editText = tr("drag up/down to adjust, ctrl+click to reset"); + + } else if (w == m_showButton) { + help = tr("Toggle Visibility of %1").arg(cname); + + } else if (w == m_playButton) { + help = tr("Toggle Playback of %1").arg(cname); + } - QString propertyLabel; - if (wname != "") { - propertyLabel = m_container->getPropertyLabel(wname); + if (help == "" && wname != "") { + + if (qobject_cast(w)) { + mainText = tr("Toggle %1 property of %2") + .arg(propertyLabel).arg(cname); + + } else { + + // Last param empty for historical reasons, to avoid + // changing tr() string + mainText = tr("Adjust %1 property of %2%3") + .arg(propertyLabel).arg(cname).arg(""); + } } - - if (w == m_showButton) { - emit contextHelpChanged(tr("Toggle Visibility of %1").arg(cname)); - } else if (w == m_playButton) { - emit contextHelpChanged(tr("Toggle Playback of %1").arg(cname)); - } else if (wname == "") { - return; - } else if (qobject_cast(w)) { - emit contextHelpChanged(tr("Toggle %1 property of %2") - .arg(propertyLabel).arg(cname)); - } else { - emit contextHelpChanged(tr("Adjust %1 property of %2%3") - .arg(propertyLabel).arg(cname).arg(extraText)); + + if (help == "") { + if (mainText != "") { + if (editText != "") { + help = tr("%1%2: %3") + .arg(mainText).arg(extraText).arg(editText); + } else { + help = tr("%1%2") + .arg(mainText).arg(extraText); + } + } + } + + if (help != "") { + emit contextHelpChanged(help); } }