comparison 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
comparison
equal deleted inserted replaced
294:975f6b6c414c 295:75c32cc2814a
2569 { 2569 {
2570 if (pane) m_paneStack->setCurrentPane(pane); 2570 if (pane) m_paneStack->setCurrentPane(pane);
2571 2571
2572 for (QStringList::iterator i = uriList.begin(); i != uriList.end(); ++i) { 2572 for (QStringList::iterator i = uriList.begin(); i != uriList.end(); ++i) {
2573 2573
2574 FileOpenStatus status = open(*i, ReplaceCurrentPane); 2574 FileOpenStatus status;
2575
2576 if (i == uriList.begin()) {
2577 status = open(*i, ReplaceCurrentPane);
2578 } else {
2579 status = open(*i, CreateAdditionalModel);
2580 }
2575 2581
2576 if (status == FileOpenFailed) { 2582 if (status == FileOpenFailed) {
2577 emit hideSplash(); 2583 emit hideSplash();
2578 QMessageBox::critical(this, tr("Failed to open dropped URL"), 2584 QMessageBox::critical(this, tr("Failed to open dropped URL"),
2579 tr("<b>Open failed</b><p>Dropped URL \"%1\" could not be opened").arg(*i)); 2585 tr("<b>Open failed</b><p>Dropped URL \"%1\" could not be opened").arg(*i));
2586 break;
2580 } else if (status == FileOpenWrongMode) { 2587 } else if (status == FileOpenWrongMode) {
2581 emit hideSplash(); 2588 emit hideSplash();
2582 QMessageBox::critical(this, tr("Failed to open dropped URL"), 2589 QMessageBox::critical(this, tr("Failed to open dropped URL"),
2583 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)); 2590 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));
2591 break;
2592 } else if (status == FileOpenCancelled) {
2593 break;
2584 } 2594 }
2585 } 2595 }
2586 } 2596 }
2587 2597
2588 void 2598 void