30 |
|
|
31 |
namespace QSampler { |
namespace QSampler { |
32 |
|
|
33 |
InstrumentListForm::InstrumentListForm(QWidget* parent, Qt::WindowFlags flags) : QMainWindow(parent, flags) { |
InstrumentListForm::InstrumentListForm ( QWidget* parent, Qt::WindowFlags flags ) |
34 |
|
: QMainWindow(parent, flags) |
35 |
|
{ |
36 |
ui.setupUi(this); |
ui.setupUi(this); |
37 |
|
|
38 |
ui.newInstrumentAction->setText(tr("New &Instrument...")); |
ui.newInstrumentAction->setText(tr("New &Instrument...")); |
45 |
ui.refreshInstrumentsAction->setShortcut(Qt::Key_F5); |
ui.refreshInstrumentsAction->setShortcut(Qt::Key_F5); |
46 |
|
|
47 |
// Setup toolbar widgets. |
// Setup toolbar widgets. |
48 |
InstrumentToolbar = addToolBar(tr("MIDI Instruments")); |
m_pMapComboBox = new QComboBox(ui.InstrumentToolbar); |
|
m_pMapComboBox = new QComboBox(InstrumentToolbar); |
|
49 |
m_pMapComboBox->setMinimumWidth(120); |
m_pMapComboBox->setMinimumWidth(120); |
50 |
m_pMapComboBox->setEnabled(false); |
m_pMapComboBox->setEnabled(false); |
51 |
QToolTip::add(m_pMapComboBox, tr("Instrument Map")); |
QToolTip::add(m_pMapComboBox, tr("Instrument Map")); |
52 |
|
ui.InstrumentToolbar->addWidget(m_pMapComboBox); |
53 |
|
|
54 |
InstrumentToolbar->addSeparator(); |
ui.InstrumentToolbar->addSeparator(); |
55 |
ui.newInstrumentAction->addTo(InstrumentToolbar); |
ui.newInstrumentAction->addTo(ui.InstrumentToolbar); |
56 |
ui.editInstrumentAction->addTo(InstrumentToolbar); |
ui.editInstrumentAction->addTo(ui.InstrumentToolbar); |
57 |
ui.deleteInstrumentAction->addTo(InstrumentToolbar); |
ui.deleteInstrumentAction->addTo(ui.InstrumentToolbar); |
58 |
InstrumentToolbar->addSeparator(); |
ui.InstrumentToolbar->addSeparator(); |
59 |
ui.refreshInstrumentsAction->addTo(InstrumentToolbar); |
ui.refreshInstrumentsAction->addTo(ui.InstrumentToolbar); |
60 |
|
|
61 |
ui.InstrumentTable->setModel(&model); |
ui.InstrumentTable->setModel(&model); |
62 |
//ui.InstrumentTable->setDelegate(delegate); |
//ui.InstrumentTable->setDelegate(delegate); |
65 |
SIGNAL(activated(int)), |
SIGNAL(activated(int)), |
66 |
SLOT(activateMap(int))); |
SLOT(activateMap(int))); |
67 |
|
|
68 |
connect( |
QObject::connect( |
69 |
ui.refreshInstrumentsAction, |
ui.refreshInstrumentsAction, |
70 |
SIGNAL(triggered()), SLOT(refreshInstruments(void)) |
SIGNAL(triggered()), |
71 |
|
SLOT(refreshInstruments(void)) |
72 |
); |
); |
73 |
} |
} |
74 |
|
|