--- qsampler/trunk/src/qsamplerChannelForm.cpp 2010/03/29 17:00:30 2074 +++ qsampler/trunk/src/qsamplerChannelForm.cpp 2010/07/15 17:01:35 2109 @@ -107,11 +107,11 @@ QObject::connect(m_ui.AudioDeviceComboBox, SIGNAL(activated(int)), SLOT(selectAudioDevice(int))); - QObject::connect(m_ui.OkPushButton, - SIGNAL(clicked()), + QObject::connect(m_ui.DialogButtonBox, + SIGNAL(accepted()), SLOT(accept())); - QObject::connect(m_ui.CancelPushButton, - SIGNAL(clicked()), + QObject::connect(m_ui.DialogButtonBox, + SIGNAL(rejected()), SLOT(reject())); QObject::connect(m_ui.MidiDeviceToolButton, SIGNAL(clicked()), @@ -434,7 +434,7 @@ bool bReject = true; // Check if there's any pending changes... - if (m_iDirtyCount > 0 && m_ui.OkPushButton->isEnabled()) { + if (m_iDirtyCount > 0) { switch (QMessageBox::warning(this, QSAMPLER_TITLE ": " + tr("Warning"), tr("Some channel settings have been changed.\n\n" @@ -473,10 +473,17 @@ // FIXME: the instrument file filters should be restricted, // depending on the current engine. + QStringList filters; + filters << tr("GIG Instrument files") + " (*.gig *.dls)"; + filters << tr("SFZ Instrument files") + " (*.sfz)"; + filters << tr("SF2 Instrument files") + " (*.sf2)"; + filters << tr("All files") + " (*.*)"; + const QString& filter = filters.join(";;"); + QString sInstrumentFile = QFileDialog::getOpenFileName(this, QSAMPLER_TITLE ": " + tr("Instrument files"), // Caption. - pOptions->sInstrumentDir, // Start here. - tr("Instrument files") + " (*.gig *.dls)" // Filter (GIG and DLS files) + pOptions->sInstrumentDir, // Start here. + filter // File filter. ); if (sInstrumentFile.isEmpty()) @@ -807,7 +814,8 @@ const QString& sPath = InstrumentFileComboBox->currentText(); bValid = bValid && !sPath.isEmpty() && QFileInfo(sPath).exists(); #endif - m_ui.OkPushButton->setEnabled(m_iDirtyCount > 0 && bValid); + m_ui.DialogButtonBox->button( + QDialogButtonBox::Ok)->setEnabled(m_iDirtyCount > 0 && bValid); }