/[svn]/qsampler/trunk/src/qsamplerInstrumentForm.cpp
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerInstrumentForm.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2069 by capela, Mon Mar 15 10:45:35 2010 UTC revision 2109 by capela, Thu Jul 15 17:01:35 2010 UTC
# Line 27  Line 27 
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>
# Line 96  InstrumentForm::InstrumentForm ( QWidget Line 97  InstrumentForm::InstrumentForm ( QWidget
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    
# Line 257  void InstrumentForm::openInstrumentFile Line 258  void InstrumentForm::openInstrumentFile
258    
259          // FIXME: the instrument file filters should be restricted,          // FIXME: the instrument file filters should be restricted,
260          // depending on the current engine.          // depending on the current engine.
261            QStringList filters;
262            filters << tr("GIG Instrument files") + " (*.gig *.dls)";
263            filters << tr("SFZ Instrument files") + " (*.sfz)";
264            filters << tr("SF2 Instrument files") + " (*.sf2)";
265            filters << tr("All files") + " (*.*)";
266            const QString& filter = filters.join(";;");
267    
268          QString sInstrumentFile = QFileDialog::getOpenFileName(this,          QString sInstrumentFile = QFileDialog::getOpenFileName(this,
269                  QSAMPLER_TITLE ": " + tr("Instrument files"), // Caption.                  QSAMPLER_TITLE ": " + tr("Instrument files"), // Caption.
270                  pOptions->sInstrumentDir,                 // Start here.                  pOptions->sInstrumentDir, // Start here.
271                  tr("Instrument files") + " (*.gig *.dls)" // Filter (GIG and DLS files)                  filter                    // File filter.
272          );          );
273    
274          if (sInstrumentFile.isEmpty())          if (sInstrumentFile.isEmpty())
# Line 360  void InstrumentForm::reject (void) Line 368  void InstrumentForm::reject (void)
368          bool bReject = true;          bool bReject = true;
369    
370          // Check if there's any pending changes...          // Check if there's any pending changes...
371          if (m_iDirtyCount > 0 && m_ui.OkPushButton->isEnabled()) {          if (m_iDirtyCount > 0) {
372                  switch (QMessageBox::warning(this,                  switch (QMessageBox::warning(this,
373                          QSAMPLER_TITLE ": " + tr("Warning"),                          QSAMPLER_TITLE ": " + tr("Warning"),
374                          tr("Some channel settings have been changed.\n\n"                          tr("Some channel settings have been changed.\n\n"
# Line 405  void InstrumentForm::stabilizeForm (void Line 413  void InstrumentForm::stabilizeForm (void
413          const QString& sPath = m_ui.InstrumentFileComboBox->currentText();          const QString& sPath = m_ui.InstrumentFileComboBox->currentText();
414          bValid = bValid && !sPath.isEmpty() && QFileInfo(sPath).exists();          bValid = bValid && !sPath.isEmpty() && QFileInfo(sPath).exists();
415    
416          m_ui.OkPushButton->setEnabled(m_iDirtyCount > 0 && bValid);          m_ui.DialogButtonBox->button(
417                    QDialogButtonBox::Ok)->setEnabled(m_iDirtyCount > 0 && bValid);
418  }  }
419    
420  } // namespace QSampler  } // namespace QSampler

Legend:
Removed from v.2069  
changed lines
  Added in v.2109

  ViewVC Help
Powered by ViewVC