diff widgets/PropertyBox.cpp @ 185:dd932fe5f3ff

* 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
author Chris Cannam
date Fri, 05 Jan 2007 14:46:45 +0000
parents 42118892f428
children 5b7472db612b
line wrap: on
line diff
--- 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