27 |
#include "qsamplerChannel.h" |
#include "qsamplerChannel.h" |
28 |
#include "qsamplerMainForm.h" |
#include "qsamplerMainForm.h" |
29 |
|
|
|
#include <QFileDialog> |
|
30 |
#include <QMessageBox> |
#include <QMessageBox> |
31 |
|
#include <QPushButton> |
32 |
|
#include <QFileDialog> |
33 |
|
|
34 |
// Needed for lroundf() |
// Needed for lroundf() |
35 |
#include <math.h> |
#include <math.h> |
97 |
QObject::connect(m_ui.LoadModeComboBox, |
QObject::connect(m_ui.LoadModeComboBox, |
98 |
SIGNAL(activated(int)), |
SIGNAL(activated(int)), |
99 |
SLOT(changed())); |
SLOT(changed())); |
100 |
QObject::connect(m_ui.OkPushButton, |
QObject::connect(m_ui.DialogButtonBox, |
101 |
SIGNAL(clicked()), |
SIGNAL(accepted()), |
102 |
SLOT(accept())); |
SLOT(accept())); |
103 |
QObject::connect(m_ui.CancelPushButton, |
QObject::connect(m_ui.DialogButtonBox, |
104 |
SIGNAL(clicked()), |
SIGNAL(rejected()), |
105 |
SLOT(reject())); |
SLOT(reject())); |
106 |
} |
} |
107 |
|
|
361 |
bool bReject = true; |
bool bReject = true; |
362 |
|
|
363 |
// Check if there's any pending changes... |
// Check if there's any pending changes... |
364 |
if (m_iDirtyCount > 0 && m_ui.OkPushButton->isEnabled()) { |
if (m_iDirtyCount > 0) { |
365 |
switch (QMessageBox::warning(this, |
switch (QMessageBox::warning(this, |
366 |
QSAMPLER_TITLE ": " + tr("Warning"), |
QSAMPLER_TITLE ": " + tr("Warning"), |
367 |
tr("Some channel settings have been changed.\n\n" |
tr("Some channel settings have been changed.\n\n" |
406 |
const QString& sPath = m_ui.InstrumentFileComboBox->currentText(); |
const QString& sPath = m_ui.InstrumentFileComboBox->currentText(); |
407 |
bValid = bValid && !sPath.isEmpty() && QFileInfo(sPath).exists(); |
bValid = bValid && !sPath.isEmpty() && QFileInfo(sPath).exists(); |
408 |
|
|
409 |
m_ui.OkPushButton->setEnabled(m_iDirtyCount > 0 && bValid); |
m_ui.DialogButtonBox->button( |
410 |
|
QDialogButtonBox::Ok)->setEnabled(m_iDirtyCount > 0 && bValid); |
411 |
} |
} |
412 |
|
|
413 |
} // namespace QSampler |
} // namespace QSampler |