# HG changeset patch # User Chris Cannam # Date 1205227428 0 # Node ID 587c79827c690e14bb38d65a55ab3a74debdc819 # Parent a47d7116aedf95aca94760097407ac5e66e308cb * (failed) attempt to hide splash screen when error occurs on startup diff -r a47d7116aedf -r 587c79827c69 main/MainWindow.cpp --- a/main/MainWindow.cpp Wed Feb 20 15:57:18 2008 +0000 +++ b/main/MainWindow.cpp Tue Mar 11 09:23:48 2008 +0000 @@ -1974,6 +1974,7 @@ if (path != "") { if (openAudio(path, ReplaceMainModel) == FileOpenFailed) { + emit hideSplash(); QMessageBox::critical(this, tr("Failed to open file"), tr("File open failed
Audio file \"%1\" could not be opened").arg(path)); } @@ -1987,6 +1988,7 @@ if (path != "") { if (openAudio(path, CreateAdditionalModel) == FileOpenFailed) { + emit hideSplash(); QMessageBox::critical(this, tr("Failed to open file"), tr("File open failed
Audio file \"%1\" could not be opened").arg(path)); } @@ -2124,10 +2126,12 @@ FileOpenStatus status = openLayer(path); if (status == FileOpenFailed) { + emit hideSplash(); QMessageBox::critical(this, tr("Failed to open file"), tr("File open failed
Layer file %1 could not be opened.").arg(path)); return; } else if (status == FileOpenWrongMode) { + emit hideSplash(); QMessageBox::critical(this, tr("Failed to open file"), tr("Audio required
Please load at least one audio file before importing annotation data")); } @@ -2395,6 +2399,7 @@ if (path.isEmpty()) return; if (openSessionFile(path) == FileOpenFailed) { + emit hideSplash(); QMessageBox::critical(this, tr("Failed to open file"), tr("File open failed
Session file \"%1\" could not be opened").arg(path)); } @@ -2414,9 +2419,11 @@ FileOpenStatus status = open(path, AskUser); if (status == FileOpenFailed) { + emit hideSplash(); QMessageBox::critical(this, tr("Failed to open file"), tr("File open failed
File \"%1\" could not be opened").arg(path)); } else if (status == FileOpenWrongMode) { + emit hideSplash(); QMessageBox::critical(this, tr("Failed to open file"), tr("Audio required
Please load at least one audio file before importing annotation data")); } @@ -2444,9 +2451,11 @@ FileOpenStatus status = open(text); if (status == FileOpenFailed) { + emit hideSplash(); QMessageBox::critical(this, tr("Failed to open location"), tr("Open failed
URL \"%1\" could not be opened").arg(text)); } else if (status == FileOpenWrongMode) { + emit hideSplash(); QMessageBox::critical(this, tr("Failed to open location"), tr("Audio required
Please load at least one audio file before importing annotation data")); } @@ -2470,9 +2479,11 @@ FileOpenStatus status = open(path); if (status == FileOpenFailed) { + emit hideSplash(); QMessageBox::critical(this, tr("Failed to open location"), tr("Open failed
File or URL \"%1\" could not be opened").arg(path)); } else if (status == FileOpenWrongMode) { + emit hideSplash(); QMessageBox::critical(this, tr("Failed to open location"), tr("Audio required
Please load at least one audio file before importing annotation data")); } @@ -2506,9 +2517,11 @@ FileOpenStatus status = open(*i, ReplaceCurrentPane); if (status == FileOpenFailed) { + emit hideSplash(); QMessageBox::critical(this, tr("Failed to open dropped URL"), tr("Open failed
Dropped URL \"%1\" could not be opened").arg(*i)); } else if (status == FileOpenWrongMode) { + emit hideSplash(); QMessageBox::critical(this, tr("Failed to open dropped URL"), tr("Audio required
Please load at least one audio file before importing annotation data")); } @@ -2632,6 +2645,8 @@ if (!m_documentModified) return true; + emit hideSplash(); + int button = QMessageBox::warning(this, tr("Session modified"), @@ -3202,6 +3217,7 @@ bool willResample) { if (!willResample) { + emit hideSplash(); QMessageBox::information (this, tr("Sample rate mismatch"), tr("Wrong sample rate
The sample rate of this audio file (%1 Hz) does not match\nthe current playback rate (%2 Hz).
The file will play at the wrong speed and pitch.
Change the Resample mismatching files on import option under File -> Preferences if you want to alter this behaviour.") @@ -3299,6 +3315,8 @@ void MainWindow::modelGenerationFailed(QString transformName, QString message) { + emit hideSplash(); + if (message != "") { QMessageBox::warning @@ -3320,6 +3338,8 @@ void MainWindow::modelGenerationWarning(QString transformName, QString message) { + emit hideSplash(); + QMessageBox::warning (this, tr("Warning"), message, QMessageBox::Ok); } @@ -3328,6 +3348,8 @@ MainWindow::modelRegenerationFailed(QString layerName, QString transformName, QString message) { + emit hideSplash(); + if (message != "") { QMessageBox::warning @@ -3350,6 +3372,8 @@ MainWindow::modelRegenerationWarning(QString layerName, QString transformName, QString message) { + emit hideSplash(); + QMessageBox::warning (this, tr("Warning"), tr("Warning when regenerating layer
When regenerating the derived layer \"%1\" using new data model as input:
%2").arg(layerName).arg(message), QMessageBox::Ok); } @@ -3357,6 +3381,8 @@ void MainWindow::alignmentFailed(QString transformName, QString message) { + emit hideSplash(); + QMessageBox::warning (this, tr("Failed to calculate alignment"), diff -r a47d7116aedf -r 587c79827c69 main/main.cpp --- a/main/main.cpp Wed Feb 20 15:57:18 2008 +0000 +++ b/main/main.cpp Tue Mar 11 09:23:48 2008 +0000 @@ -285,6 +285,7 @@ MainWindow *gui = new MainWindow(audioOutput, oscSupport); application.setMainWindow(gui); + QObject::connect(gui, SIGNAL(hideSplash()), &splash, SLOT(hide())); QDesktopWidget *desktop = QApplication::desktop(); QRect available = desktop->availableGeometry();