diff widgets/PropertyBox.cpp @ 64:10bcd53ddc71

* Add icon for playback plugin edit button * Make playback plugins respond to parameter & program changes while their edit dialog is still visible
author Chris Cannam
date Thu, 23 Mar 2006 18:42:17 +0000
parents fb02fe13ff47
children 6dad2724f3aa
line wrap: on
line diff
--- a/widgets/PropertyBox.cpp	Thu Mar 23 15:49:41 2006 +0000
+++ b/widgets/PropertyBox.cpp	Thu Mar 23 18:42:17 2006 +0000
@@ -154,7 +154,9 @@
 	layout->insertStretch(-1, 10);
 
         if (params->getPlayPluginId() != "") {
-            QPushButton *pluginButton = new QPushButton("E");
+            QPushButton *pluginButton = new QPushButton(QIcon(":icons/faders.png"), "");
+            pluginButton->setFixedWidth(24);
+            pluginButton->setFixedHeight(24);
             layout->addWidget(pluginButton);
             connect(pluginButton, SIGNAL(clicked()),
                     this, SLOT(editPlugin()));
@@ -486,14 +488,32 @@
     instance->setParametersFromXml(configurationXml);
 
     PluginParameterDialog *dialog = new PluginParameterDialog(instance);
+    connect(dialog, SIGNAL(pluginConfigurationChanged(QString)),
+            this, SLOT(pluginConfigurationChanged(QString)));
+
     if (dialog->exec() == QDialog::Accepted) {
         params->setPlayPluginConfiguration(instance->toXmlString());
+    } else {
+        // restore in case we mucked about with the configuration
+        // as a consequence of signals from the dialog
+        params->setPlayPluginConfiguration(configurationXml);
     }
 
     delete dialog;
     delete instance;
 }
 
+void
+PropertyBox::pluginConfigurationChanged(QString configurationXml)
+{
+    PlayParameters *params = m_container->getPlayParameters();
+    if (!params) return;
+
+    params->setPlayPluginConfiguration(configurationXml);
+}    
+    
+    
+
 #ifdef INCLUDE_MOCFILES
 #include "PropertyBox.moc.cpp"
 #endif