comparison main/MainWindow.cpp @ 325:3903bd2c1cc4

* offer choice of audio files to export only if there is more than one
author Chris Cannam
date Thu, 23 Apr 2009 11:39:16 +0000
parents b23dddea4a35
children 4e612623bf08
comparison
equal deleted inserted replaced
324:b23dddea4a35 325:3903bd2c1cc4
2151 for (std::map<QString, RangeSummarisableTimeValueModel *> 2151 for (std::map<QString, RangeSummarisableTimeValueModel *>
2152 ::const_iterator i = m.begin(); 2152 ::const_iterator i = m.begin();
2153 i != m.end(); ++i) { 2153 i != m.end(); ++i) {
2154 items << i->first; 2154 items << i->first;
2155 } 2155 }
2156 bool ok = false; 2156 if (items.size() > 1) {
2157 QString item = QInputDialog::getItem 2157 bool ok = false;
2158 (this, tr("Select audio file to export"), 2158 QString item = QInputDialog::getItem
2159 tr("Which audio file do you want to export from?"), 2159 (this, tr("Select audio file to export"),
2160 items, c, false, &ok); 2160 tr("Which audio file do you want to export from?"),
2161 if (!ok || item.isEmpty()) return; 2161 items, c, false, &ok);
2162 if (m.find(item) == m.end()) { 2162 if (!ok || item.isEmpty()) return;
2163 cerr << "WARNING: Model " << item.toStdString() 2163 if (m.find(item) == m.end()) {
2164 << " not found in list!" << endl; 2164 cerr << "WARNING: Model " << item.toStdString()
2165 } else { 2165 << " not found in list!" << endl;
2166 model = m[item]; 2166 } else {
2167 model = m[item];
2168 }
2167 } 2169 }
2168 } 2170 }
2169 2171
2170 QString path = getSaveFileName(FileFinder::AudioFile); 2172 QString path = getSaveFileName(FileFinder::AudioFile);
2171 if (path == "") return; 2173 if (path == "") return;