Mercurial > hg > svgui
comparison widgets/FileFinder.cpp @ 460:5f9a257598d8
* Ensure text models are exported with text properties in RDF, and
imported back into text models again (instead of time/value models)
author | Chris Cannam |
---|---|
date | Mon, 08 Dec 2008 11:53:10 +0000 |
parents | e75f15c9ea11 |
children |
comparison
equal
deleted
inserted
replaced
459:0acf803e2c79 | 460:5f9a257598d8 |
---|---|
151 QFileInfo fi(path); | 151 QFileInfo fi(path); |
152 | 152 |
153 if (!fi.exists()) { | 153 if (!fi.exists()) { |
154 | 154 |
155 QMessageBox::critical(0, tr("File does not exist"), | 155 QMessageBox::critical(0, tr("File does not exist"), |
156 tr("File \"%1\" does not exist").arg(path)); | 156 tr("<b>File not found</b><p>File \"%1\" does not exist").arg(path)); |
157 path = ""; | 157 path = ""; |
158 | 158 |
159 } else if (!fi.isReadable()) { | 159 } else if (!fi.isReadable()) { |
160 | 160 |
161 QMessageBox::critical(0, tr("File is not readable"), | 161 QMessageBox::critical(0, tr("File is not readable"), |
162 tr("File \"%1\" can not be read").arg(path)); | 162 tr("<b>File is not readable</b><p>File \"%1\" can not be read").arg(path)); |
163 path = ""; | 163 path = ""; |
164 | 164 |
165 } else if (fi.isDir()) { | 165 } else if (fi.isDir()) { |
166 | 166 |
167 QMessageBox::critical(0, tr("Directory selected"), | 167 QMessageBox::critical(0, tr("Directory selected"), |
168 tr("File \"%1\" is a directory").arg(path)); | 168 tr("<b>Directory selected</b><p>File \"%1\" is a directory").arg(path)); |
169 path = ""; | 169 path = ""; |
170 | 170 |
171 } else if (!fi.isFile()) { | 171 } else if (!fi.isFile()) { |
172 | 172 |
173 QMessageBox::critical(0, tr("Non-file selected"), | 173 QMessageBox::critical(0, tr("Non-file selected"), |
174 tr("Path \"%1\" is not a file").arg(path)); | 174 tr("<b>Not a file</b><p>Path \"%1\" is not a file").arg(path)); |
175 path = ""; | 175 path = ""; |
176 | 176 |
177 } else if (fi.size() == 0) { | 177 } else if (fi.size() == 0) { |
178 | 178 |
179 QMessageBox::critical(0, tr("File is empty"), | 179 QMessageBox::critical(0, tr("File is empty"), |
180 tr("File \"%1\" is empty").arg(path)); | 180 tr("<b>File is empty</b><p>File \"%1\" is empty").arg(path)); |
181 path = ""; | 181 path = ""; |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
185 if (path != "") { | 185 if (path != "") { |
315 } | 315 } |
316 } | 316 } |
317 | 317 |
318 if (fi.isDir()) { | 318 if (fi.isDir()) { |
319 QMessageBox::critical(0, tr("Directory selected"), | 319 QMessageBox::critical(0, tr("Directory selected"), |
320 tr("File \"%1\" is a directory").arg(path)); | 320 tr("<b>Directory selected</b><p>File \"%1\" is a directory").arg(path)); |
321 continue; | 321 continue; |
322 } | 322 } |
323 | 323 |
324 if (fi.exists()) { | 324 if (fi.exists()) { |
325 if (QMessageBox::question(0, tr("File exists"), | 325 if (QMessageBox::question(0, tr("File exists"), |
326 tr("The file \"%1\" already exists.\nDo you want to overwrite it?").arg(path), | 326 tr("<b>File exists</b><p>The file \"%1\" already exists.\nDo you want to overwrite it?").arg(path), |
327 QMessageBox::Ok, | 327 QMessageBox::Ok, |
328 QMessageBox::Cancel) != QMessageBox::Ok) { | 328 QMessageBox::Cancel) != QMessageBox::Ok) { |
329 continue; | 329 continue; |
330 } | 330 } |
331 } | 331 } |
453 QString | 453 QString |
454 FileFinder::locateInteractive(FileType type, QString thing) | 454 FileFinder::locateInteractive(FileType type, QString thing) |
455 { | 455 { |
456 QString question; | 456 QString question; |
457 if (type == AudioFile) { | 457 if (type == AudioFile) { |
458 question = tr("Audio file \"%1\" could not be opened.\nDo you want to locate it?"); | 458 question = tr("<b>File not found</b><p>Audio file \"%1\" could not be opened.\nDo you want to locate it?"); |
459 } else { | 459 } else { |
460 question = tr("File \"%1\" could not be opened.\nDo you want to locate it?"); | 460 question = tr("<b>File not found</b><p>File \"%1\" could not be opened.\nDo you want to locate it?"); |
461 } | 461 } |
462 | 462 |
463 QString path = ""; | 463 QString path = ""; |
464 bool done = false; | 464 bool done = false; |
465 | 465 |
498 if (FileSource(path).isAvailable()) { | 498 if (FileSource(path).isAvailable()) { |
499 done = true; | 499 done = true; |
500 } else { | 500 } else { |
501 QMessageBox::critical | 501 QMessageBox::critical |
502 (0, tr("Failed to open location"), | 502 (0, tr("Failed to open location"), |
503 tr("URL \"%1\" could not be opened").arg(path)); | 503 tr("<b>Failed to open location</b><p>URL \"%1\" could not be opened").arg(path)); |
504 path = ""; | 504 path = ""; |
505 } | 505 } |
506 } | 506 } |
507 break; | 507 break; |
508 } | 508 } |