237 |
|
|
238 |
// Do the edit dance... |
// Do the edit dance... |
239 |
InstrumentForm form(this); |
InstrumentForm form(this); |
240 |
form.setup(&instrument); |
form.setup(pInstrument); |
241 |
if (!form.exec()) |
if (!form.exec()) |
242 |
return; |
return; |
243 |
|
|
244 |
// Commit... |
// Commit... |
245 |
instrument.mapInstrument(); |
pInstrument->mapInstrument(); |
246 |
|
|
247 |
// Check whether we changed instrument key... |
// Check whether we changed instrument key... |
248 |
if (instrument.map() == iMap && |
if (pInstrument->map() == iMap && |
249 |
instrument.bank() == iBank && |
pInstrument->bank() == iBank && |
250 |
instrument.prog() == iProg) { |
pInstrument->prog() == iProg) { |
251 |
// Just update tree item... |
// Just update tree item... |
252 |
m_pInstrumentListView->updateInstrument(pInstrument); |
m_pInstrumentListView->updateInstrument(pInstrument); |
253 |
} else { |
} else { |
254 |
// Unmap old instance... |
// Unmap old instance... |
255 |
Instrument(iMap, iBank, iProg).unmapInstrument(); |
instrument.unmapInstrument(); |
256 |
// Correct the position of the instrument in the model |
// Correct the position of the instrument in the model |
257 |
m_pInstrumentListView->resortInstrument(pInstrument); |
m_pInstrumentListView->resortInstrument(pInstrument); |
258 |
} |
} |
292 |
|
|
293 |
pInstrument->unmapInstrument(); |
pInstrument->unmapInstrument(); |
294 |
|
|
295 |
// let the instrument vanish from the table model |
// Let the instrument vanish from the table model... |
296 |
m_pInstrumentListView->removeInstrument(pInstrument); |
m_pInstrumentListView->removeInstrument(pInstrument); |
297 |
|
|
298 |
stabilizeForm(); |
stabilizeForm(); |