# HG changeset patch # User Chris Cannam # Date 1240486756 0 # Node ID 3903bd2c1cc409e4de8388b464c23a0b99b3d12e # Parent b23dddea4a35e265da5f8c24455cf46961b06d63 * offer choice of audio files to export only if there is more than one diff -r b23dddea4a35 -r 3903bd2c1cc4 main/MainWindow.cpp --- a/main/MainWindow.cpp Mon Mar 30 13:47:00 2009 +0000 +++ b/main/MainWindow.cpp Thu Apr 23 11:39:16 2009 +0000 @@ -2153,17 +2153,19 @@ i != m.end(); ++i) { items << i->first; } - bool ok = false; - QString item = QInputDialog::getItem - (this, tr("Select audio file to export"), - tr("Which audio file do you want to export from?"), - items, c, false, &ok); - if (!ok || item.isEmpty()) return; - if (m.find(item) == m.end()) { - cerr << "WARNING: Model " << item.toStdString() - << " not found in list!" << endl; - } else { - model = m[item]; + if (items.size() > 1) { + bool ok = false; + QString item = QInputDialog::getItem + (this, tr("Select audio file to export"), + tr("Which audio file do you want to export from?"), + items, c, false, &ok); + if (!ok || item.isEmpty()) return; + if (m.find(item) == m.end()) { + cerr << "WARNING: Model " << item.toStdString() + << " not found in list!" << endl; + } else { + model = m[item]; + } } }