comparison main/MainWindow.cpp @ 419:67941a9bb202 feature_150_menu_arrangement

Make openSomething always use ReplaceMainModel rather than AskUser (for #150)
author Chris Cannam
date Thu, 28 Apr 2011 15:12:32 +0100
parents af775c7b929b
children 5fdd59f8bff2
comparison
equal deleted inserted replaced
418:af775c7b929b 419:67941a9bb202
2675 2675
2676 QString path = getOpenFileName(FileFinder::AnyFile); 2676 QString path = getOpenFileName(FileFinder::AnyFile);
2677 2677
2678 if (path.isEmpty()) return; 2678 if (path.isEmpty()) return;
2679 2679
2680 FileOpenStatus status = open(path, AskUser); 2680 FileOpenStatus status = open(path, ReplaceMainModel);
2681 2681
2682 if (status == FileOpenFailed) { 2682 if (status == FileOpenFailed) {
2683 emit hideSplash(); 2683 emit hideSplash();
2684 QMessageBox::critical(this, tr("Failed to open file"), 2684 QMessageBox::critical(this, tr("Failed to open file"),
2685 tr("<b>File open failed</b><p>File \"%1\" could not be opened").arg(path)); 2685 tr("<b>File open failed</b><p>File \"%1\" could not be opened").arg(path));
2707 2707
2708 settings.setValue("lastremote", text); 2708 settings.setValue("lastremote", text);
2709 2709
2710 if (text.isEmpty()) return; 2710 if (text.isEmpty()) return;
2711 2711
2712 FileOpenStatus status = open(text); 2712 FileOpenStatus status = open(text, AskUser);
2713 2713
2714 if (status == FileOpenFailed) { 2714 if (status == FileOpenFailed) {
2715 emit hideSplash(); 2715 emit hideSplash();
2716 QMessageBox::critical(this, tr("Failed to open location"), 2716 QMessageBox::critical(this, tr("Failed to open location"),
2717 tr("<b>Open failed</b><p>URL \"%1\" could not be opened").arg(text)); 2717 tr("<b>Open failed</b><p>URL \"%1\" could not be opened").arg(text));
2735 } 2735 }
2736 2736
2737 QString path = action->text(); 2737 QString path = action->text();
2738 if (path == "") return; 2738 if (path == "") return;
2739 2739
2740 FileOpenStatus status = open(path); 2740 FileOpenStatus status = open(path, ReplaceMainModel);
2741 2741
2742 if (status == FileOpenFailed) { 2742 if (status == FileOpenFailed) {
2743 emit hideSplash(); 2743 emit hideSplash();
2744 QMessageBox::critical(this, tr("Failed to open location"), 2744 QMessageBox::critical(this, tr("Failed to open location"),
2745 tr("<b>Open failed</b><p>File or URL \"%1\" could not be opened").arg(path)); 2745 tr("<b>Open failed</b><p>File or URL \"%1\" could not be opened").arg(path));