/[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 1558 by capela, Thu Dec 6 09:35:33 2007 UTC revision 2069 by capela, Mon Mar 15 10:45:35 2010 UTC
# Line 1  Line 1 
1  // qsamplerInstrumentForm.cpp  // qsamplerInstrumentForm.cpp
2  //  //
3  /****************************************************************************  /****************************************************************************
4     Copyright (C) 2003-2007, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2003-2010, rncbc aka Rui Nuno Capela. All rights reserved.
5     Copyright (C) 2007, Christian Schoenebeck     Copyright (C) 2007, Christian Schoenebeck
6    
7     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
# Line 50  namespace QSampler { Line 50  namespace QSampler {
50  // QSampler::InstrumentForm -- Instrument map item form implementation.  // QSampler::InstrumentForm -- Instrument map item form implementation.
51  //  //
52    
53  InstrumentForm::InstrumentForm ( QWidget* pParent )  InstrumentForm::InstrumentForm ( QWidget *pParent )
54          : QDialog(pParent)          : QDialog(pParent)
55  {  {
56          m_ui.setupUi(this);          m_ui.setupUi(this);
# Line 230  void InstrumentForm::setup ( Instrument Line 230  void InstrumentForm::setup ( Instrument
230          // Done.          // Done.
231          m_iDirtySetup--;          m_iDirtySetup--;
232          stabilizeForm();          stabilizeForm();
   
         // Done.  
         m_iDirtySetup--;  
         stabilizeForm();  
233  }  }
234    
235    
# Line 369  void InstrumentForm::reject (void) Line 365  void InstrumentForm::reject (void)
365                          QSAMPLER_TITLE ": " + tr("Warning"),                          QSAMPLER_TITLE ": " + tr("Warning"),
366                          tr("Some channel settings have been changed.\n\n"                          tr("Some channel settings have been changed.\n\n"
367                          "Do you want to apply the changes?"),                          "Do you want to apply the changes?"),
368                          tr("Apply"), tr("Discard"), tr("Cancel"))) {                          QMessageBox::Apply |
369                  case 0:     // Apply...                          QMessageBox::Discard |
370                            QMessageBox::Cancel)) {
371                    case QMessageBox::Apply:
372                          accept();                          accept();
373                          return;                          return;
374                  case 1:     // Discard                  case QMessageBox::Discard:
375                          break;                          break;
376                  default:    // Cancel.                  default:    // Cancel.
377                          bReject = false;                          bReject = false;
# Line 400  void InstrumentForm::changed (void) Line 398  void InstrumentForm::changed (void)
398  // Stabilize current form state.  // Stabilize current form state.
399  void InstrumentForm::stabilizeForm (void)  void InstrumentForm::stabilizeForm (void)
400  {  {
401          bool bValid =          bool bValid = !m_ui.NameLineEdit->text().isEmpty()
402                  !m_ui.NameLineEdit->text().isEmpty() &&                  && m_ui.EngineNameComboBox->currentIndex() >= 0
403                  m_ui.EngineNameComboBox->currentIndex() >= 0 &&                  && m_ui.EngineNameComboBox->currentText() != Channel::noEngineName();
                 m_ui.EngineNameComboBox->currentText() !=  
                 Channel::noEngineName();  
404    
405          const QString& sPath = m_ui.InstrumentFileComboBox->currentText();          const QString& sPath = m_ui.InstrumentFileComboBox->currentText();
406          bValid = bValid && !sPath.isEmpty() && QFileInfo(sPath).exists();          bValid = bValid && !sPath.isEmpty() && QFileInfo(sPath).exists();

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

  ViewVC Help
Powered by ViewVC