Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 844:ce4d9e149086
Use openPath instead of open() when opening local file or URL (for progress indicator). I think I didn't realise this distinction between the two functions, which formerly were both named open().
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 16:33:52 +0100 |
parents | b17b7ec4a31e |
children | 4a7c62938a13 c62c3e4825ee |
comparison
equal
deleted
inserted
replaced
843:d12d4c11a55b | 844:ce4d9e149086 |
---|---|
2966 | 2966 |
2967 QString path = getOpenFileName(FileFinder::AnyFile); | 2967 QString path = getOpenFileName(FileFinder::AnyFile); |
2968 | 2968 |
2969 if (path.isEmpty()) return; | 2969 if (path.isEmpty()) return; |
2970 | 2970 |
2971 FileOpenStatus status = open(path, ReplaceSession); | 2971 FileOpenStatus status = openPath(path, ReplaceSession); |
2972 | 2972 |
2973 if (status == FileOpenFailed) { | 2973 if (status == FileOpenFailed) { |
2974 emit hideSplash(); | 2974 emit hideSplash(); |
2975 QMessageBox::critical(this, tr("Failed to open file"), | 2975 QMessageBox::critical(this, tr("Failed to open file"), |
2976 tr("<b>File open failed</b><p>File \"%1\" could not be opened").arg(path)); | 2976 tr("<b>File open failed</b><p>File \"%1\" could not be opened").arg(path)); |
2998 | 2998 |
2999 settings.setValue("lastremote", text); | 2999 settings.setValue("lastremote", text); |
3000 | 3000 |
3001 if (text.isEmpty()) return; | 3001 if (text.isEmpty()) return; |
3002 | 3002 |
3003 FileOpenStatus status = open(text, AskUser); | 3003 FileOpenStatus status = openPath(text, AskUser); |
3004 | 3004 |
3005 if (status == FileOpenFailed) { | 3005 if (status == FileOpenFailed) { |
3006 emit hideSplash(); | 3006 emit hideSplash(); |
3007 QMessageBox::critical(this, tr("Failed to open location"), | 3007 QMessageBox::critical(this, tr("Failed to open location"), |
3008 tr("<b>Open failed</b><p>URL \"%1\" could not be opened").arg(text)); | 3008 tr("<b>Open failed</b><p>URL \"%1\" could not be opened").arg(text)); |
3026 } | 3026 } |
3027 | 3027 |
3028 QString path = action->text(); | 3028 QString path = action->text(); |
3029 if (path == "") return; | 3029 if (path == "") return; |
3030 | 3030 |
3031 FileOpenStatus status = open(path, ReplaceSession); | 3031 FileOpenStatus status = openPath(path, ReplaceSession); |
3032 | 3032 |
3033 if (status == FileOpenFailed) { | 3033 if (status == FileOpenFailed) { |
3034 emit hideSplash(); | 3034 emit hideSplash(); |
3035 QMessageBox::critical(this, tr("Failed to open location"), | 3035 QMessageBox::critical(this, tr("Failed to open location"), |
3036 tr("<b>Open failed</b><p>File or URL \"%1\" could not be opened").arg(path)); | 3036 tr("<b>Open failed</b><p>File or URL \"%1\" could not be opened").arg(path)); |
3154 for (QStringList::iterator i = uriList.begin(); i != uriList.end(); ++i) { | 3154 for (QStringList::iterator i = uriList.begin(); i != uriList.end(); ++i) { |
3155 | 3155 |
3156 FileOpenStatus status; | 3156 FileOpenStatus status; |
3157 | 3157 |
3158 if (i == uriList.begin()) { | 3158 if (i == uriList.begin()) { |
3159 status = open(*i, ReplaceCurrentPane); | 3159 status = openPath(*i, ReplaceCurrentPane); |
3160 } else { | 3160 } else { |
3161 status = open(*i, CreateAdditionalModel); | 3161 status = openPath(*i, CreateAdditionalModel); |
3162 } | 3162 } |
3163 | 3163 |
3164 if (status == FileOpenFailed) { | 3164 if (status == FileOpenFailed) { |
3165 emit hideSplash(); | 3165 emit hideSplash(); |
3166 QMessageBox::critical(this, tr("Failed to open dropped URL"), | 3166 QMessageBox::critical(this, tr("Failed to open dropped URL"), |