# HG changeset patch # User Chris Cannam # Date 1225197593 0 # Node ID 08d6bc698d16315fa48d984bf2128187a6900e02 # Parent 681542f0c8c5767ef67d273236c9cf3364638823 * Add more info button to plugin dialog diff -r 681542f0c8c5 -r 08d6bc698d16 widgets/PluginParameterDialog.cpp --- a/widgets/PluginParameterDialog.cpp Fri Oct 24 16:43:59 2008 +0000 +++ b/widgets/PluginParameterDialog.cpp Tue Oct 28 12:39:53 2008 +0000 @@ -19,6 +19,7 @@ #include "WindowTypeSelector.h" #include "TextAbbrev.h" +#include "IconLoader.h" #include "vamp-sdk/Plugin.h" #include "vamp-sdk/PluginHostAdapter.h" @@ -36,6 +37,8 @@ #include #include #include +#include +#include PluginParameterDialog::PluginParameterDialog(Vamp::PluginBase *plugin, QWidget *parent) : @@ -100,18 +103,25 @@ label->setAlignment(Qt::AlignTop | Qt::AlignLeft); subgrid->addWidget(label, row, 0); subgrid->addWidget(nameLabel, row, 1); + + m_moreInfo = new QPushButton; + m_moreInfo->setIcon(IconLoader().load("info")); + m_moreInfo->setFixedSize(QSize(16, 16)); + connect(m_moreInfo, SIGNAL(clicked()), this, SLOT(moreInfo())); + subgrid->addWidget(m_moreInfo, row, 2, Qt::AlignTop | Qt::AlignRight); + m_moreInfo->hide(); + row++; if (descriptionLabel) { // label = new QLabel(tr("Description:")); // label->setAlignment(Qt::AlignTop | Qt::AlignLeft); // subgrid->addWidget(label, row, 0); - subgrid->addWidget(descriptionLabel, row, 1); + subgrid->addWidget(descriptionLabel, row, 1, 1, 2); row++; } - Vamp::PluginHostAdapter *fePlugin = - dynamic_cast(m_plugin); + Vamp::Plugin *fePlugin = dynamic_cast(m_plugin); if (fePlugin) { label = new QLabel(tr("Version:")); @@ -119,6 +129,8 @@ subgrid->addWidget(label, row, 0); subgrid->addWidget(versionLabel, row, 1); row++; + } else { + std::cerr << "PluginParameterDialog: Note: not a feature extraction plugin (type is " << typeid(*m_plugin).name() << ")" << std::endl; } // label = new QLabel(tr("Type:")); @@ -276,6 +288,17 @@ } void +PluginParameterDialog::setMoreInfoUrl(QString moreInfoUrl) +{ + m_moreInfoUrl = moreInfoUrl; + if (m_moreInfoUrl != "") { + m_moreInfo->show(); + } else { + m_moreInfo->hide(); + } +} + +void PluginParameterDialog::setChannelArrangement(int sourceChannels, int targetChannels, int defaultChannel) @@ -549,6 +572,14 @@ } void +PluginParameterDialog::moreInfo() +{ + if (m_moreInfoUrl != "") { + QDesktopServices::openUrl(QUrl(m_moreInfoUrl)); + } +} + +void PluginParameterDialog::advancedToggled() { setAdvancedVisible(!m_advancedVisible); diff -r 681542f0c8c5 -r 08d6bc698d16 widgets/PluginParameterDialog.h --- a/widgets/PluginParameterDialog.h Fri Oct 24 16:43:59 2008 +0000 +++ b/widgets/PluginParameterDialog.h Tue Oct 28 12:39:53 2008 +0000 @@ -51,6 +51,8 @@ void setOutputLabel(QString output, QString description); + void setMoreInfoUrl(QString url); + void setShowProcessingOptions(bool showWindowSize, bool showFrequencyDomainOptions); @@ -81,6 +83,7 @@ void incrementComboChanged(const QString &); void windowTypeChanged(WindowType type); void advancedToggled(); + void moreInfo(); void setAdvancedVisible(bool); void inputModelComboChanged(int); void selectionOnlyChanged(int); @@ -101,6 +104,9 @@ QLabel *m_outputDescription; QLabel *m_outputSpacer; + QPushButton *m_moreInfo; + QString m_moreInfoUrl; + QGroupBox *m_channelBox; bool m_haveChannelBoxData;