diff main/MainWindow.cpp @ 295:75c32cc2814a

* Attempt to be a bit more useful when dropping multiple files on window
author Chris Cannam
date Fri, 12 Dec 2008 15:20:09 +0000
parents 975f6b6c414c
children f68506fccb62
line wrap: on
line diff
--- a/main/MainWindow.cpp	Fri Dec 05 18:45:49 2008 +0000
+++ b/main/MainWindow.cpp	Fri Dec 12 15:20:09 2008 +0000
@@ -2571,16 +2571,26 @@
 
     for (QStringList::iterator i = uriList.begin(); i != uriList.end(); ++i) {
 
-        FileOpenStatus status = open(*i, ReplaceCurrentPane);
+        FileOpenStatus status;
+
+        if (i == uriList.begin()) {
+            status = open(*i, ReplaceCurrentPane);
+        } else {
+            status = open(*i, CreateAdditionalModel);
+        }
 
         if (status == FileOpenFailed) {
             emit hideSplash();
             QMessageBox::critical(this, tr("Failed to open dropped URL"),
                                   tr("<b>Open failed</b><p>Dropped URL \"%1\" could not be opened").arg(*i));
+            break;
         } else if (status == FileOpenWrongMode) {
             emit hideSplash();
             QMessageBox::critical(this, tr("Failed to open dropped URL"),
                                   tr("<b>Audio required</b><p>Unable to load layer data from \"%1\" without an audio file.<br>Please load at least one audio file before importing annotations.").arg(*i));
+            break;
+        } else if (status == FileOpenCancelled) {
+            break;
         }
     }
 }