# HG changeset patch # User Chris Cannam # Date 1225217166 0 # Node ID f8fcfbe13c8fe1c64d01e801f1f10b04947ed566 # Parent 08d6bc698d16315fa48d984bf2128187a6900e02 * Avoid waiting on uninstalled transforms mutex in TransformFactory:: getTransformInstallStatus -- we can return TransformUnknown * Don't follow link in SelectableLabel when clicking to select it * Restore lost version number in plugin param dialog diff -r 08d6bc698d16 -r f8fcfbe13c8f widgets/PluginParameterDialog.cpp --- a/widgets/PluginParameterDialog.cpp Tue Oct 28 12:39:53 2008 +0000 +++ b/widgets/PluginParameterDialog.cpp Tue Oct 28 18:06:06 2008 +0000 @@ -79,8 +79,8 @@ QLabel *makerLabel = new QLabel(plugin->getMaker().c_str()); makerLabel->setWordWrap(true); - QLabel *versionLabel = new QLabel(QString("%1") - .arg(plugin->getPluginVersion())); + int version = plugin->getPluginVersion(); + QLabel *versionLabel = new QLabel(QString("%1").arg(version)); versionLabel->setWordWrap(true); QLabel *copyrightLabel = new QLabel(plugin->getCopyright().c_str()); @@ -121,16 +121,12 @@ row++; } - Vamp::Plugin *fePlugin = dynamic_cast(m_plugin); - - if (fePlugin) { + if (version >= 0) { label = new QLabel(tr("Version:")); label->setAlignment(Qt::AlignTop | Qt::AlignLeft); 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:")); diff -r 08d6bc698d16 -r f8fcfbe13c8f widgets/SelectableLabel.cpp --- a/widgets/SelectableLabel.cpp Tue Oct 28 12:39:53 2008 +0000 +++ b/widgets/SelectableLabel.cpp Tue Oct 28 18:06:06 2008 +0000 @@ -26,6 +26,7 @@ // setLineWidth(2); // setFixedWidth(480); setupStyle(); + setOpenExternalLinks(true); } SelectableLabel::~SelectableLabel() @@ -59,6 +60,10 @@ { QPalette palette = QApplication::palette(); + setTextInteractionFlags(Qt::LinksAccessibleByKeyboard | + Qt::LinksAccessibleByMouse | + Qt::TextSelectableByMouse); + if (m_selected) { setWordWrap(true); setStyleSheet @@ -77,8 +82,6 @@ .arg(palette.button().color().name()) .arg(palette.light().color().name()) .arg(palette.text().color().name())); - -// setStyleSheet("QLabel:hover { background: #e0e0e0; color: black; } QLabel:!hover { background: white; color: black } QLabel { padding: 7px }"); } } @@ -105,18 +108,27 @@ void SelectableLabel::mousePressEvent(QMouseEvent *e) { + m_swallowRelease = !m_selected; setSelected(true); + QLabel::mousePressEvent(e); emit selectionChanged(); } void SelectableLabel::mouseDoubleClickEvent(QMouseEvent *e) { - std::cerr << "mouseDoubleClickEvent" << std::endl; + QLabel::mouseDoubleClickEvent(e); emit doubleClicked(); } void +SelectableLabel::mouseReleaseEvent(QMouseEvent *e) +{ + if (!m_swallowRelease) QLabel::mouseReleaseEvent(e); + m_swallowRelease = false; +} + +void SelectableLabel::enterEvent(QEvent *) { // std::cerr << "enterEvent" << std::endl; diff -r 08d6bc698d16 -r f8fcfbe13c8f widgets/SelectableLabel.h --- a/widgets/SelectableLabel.h Tue Oct 28 12:39:53 2008 +0000 +++ b/widgets/SelectableLabel.h Tue Oct 28 18:06:06 2008 +0000 @@ -41,6 +41,7 @@ protected: virtual void mousePressEvent(QMouseEvent *e); + virtual void mouseReleaseEvent(QMouseEvent *e); virtual void mouseDoubleClickEvent(QMouseEvent *e); virtual void enterEvent(QEvent *); virtual void leaveEvent(QEvent *); @@ -48,6 +49,7 @@ QString m_selectedText; QString m_unselectedText; bool m_selected; + bool m_swallowRelease; }; #endif diff -r 08d6bc698d16 -r f8fcfbe13c8f widgets/TransformFinder.cpp --- a/widgets/TransformFinder.cpp Tue Oct 28 12:39:53 2008 +0000 +++ b/widgets/TransformFinder.cpp Tue Oct 28 18:06:06 2008 +0000 @@ -234,10 +234,6 @@ SLOT(accept())); QPalette palette = label->palette(); label->setPalette(palette); - label->setTextInteractionFlags(Qt::LinksAccessibleByKeyboard | - Qt::LinksAccessibleByMouse | - Qt::TextSelectableByMouse); - label->setOpenExternalLinks(true); m_labels.push_back(label); }