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

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

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

revision 2074 by capela, Mon Mar 29 17:00:30 2010 UTC revision 2109 by capela, Thu Jul 15 17:01:35 2010 UTC
# Line 107  ChannelForm::ChannelForm ( QWidget* pPar Line 107  ChannelForm::ChannelForm ( QWidget* pPar
107          QObject::connect(m_ui.AudioDeviceComboBox,          QObject::connect(m_ui.AudioDeviceComboBox,
108                  SIGNAL(activated(int)),                  SIGNAL(activated(int)),
109                  SLOT(selectAudioDevice(int)));                  SLOT(selectAudioDevice(int)));
110          QObject::connect(m_ui.OkPushButton,          QObject::connect(m_ui.DialogButtonBox,
111                  SIGNAL(clicked()),                  SIGNAL(accepted()),
112                  SLOT(accept()));                  SLOT(accept()));
113          QObject::connect(m_ui.CancelPushButton,          QObject::connect(m_ui.DialogButtonBox,
114                  SIGNAL(clicked()),                  SIGNAL(rejected()),
115                  SLOT(reject()));                  SLOT(reject()));
116          QObject::connect(m_ui.MidiDeviceToolButton,          QObject::connect(m_ui.MidiDeviceToolButton,
117                  SIGNAL(clicked()),                  SIGNAL(clicked()),
# Line 434  void ChannelForm::reject (void) Line 434  void ChannelForm::reject (void)
434          bool bReject = true;          bool bReject = true;
435    
436          // Check if there's any pending changes...          // Check if there's any pending changes...
437          if (m_iDirtyCount > 0 && m_ui.OkPushButton->isEnabled()) {          if (m_iDirtyCount > 0) {
438                  switch (QMessageBox::warning(this,                  switch (QMessageBox::warning(this,
439                          QSAMPLER_TITLE ": " + tr("Warning"),                          QSAMPLER_TITLE ": " + tr("Warning"),
440                          tr("Some channel settings have been changed.\n\n"                          tr("Some channel settings have been changed.\n\n"
# Line 473  void ChannelForm::openInstrumentFile (vo Line 473  void ChannelForm::openInstrumentFile (vo
473    
474          // FIXME: the instrument file filters should be restricted,          // FIXME: the instrument file filters should be restricted,
475          // depending on the current engine.          // depending on the current engine.
476            QStringList filters;
477            filters << tr("GIG Instrument files") + " (*.gig *.dls)";
478            filters << tr("SFZ Instrument files") + " (*.sfz)";
479            filters << tr("SF2 Instrument files") + " (*.sf2)";
480            filters << tr("All files") + " (*.*)";
481            const QString& filter = filters.join(";;");
482    
483          QString sInstrumentFile = QFileDialog::getOpenFileName(this,          QString sInstrumentFile = QFileDialog::getOpenFileName(this,
484                  QSAMPLER_TITLE ": " + tr("Instrument files"), // Caption.                  QSAMPLER_TITLE ": " + tr("Instrument files"), // Caption.
485                  pOptions->sInstrumentDir,                 // Start here.                  pOptions->sInstrumentDir, // Start here.
486                  tr("Instrument files") + " (*.gig *.dls)" // Filter (GIG and DLS files)                  filter                    // File filter.
487          );          );
488    
489          if (sInstrumentFile.isEmpty())          if (sInstrumentFile.isEmpty())
# Line 807  void ChannelForm::stabilizeForm (void) Line 814  void ChannelForm::stabilizeForm (void)
814          const QString& sPath = InstrumentFileComboBox->currentText();          const QString& sPath = InstrumentFileComboBox->currentText();
815          bValid = bValid && !sPath.isEmpty() && QFileInfo(sPath).exists();          bValid = bValid && !sPath.isEmpty() && QFileInfo(sPath).exists();
816  #endif  #endif
817          m_ui.OkPushButton->setEnabled(m_iDirtyCount > 0 && bValid);          m_ui.DialogButtonBox->button(
818                    QDialogButtonBox::Ok)->setEnabled(m_iDirtyCount > 0 && bValid);
819  }  }
820    
821    

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

  ViewVC Help
Powered by ViewVC