Mercurial > hg > svgui
changeset 1294:9f9a7edd7d89 plugin-path-config
Show value of environment variable; populate for last plugin type by default (as that happens to be Vamp)
author | Chris Cannam |
---|---|
date | Mon, 04 Jun 2018 15:44:57 +0100 |
parents | 6dd15b5c14f9 |
children | 11888b7e193d |
files | widgets/PluginPathConfigurator.cpp widgets/PluginReviewDialog.cpp |
diffstat | 2 files changed, 24 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/widgets/PluginPathConfigurator.cpp Fri May 25 16:05:51 2018 +0100 +++ b/widgets/PluginPathConfigurator.cpp Mon Jun 04 15:44:57 2018 +0100 @@ -129,7 +129,7 @@ if (m_paths.empty()) return; - populateFor(m_paths.begin()->first, -1); + populateFor(m_paths.rbegin()->first, -1); } void @@ -137,16 +137,34 @@ { QString envVariable = m_paths.at(type).envVariable; bool useEnvVariable = m_paths.at(type).useEnvVariable; + QString envVarValue = + PluginPathSetter::getOriginalEnvironmentValue(envVariable); + QString currentValueRubric; + if (envVarValue == QString()) { + currentValueRubric = tr("(Variable is currently unset)"); + } else { + if (envVarValue.length() > 100) { + QString envVarStart = envVarValue.left(95); + currentValueRubric = tr("(Current value begins: \"%1 ...\")") + .arg(envVarStart); + } else { + currentValueRubric = tr("(Currently set to: \"%1\")") + .arg(envVarValue); + } + } m_envOverride->setText - (tr("Allow the %1 environment variable to take priority over this") - .arg(envVariable)); + (tr("Allow the %1 environment variable to take priority over this\n%2") + .arg(envVariable) + .arg(currentValueRubric)); m_envOverride->setCheckState(useEnvVariable ? Qt::Checked : Qt::Unchecked); - + m_list->clear(); for (int i = 0; i < m_pluginTypeSelector->count(); ++i) { if (type == m_pluginTypeSelector->itemText(i)) { + m_pluginTypeSelector->blockSignals(true); m_pluginTypeSelector->setCurrentIndex(i); + m_pluginTypeSelector->blockSignals(false); } }
--- a/widgets/PluginReviewDialog.cpp Fri May 25 16:05:51 2018 +0100 +++ b/widgets/PluginReviewDialog.cpp Mon Jun 04 15:44:57 2018 +0100 @@ -36,9 +36,9 @@ m_table = new QTableWidget; layout->addWidget(m_table, 0, 1); - QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Ok); + QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Close); layout->addWidget(bb, 1, 1); - connect(bb, SIGNAL(accepted()), this, SLOT(accept())); + connect(bb, SIGNAL(rejected()), this, SLOT(close())); } PluginReviewDialog::~PluginReviewDialog()