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

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

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

revision 1492 by schoenebeck, Mon Nov 19 21:08:18 2007 UTC revision 1499 by capela, Tue Nov 20 16:48:04 2007 UTC
# Line 27  Line 27 
27  #include "qsamplerOptions.h"  #include "qsamplerOptions.h"
28  #include "qsamplerInstrument.h"  #include "qsamplerInstrument.h"
29    
 #include <QToolTip>  
30    
31  namespace QSampler {  namespace QSampler {
32    
# Line 49  InstrumentListForm::InstrumentListForm ( Line 48  InstrumentListForm::InstrumentListForm (
48      m_pMapComboBox = new QComboBox(ui.InstrumentToolbar);      m_pMapComboBox = new QComboBox(ui.InstrumentToolbar);
49      m_pMapComboBox->setMinimumWidth(120);      m_pMapComboBox->setMinimumWidth(120);
50      m_pMapComboBox->setEnabled(false);      m_pMapComboBox->setEnabled(false);
51      QToolTip::add(m_pMapComboBox, tr("Instrument Map"));      m_pMapComboBox->setToolTip(tr("Instrument Map"));
52      ui.InstrumentToolbar->addWidget(m_pMapComboBox);      ui.InstrumentToolbar->addWidget(m_pMapComboBox);
53    
54      ui.InstrumentToolbar->addSeparator();      ui.InstrumentToolbar->addSeparator();
55      ui.newInstrumentAction->addTo(ui.InstrumentToolbar);      ui.InstrumentToolbar->addAction(ui.newInstrumentAction);
56      ui.editInstrumentAction->addTo(ui.InstrumentToolbar);      ui.InstrumentToolbar->addAction(ui.editInstrumentAction);
57      ui.deleteInstrumentAction->addTo(ui.InstrumentToolbar);      ui.InstrumentToolbar->addAction(ui.deleteInstrumentAction);
58      ui.InstrumentToolbar->addSeparator();      ui.InstrumentToolbar->addSeparator();
59      ui.refreshInstrumentsAction->addTo(ui.InstrumentToolbar);      ui.InstrumentToolbar->addAction(ui.refreshInstrumentsAction);
60    
61      ui.InstrumentTable->setModel(&model);      ui.InstrumentTable->setModel(&model);
62      ui.InstrumentTable->setItemDelegate(&delegate);      ui.InstrumentTable->setItemDelegate(&delegate);
# Line 133  void InstrumentListForm::refreshInstrume Line 132  void InstrumentListForm::refreshInstrume
132                  return;                  return;
133    
134          // Get/save current map selection...          // Get/save current map selection...
135          int iMap = m_pMapComboBox->currentItem();          int iMap = m_pMapComboBox->currentIndex();
136          if (iMap < 0 || m_pMapComboBox->count() < 2)          if (iMap < 0 || m_pMapComboBox->count() < 2)
137                  iMap = pOptions->iMidiMap + 1;                  iMap = pOptions->iMidiMap + 1;
138    
139          // Populate maps list.          // Populate maps list.
140          m_pMapComboBox->clear();          m_pMapComboBox->clear();
141          m_pMapComboBox->insertItem(tr("(All)"));          m_pMapComboBox->addItem(tr("(All)"));
142          m_pMapComboBox->insertStringList(qsamplerInstrument::getMapNames());          m_pMapComboBox->insertItems(1, qsamplerInstrument::getMapNames());
143    
144          // Adjust to saved selection...          // Adjust to saved selection...
145          if (iMap < 0 || iMap >= m_pMapComboBox->count())          if (iMap < 0 || iMap >= m_pMapComboBox->count())
146                  iMap = 0;                  iMap = 0;
147          m_pMapComboBox->setCurrentItem(iMap);          m_pMapComboBox->setCurrentIndex(iMap);
148          m_pMapComboBox->setEnabled(m_pMapComboBox->count() > 1);          m_pMapComboBox->setEnabled(m_pMapComboBox->count() > 1);
149    
150          activateMap(iMap);          activateMap(iMap);

Legend:
Removed from v.1492  
changed lines
  Added in v.1499

  ViewVC Help
Powered by ViewVC