mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 01:55:48 -05:00
APT Demod: Check filename suffix is specified
This commit is contained in:
parent
97193ef34d
commit
b9079e005b
@ -503,12 +503,21 @@ void APTDemodGUI::on_saveImage_clicked()
|
||||
{
|
||||
QStringList fileNames = fileDialog.selectedFiles();
|
||||
if (fileNames.size() > 0)
|
||||
{
|
||||
QFileInfo fileInfo(fileNames[0]);
|
||||
|
||||
if (fileInfo.suffix() != "")
|
||||
{
|
||||
qDebug() << "APT: Saving image to " << fileNames;
|
||||
if (!m_image.save(fileNames[0])) {
|
||||
QMessageBox::critical(this, "APT Demodulator", QString("Failed to save image to %1").arg(fileNames[0]));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::critical(this, "APT Demodulator", QString("Please specify a filename with an extension such as .png or .jpg"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user