Mercurial > hg > svapp
comparison framework/MainWindowBase.cpp @ 135:b742f579ced0
* Merge revisions 1131 to 1201 from sv-rdf-import branch
author | Chris Cannam |
---|---|
date | Thu, 18 Sep 2008 12:33:30 +0000 |
parents | b6dfdd99bd60 |
children | 2cf711ed89e2 |
comparison
equal
deleted
inserted
replaced
134:b6dfdd99bd60 | 135:b742f579ced0 |
---|---|
1062 } | 1062 } |
1063 | 1063 |
1064 MainWindowBase::FileOpenStatus | 1064 MainWindowBase::FileOpenStatus |
1065 MainWindowBase::openPlaylist(FileSource source, AudioFileOpenMode mode) | 1065 MainWindowBase::openPlaylist(FileSource source, AudioFileOpenMode mode) |
1066 { | 1066 { |
1067 std::cerr << "MainWindowBase::openPlaylist(" << source.getLocation().toStdString() << ")" << std::endl; | |
1068 | |
1067 std::set<QString> extensions; | 1069 std::set<QString> extensions; |
1068 PlaylistFileReader::getSupportedExtensions(extensions); | 1070 PlaylistFileReader::getSupportedExtensions(extensions); |
1069 QString extension = source.getExtension(); | 1071 QString extension = source.getExtension(); |
1070 if (extensions.find(extension) == extensions.end()) return FileOpenFailed; | 1072 if (extensions.find(extension) == extensions.end()) return FileOpenFailed; |
1071 | 1073 |
1101 } | 1103 } |
1102 | 1104 |
1103 MainWindowBase::FileOpenStatus | 1105 MainWindowBase::FileOpenStatus |
1104 MainWindowBase::openLayer(FileSource source) | 1106 MainWindowBase::openLayer(FileSource source) |
1105 { | 1107 { |
1108 std::cerr << "MainWindowBase::openLayer(" << source.getLocation().toStdString() << ")" << std::endl; | |
1109 | |
1106 Pane *pane = m_paneStack->getCurrentPane(); | 1110 Pane *pane = m_paneStack->getCurrentPane(); |
1107 | 1111 |
1108 if (!pane) { | 1112 if (!pane) { |
1109 // shouldn't happen, as the menu action should have been disabled | 1113 // shouldn't happen, as the menu action should have been disabled |
1110 std::cerr << "WARNING: MainWindowBase::openLayer: no current pane" << std::endl; | 1114 std::cerr << "WARNING: MainWindowBase::openLayer: no current pane" << std::endl; |
1126 source.getExtension() == "ttl") { | 1130 source.getExtension() == "ttl") { |
1127 | 1131 |
1128 RDFImporter importer("file://" + path, getMainModel()->getSampleRate()); | 1132 RDFImporter importer("file://" + path, getMainModel()->getSampleRate()); |
1129 if (importer.isOK()) { | 1133 if (importer.isOK()) { |
1130 | 1134 |
1131 ProgressDialog dialog(tr("Importing from RDF..."), true, 2000, this); | 1135 std::vector<Model *> models; |
1132 connect(&dialog, SIGNAL(showing()), this, SIGNAL(hideSplash())); | 1136 |
1133 std::vector<Model *> models = importer.getDataModels(&dialog); | 1137 { |
1138 ProgressDialog dialog(tr("Importing from RDF..."), true, 2000, this); | |
1139 connect(&dialog, SIGNAL(showing()), this, SIGNAL(hideSplash())); | |
1140 models = importer.getDataModels(&dialog); | |
1141 } | |
1142 | |
1143 if (models.empty()) { | |
1144 return FileOpenFailed; | |
1145 } | |
1134 | 1146 |
1135 for (int i = 0; i < models.size(); ++i) { | 1147 for (int i = 0; i < models.size(); ++i) { |
1136 Layer *newLayer = m_document->createImportedLayer(models[i]); | 1148 Layer *newLayer = m_document->createImportedLayer(models[i]); |
1137 if (newLayer) { | 1149 if (newLayer) { |
1138 m_document->addLayerToView(pane, newLayer); | 1150 m_document->addLayerToView(pane, newLayer); |
1237 } | 1249 } |
1238 | 1250 |
1239 MainWindowBase::FileOpenStatus | 1251 MainWindowBase::FileOpenStatus |
1240 MainWindowBase::openImage(FileSource source) | 1252 MainWindowBase::openImage(FileSource source) |
1241 { | 1253 { |
1254 std::cerr << "MainWindowBase::openImage(" << source.getLocation().toStdString() << ")" << std::endl; | |
1255 | |
1242 Pane *pane = m_paneStack->getCurrentPane(); | 1256 Pane *pane = m_paneStack->getCurrentPane(); |
1243 | 1257 |
1244 if (!pane) { | 1258 if (!pane) { |
1245 // shouldn't happen, as the menu action should have been disabled | 1259 // shouldn't happen, as the menu action should have been disabled |
1246 std::cerr << "WARNING: MainWindowBase::openImage: no current pane" << std::endl; | 1260 std::cerr << "WARNING: MainWindowBase::openImage: no current pane" << std::endl; |
1295 } | 1309 } |
1296 | 1310 |
1297 MainWindowBase::FileOpenStatus | 1311 MainWindowBase::FileOpenStatus |
1298 MainWindowBase::openSession(FileSource source) | 1312 MainWindowBase::openSession(FileSource source) |
1299 { | 1313 { |
1314 std::cerr << "MainWindowBase::openSession(" << source.getLocation().toStdString() << ")" << std::endl; | |
1315 | |
1300 if (!source.isAvailable()) return FileOpenFailed; | 1316 if (!source.isAvailable()) return FileOpenFailed; |
1301 if (source.getExtension() != "sv") return FileOpenFailed; | 1317 if (source.getExtension() != "sv") return FileOpenFailed; |
1302 source.waitForData(); | 1318 source.waitForData(); |
1303 | 1319 |
1304 BZipFileDevice bzFile(source.getLocalFilename()); | 1320 BZipFileDevice bzFile(source.getLocalFilename()); |