comparison widgets/PluginParameterDialog.cpp @ 1324:13d9b422f7fe zoom

Merge from default branch
author Chris Cannam
date Mon, 17 Sep 2018 13:51:31 +0100
parents 3ca1be2e2c91
children c8a6fd3f9dff
comparison
equal deleted inserted replaced
1183:57d192e26331 1324:13d9b422f7fe
18 #include "PluginParameterBox.h" 18 #include "PluginParameterBox.h"
19 #include "WindowTypeSelector.h" 19 #include "WindowTypeSelector.h"
20 20
21 #include "TextAbbrev.h" 21 #include "TextAbbrev.h"
22 #include "IconLoader.h" 22 #include "IconLoader.h"
23 #include "WidgetScale.h"
23 24
24 #include <vamp-hostsdk/Plugin.h> 25 #include <vamp-hostsdk/Plugin.h>
25 #include <vamp-hostsdk/PluginHostAdapter.h> 26 #include <vamp-hostsdk/PluginHostAdapter.h>
26 #include <vamp-hostsdk/PluginWrapper.h> 27 #include <vamp-hostsdk/PluginWrapper.h>
27 28
41 #include <QUrl> 42 #include <QUrl>
42 43
43 #include "base/Debug.h" 44 #include "base/Debug.h"
44 45
45 PluginParameterDialog::PluginParameterDialog(Vamp::PluginBase *plugin, 46 PluginParameterDialog::PluginParameterDialog(Vamp::PluginBase *plugin,
46 QWidget *parent) : 47 QWidget *parent) :
47 QDialog(parent), 48 QDialog(parent),
48 m_plugin(plugin), 49 m_plugin(plugin),
49 m_channel(-1), 50 m_channel(-1),
50 m_stepSize(0), 51 m_stepSize(0),
51 m_blockSize(0), 52 m_blockSize(0),
86 versionLabel->setWordWrap(true); 87 versionLabel->setWordWrap(true);
87 88
88 QLabel *copyrightLabel = new QLabel(plugin->getCopyright().c_str()); 89 QLabel *copyrightLabel = new QLabel(plugin->getCopyright().c_str());
89 copyrightLabel->setWordWrap(true); 90 copyrightLabel->setWordWrap(true);
90 91
91 // QLabel *typeLabel = new QLabel(plugin->getType().c_str());
92 // typeLabel->setWordWrap(true);
93 // typeLabel->setFont(boldFont);
94
95 QLabel *descriptionLabel = 0; 92 QLabel *descriptionLabel = 0;
96 if (plugin->getDescription() != "") { 93 if (plugin->getDescription() != "") {
97 descriptionLabel = new QLabel(plugin->getDescription().c_str()); 94 descriptionLabel = new QLabel(plugin->getDescription().c_str());
98 descriptionLabel->setWordWrap(true); 95 descriptionLabel->setWordWrap(true);
99 descriptionLabel->setFont(italicFont); 96 descriptionLabel->setFont(italicFont);
106 subgrid->addWidget(label, row, 0); 103 subgrid->addWidget(label, row, 0);
107 subgrid->addWidget(nameLabel, row, 1); 104 subgrid->addWidget(nameLabel, row, 1);
108 105
109 m_moreInfo = new QPushButton; 106 m_moreInfo = new QPushButton;
110 m_moreInfo->setIcon(IconLoader().load("info")); 107 m_moreInfo->setIcon(IconLoader().load("info"));
111 m_moreInfo->setFixedSize(QSize(16, 16)); 108 m_moreInfo->setFixedSize(WidgetScale::scaleQSize(QSize(16, 16)));
112 connect(m_moreInfo, SIGNAL(clicked()), this, SLOT(moreInfo())); 109 connect(m_moreInfo, SIGNAL(clicked()), this, SLOT(moreInfo()));
113 subgrid->addWidget(m_moreInfo, row, 2, Qt::AlignTop | Qt::AlignRight); 110 subgrid->addWidget(m_moreInfo, row, 2, Qt::AlignTop | Qt::AlignRight);
114 m_moreInfo->hide(); 111 m_moreInfo->hide();
115 112
116 row++; 113 row++;
117 114
118 if (descriptionLabel) { 115 if (descriptionLabel) {
119 // label = new QLabel(tr("Description:"));
120 // label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
121 // subgrid->addWidget(label, row, 0);
122 subgrid->addWidget(descriptionLabel, row, 1, 1, 2); 116 subgrid->addWidget(descriptionLabel, row, 1, 1, 2);
123 row++; 117 row++;
124 } 118 }
125 119
126 if (version >= 0) { 120 if (version >= 0) {
128 label->setAlignment(Qt::AlignTop | Qt::AlignLeft); 122 label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
129 subgrid->addWidget(label, row, 0); 123 subgrid->addWidget(label, row, 0);
130 subgrid->addWidget(versionLabel, row, 1); 124 subgrid->addWidget(versionLabel, row, 1);
131 row++; 125 row++;
132 } 126 }
133
134 // label = new QLabel(tr("Type:"));
135 // label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
136 // subgrid->addWidget(label, row, 0);
137 // subgrid->addWidget(typeLabel, row, 1);
138 // row++;
139 127
140 label = new QLabel(tr("Maker:")); 128 label = new QLabel(tr("Maker:"));
141 label->setAlignment(Qt::AlignTop | Qt::AlignLeft); 129 label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
142 subgrid->addWidget(label, row, 0); 130 subgrid->addWidget(label, row, 0);
143 subgrid->addWidget(makerLabel, row, 1); 131 subgrid->addWidget(makerLabel, row, 1);
593 } 581 }
594 582
595 void 583 void
596 PluginParameterDialog::setAdvancedVisible(bool visible) 584 PluginParameterDialog::setAdvancedVisible(bool visible)
597 { 585 {
598 // m_advanced->setVisible(visible);
599
600 if (visible) { 586 if (visible) {
601 m_advancedButton->setText(tr("Advanced <<")); 587 m_advancedButton->setText(tr("Advanced <<"));
602 m_advancedButton->setChecked(true); 588 m_advancedButton->setChecked(true);
603 m_advanced->show(); 589 m_advanced->show();
604 } else { 590 } else {
605 m_advanced->hide(); 591 m_advanced->hide();
606 m_advancedButton->setText(tr("Advanced >>")); 592 m_advancedButton->setText(tr("Advanced >>"));
607 m_advancedButton->setChecked(false); 593 m_advancedButton->setChecked(false);
608 } 594 }
609 595
610 // cerr << "resize to " << sizeHint().width() << " x " << sizeHint().height() << endl;
611
612 // setMinimumHeight(sizeHint().height());
613 adjustSize(); 596 adjustSize();
614
615 // (sizeHint());
616 597
617 m_advancedVisible = visible; 598 m_advancedVisible = visible;
618 599
619 QSettings settings; 600 QSettings settings;
620 settings.beginGroup("PluginParameterDialog"); 601 settings.beginGroup("PluginParameterDialog");
621 settings.setValue("advancedvisible", visible); 602 settings.setValue("advancedvisible", visible);
622 settings.endGroup(); 603 settings.endGroup();
623
624 // if (visible) setMaximumHeight(sizeHint().height());
625 // adjustSize();
626 } 604 }
627 605
628 void 606 void
629 PluginParameterDialog::channelComboChanged(int index) 607 PluginParameterDialog::channelComboChanged(int index)
630 { 608 {