# HG changeset patch # User Chris Cannam # Date 1168008405 0 # Node ID dd932fe5f3ff73b6e38ca5f9496dadd846441e39 # Parent 3a6fea0abf5669a0243e9de2bd346b8df20e078b * Fix failure to reload play mute state correctly from session file * Ensure Show and Play buttons in layer property box are initialised with the correct state diff -r 3a6fea0abf56 -r dd932fe5f3ff widgets/PropertyBox.cpp --- a/widgets/PropertyBox.cpp Wed Dec 13 15:53:23 2006 +0000 +++ b/widgets/PropertyBox.cpp Fri Jan 05 14:46:45 2007 +0000 @@ -45,7 +45,8 @@ //#define DEBUG_PROPERTY_BOX 1 PropertyBox::PropertyBox(PropertyContainer *container) : - m_container(container) + m_container(container), + m_showButton(0) { #ifdef DEBUG_PROPERTY_BOX std::cerr << "PropertyBox[" << this << "(\"" << @@ -140,11 +141,11 @@ layout->addWidget(showLabel); layout->setAlignment(showLabel, Qt::AlignVCenter); - LEDButton *showButton = new LEDButton(Qt::blue); - layout->addWidget(showButton); - connect(showButton, SIGNAL(stateChanged(bool)), + m_showButton = new LEDButton(Qt::blue); + layout->addWidget(m_showButton); + connect(m_showButton, SIGNAL(stateChanged(bool)), this, SIGNAL(showLayer(bool))); - layout->setAlignment(showButton, Qt::AlignVCenter); + layout->setAlignment(m_showButton, Qt::AlignVCenter); } if (params) { @@ -154,6 +155,7 @@ layout->setAlignment(playLabel, Qt::AlignVCenter); LEDButton *playButton = new LEDButton(Qt::darkGreen); + playButton->setState(!params->isPlayMuted()); layout->addWidget(playButton); connect(playButton, SIGNAL(stateChanged(bool)), params, SLOT(setPlayAudible(bool))); @@ -574,7 +576,12 @@ params->setPlayPluginConfiguration(configurationXml); } - + +void +PropertyBox::layerVisibilityChanged(bool visible) +{ + if (m_showButton) m_showButton->setState(visible); +} #ifdef INCLUDE_MOCFILES diff -r 3a6fea0abf56 -r dd932fe5f3ff widgets/PropertyBox.h --- a/widgets/PropertyBox.h Wed Dec 13 15:53:23 2006 +0000 +++ b/widgets/PropertyBox.h Fri Jan 05 14:46:45 2007 +0000 @@ -26,6 +26,7 @@ class QGridLayout; class QVBoxLayout; class QLabel; +class LEDButton; class PropertyBox : public QFrame { @@ -47,6 +48,7 @@ public slots: void propertyContainerPropertyChanged(PropertyContainer *); void pluginConfigurationChanged(QString); + void layerVisibilityChanged(bool); protected slots: void propertyControllerChanged(int); @@ -71,6 +73,7 @@ PropertyContainer *m_container; QFrame *m_viewPlayFrame; QVBoxLayout *m_mainBox; + LEDButton *m_showButton; std::map m_groupLayouts; std::map m_propertyControllers; }; diff -r 3a6fea0abf56 -r dd932fe5f3ff widgets/PropertyStack.cpp --- a/widgets/PropertyStack.cpp Wed Dec 13 15:53:23 2006 +0000 +++ b/widgets/PropertyStack.cpp Fri Jan 05 14:46:45 2007 +0000 @@ -79,6 +79,11 @@ connect(box, SIGNAL(showLayer(bool)), this, SLOT(showLayer(bool))); + Layer *layer = dynamic_cast(container); + if (layer) { + box->layerVisibilityChanged(!layer->isLayerDormant(m_client)); + } + QIcon icon(QString(":/icons/%1.png").arg(iconName)); if (icon.isNull()) { addTab(box, name);