--- qsampler/trunk/src/qsamplerMainForm.ui.h 2005/01/18 11:29:01 341 +++ qsampler/trunk/src/qsamplerMainForm.ui.h 2005/02/11 15:36:06 371 @@ -205,9 +205,6 @@ // We got options? m_pOptions = pOptions; - // Set initial instrument name display mode. - qsamplerChannel::setInstrumentNames(m_pOptions->bInstrumentNames); - // Some child forms are to be created right now. m_pMessages = new qsamplerMessages(this); // Set message defaults... @@ -559,15 +556,15 @@ if (piChannelIDs == NULL) { appendMessagesClient("lscp_list_channels"); appendMessagesError(tr("Could not get current list of channels.\n\nSorry.")); - } - - // Try to (re)create each channel. - m_pWorkspace->setUpdatesEnabled(false); - for (int iChannel = 0; piChannelIDs[iChannel] >= 0; iChannel++) { - createChannelStrip(new qsamplerChannel(this, piChannelIDs[iChannel])); - QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); - } - m_pWorkspace->setUpdatesEnabled(true); + } else { + // Try to (re)create each channel. + m_pWorkspace->setUpdatesEnabled(false); + for (int iChannel = 0; piChannelIDs[iChannel] >= 0; iChannel++) { + createChannelStrip(new qsamplerChannel(this, piChannelIDs[iChannel])); + QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); + } + m_pWorkspace->setUpdatesEnabled(true); + } // Save as default session directory. if (m_pOptions) @@ -962,8 +959,8 @@ int bOldMessagesLimit = m_pOptions->bMessagesLimit; int iOldMessagesLimitLines = m_pOptions->iMessagesLimitLines; bool bOldCompletePath = m_pOptions->bCompletePath; - int iOldMaxRecentFiles = m_pOptions->iMaxRecentFiles; bool bOldInstrumentNames = m_pOptions->bInstrumentNames; + int iOldMaxRecentFiles = m_pOptions->iMaxRecentFiles; // Load the current setup settings. pOptionsForm->setup(m_pOptions); // Show the setup dialog... @@ -977,13 +974,13 @@ updateMessagesCapture(); } // Check wheather something immediate has changed. - if (( bOldInstrumentNames && !m_pOptions->bInstrumentNames) || - (!bOldInstrumentNames && m_pOptions->bInstrumentNames)) - qsamplerChannel::setInstrumentNames(m_pOptions->bInstrumentNames); if (( bOldCompletePath && !m_pOptions->bCompletePath) || (!bOldCompletePath && m_pOptions->bCompletePath) || (iOldMaxRecentFiles != m_pOptions->iMaxRecentFiles)) updateRecentFilesMenu(); + if (( bOldInstrumentNames && !m_pOptions->bInstrumentNames) || + (!bOldInstrumentNames && m_pOptions->bInstrumentNames)) + updateInstrumentNames(); if (( bOldDisplayEffect && !m_pOptions->bDisplayEffect) || (!bOldDisplayEffect && m_pOptions->bDisplayEffect)) updateDisplayEffect(); @@ -1227,6 +1224,24 @@ } +// Force update of the channels instrument names mode. +void qsamplerMainForm::updateInstrumentNames (void) +{ + // Full channel list update... + QWidgetList wlist = m_pWorkspace->windowList(); + if (wlist.isEmpty()) + return; + + m_pWorkspace->setUpdatesEnabled(false); + for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { + qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel); + if (pChannelStrip) + pChannelStrip->updateInstrumentName(true); + } + m_pWorkspace->setUpdatesEnabled(true); +} + + // Force update of the channels display font. void qsamplerMainForm::updateDisplayFont (void) {