changeset 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 2af190472b32
files main/MainWindow.cpp
diffstat 1 files changed, 13 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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];
+            }
         }
     }