SampleBuffer: do not show messagebox if there's no GUI
Showing a messagebox if LMMS is running in console-mode only is bad and makes it crash. Therefore check for engine::hasGUI() first.
This commit is contained in:
@@ -277,14 +277,17 @@ void sampleBuffer::update( bool _keep_settings )
|
||||
|
||||
// TODO: this list probably shouldn't be hardcoded
|
||||
QString decoders = niceListOfExts();
|
||||
QMessageBox::information( NULL,
|
||||
QObject::tr( "Unrecognized audio format" ),
|
||||
QObject::tr( "None of the available audio decoders "
|
||||
"recognized the format you are trying to load. Try "
|
||||
"converting the file to a format LMMS understands.\n\n"
|
||||
"Your file: %1\n"
|
||||
"Available decoders: %2\n").arg( file, decoders ),
|
||||
QMessageBox::Ok | QMessageBox::Default );
|
||||
if( engine::hasGUI() )
|
||||
{
|
||||
QMessageBox::information( NULL,
|
||||
QObject::tr( "Unrecognized audio format" ),
|
||||
QObject::tr( "None of the available audio decoders "
|
||||
"recognized the format you are trying to load. Try "
|
||||
"converting the file to a format LMMS understands.\n\n"
|
||||
"Your file: %1\n"
|
||||
"Available decoders: %2\n").arg( file, decoders ),
|
||||
QMessageBox::Ok | QMessageBox::Default );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user