Browse Source

Add MessageDialog and use it in place of the QMessageBox static functions

QMessageBox::information() and friends build the box on the stack, parent
it to the calling widget and run a nested event loop in exec(). If the
parent is closed while the box is open, which the Web API can do at any
time, the parent deletes the box and its children and the heap is
corrupted.

MessageDialog offers the same calls, but the box is heap allocated, given
Qt::WA_DeleteOnClose and shown rather than exec'd, so nothing runs a
nested event loop and the box owns its own lifetime. A box with the same
text as one already up is raised instead of a second being created.

The trade off is that information(), warning() and critical() return
immediately and cannot report which button was pressed. question() takes
a callback for the cases that need the answer.

Converts the call sites in the device, channel and feature GUIs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
chirpmodem-v8.0.0
Jon Beniston 2 months ago
parent
commit
ddedd59568
  1. 7
      plugins/channelrx/demodadsb/adsbdemodgui.cpp
  2. 5
      plugins/channelrx/demodais/aisdemodgui.cpp
  3. 5
      plugins/channelrx/demodapt/aptdemodgui.cpp
  4. 5
      plugins/channelrx/demoddsc/dscdemodgui.cpp
  5. 4
      plugins/channelrx/demoddsd/dsdstatustextdialog.cpp
  6. 5
      plugins/channelrx/demodendoftrain/endoftraindemodgui.cpp
  7. 5
      plugins/channelrx/demodinmarsat/inmarsatdemodgui.cpp
  8. 4
      plugins/channelrx/demodm17/m17statustextdialog.cpp
  9. 4
      plugins/channelrx/demodmeshcore/meshcorekeysdialog.cpp
  10. 4
      plugins/channelrx/demodmeshtastic/meshtastickeysdialog.cpp
  11. 5
      plugins/channelrx/demodnavtex/navtexdemodgui.cpp
  12. 5
      plugins/channelrx/demodpacket/packetdemodgui.cpp
  13. 5
      plugins/channelrx/demodpager/pagerdemodgui.cpp
  14. 5
      plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp
  15. 3
      plugins/channelrx/demodvormc/vordemodmcgui.cpp
  16. 3
      plugins/channelrx/filesink/filesinkgui.cpp
  17. 7
      plugins/channelrx/freqscanner/freqscannergui.cpp
  18. 17
      plugins/channelrx/heatmap/heatmapgui.cpp
  19. 9
      plugins/channelrx/noisefigure/noisefiguregui.cpp
  20. 17
      plugins/channelrx/radioastronomy/radioastronomygui.cpp
  21. 3
      plugins/channelrx/remotetcpsink/remotetcpsinkgui.cpp
  22. 1
      plugins/feature/aprs/aprsgui.cpp
  23. 4
      plugins/feature/map/mapbeacondialog.cpp
  24. 6
      plugins/feature/map/mapsettingsdialog.cpp
  25. 6
      plugins/feature/remotecontrol/remotecontroldevicedialog.cpp
  26. 3
      plugins/feature/remotecontrol/remotecontrolgui.cpp
  27. 3
      plugins/feature/satellitetracker/satellitetrackergui.cpp
  28. 15
      plugins/feature/sid/sidgui.cpp
  29. 5
      plugins/feature/startracker/startrackergui.cpp
  30. 3
      plugins/feature/vorlocalizer/vorlocalizergui.cpp
  31. 3
      plugins/samplemimo/audiocatsiso/audiocatsisogui.cpp
  32. 5
      plugins/samplemimo/bladerf2mimo/bladerf2mimogui.cpp
  33. 5
      plugins/samplemimo/limesdrmimo/limesdrmimogui.cpp
  34. 3
      plugins/samplemimo/metismiso/metismisogui.cpp
  35. 5
      plugins/samplemimo/plutosdrmimo/plutosdrmimogui.cpp
  36. 3
      plugins/samplemimo/testmi/testmigui.cpp
  37. 3
      plugins/samplemimo/testmosync/testmosyncgui.cpp
  38. 5
      plugins/samplemimo/xtrxmimo/xtrxmimogui.cpp
  39. 3
      plugins/samplesink/aaroniartsaoutput/aaroniartsaoutputgui.cpp
  40. 3
      plugins/samplesink/bladerf1output/bladerf1outputgui.cpp
  41. 3
      plugins/samplesink/bladerf2output/bladerf2outputgui.cpp
  42. 3
      plugins/samplesink/fileoutput/fileoutputgui.cpp
  43. 3
      plugins/samplesink/hackrfoutput/hackrfoutputgui.cpp
  44. 3
      plugins/samplesink/limesdroutput/limesdroutputgui.cpp
  45. 3
      plugins/samplesink/localoutput/localoutputgui.cpp
  46. 3
      plugins/samplesink/plutosdroutput/plutosdroutputgui.cpp
  47. 3
      plugins/samplesink/remoteoutput/remoteoutputgui.cpp
  48. 3
      plugins/samplesink/soapysdroutput/soapysdroutputgui.cpp
  49. 3
      plugins/samplesink/testsink/testsinkgui.cpp
  50. 3
      plugins/samplesink/usrpoutput/usrpoutputgui.cpp
  51. 3
      plugins/samplesink/xtrxoutput/xtrxoutputgui.cpp
  52. 3
      plugins/samplesource/aaroniartsainput/aaroniartsainputgui.cpp
  53. 3
      plugins/samplesource/airspy/airspygui.cpp
  54. 3
      plugins/samplesource/airspyhf/airspyhfgui.cpp
  55. 3
      plugins/samplesource/androidsdrdriverinput/androidsdrdriverinputgui.cpp
  56. 3
      plugins/samplesource/audioinput/audioinputgui.cpp
  57. 3
      plugins/samplesource/bladerf1input/bladerf1inputgui.cpp
  58. 3
      plugins/samplesource/bladerf2input/bladerf2inputgui.cpp
  59. 3
      plugins/samplesource/fcdpro/fcdprogui.cpp
  60. 3
      plugins/samplesource/fcdproplus/fcdproplusgui.cpp
  61. 3
      plugins/samplesource/fileinput/fileinputgui.cpp
  62. 3
      plugins/samplesource/fobos/fobosgui.cpp
  63. 3
      plugins/samplesource/hackrfinput/hackrfinputgui.cpp
  64. 3
      plugins/samplesource/kiwisdr/kiwisdrgui.cpp
  65. 3
      plugins/samplesource/limesdrinput/limesdrinputgui.cpp
  66. 3
      plugins/samplesource/localinput/localinputgui.cpp
  67. 3
      plugins/samplesource/perseus/perseusgui.cpp
  68. 3
      plugins/samplesource/plutosdrinput/plutosdrinputgui.cpp
  69. 3
      plugins/samplesource/remoteinput/remoteinputgui.cpp
  70. 3
      plugins/samplesource/remotetcpinput/remotetcpinputgui.cpp
  71. 3
      plugins/samplesource/rtlsdr/rtlsdrgui.cpp
  72. 3
      plugins/samplesource/sdrplay/sdrplaygui.cpp
  73. 3
      plugins/samplesource/sdrplayv3/sdrplayv3gui.cpp
  74. 3
      plugins/samplesource/sigmffileinput/sigmffileinputgui.cpp
  75. 3
      plugins/samplesource/soapysdrinput/soapysdrinputgui.cpp
  76. 3
      plugins/samplesource/testsource/testsourcegui.cpp
  77. 3
      plugins/samplesource/usrpinput/usrpinputgui.cpp
  78. 3
      plugins/samplesource/xtrxinput/xtrxinputgui.cpp
  79. 2
      sdrgui/CMakeLists.txt
  80. 2
      sdrgui/feature/featuregui.cpp
  81. 73
      sdrgui/gui/messagedialog.cpp
  82. 61
      sdrgui/gui/messagedialog.h

7
plugins/channelrx/demodadsb/adsbdemodgui.cpp

@ -50,6 +50,7 @@ @@ -50,6 +50,7 @@
#include "util/units.h"
#include "util/morse.h"
#include "util/profiler.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/crightclickenabler.h"
#include "gui/clickablelabel.h"
@ -8086,7 +8087,7 @@ void ADSBDemodGUI::on_logOpen_clicked() @@ -8086,7 +8087,7 @@ void ADSBDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "ADS-B", error);
MessageDialog::critical(this, "ADS-B", error);
}
ui->adsbData->blockSignals(false);
m_loadingData = false;
@ -8098,7 +8099,7 @@ void ADSBDemodGUI::on_logOpen_clicked() @@ -8098,7 +8099,7 @@ void ADSBDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "ADS-B", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "ADS-B", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}
@ -8124,7 +8125,7 @@ void ADSBDemodGUI::downloadProgress(qint64 bytesRead, qint64 totalBytes) @@ -8124,7 +8125,7 @@ void ADSBDemodGUI::downloadProgress(qint64 bytesRead, qint64 totalBytes)
void ADSBDemodGUI::downloadError(const QString& error)
{
QMessageBox::critical(this, "ADS-B", error);
MessageDialog::critical(this, "ADS-B", error);
if (m_progressDialog)
{
m_progressDialog->close();

5
plugins/channelrx/demodais/aisdemodgui.cpp

@ -41,6 +41,7 @@ @@ -41,6 +41,7 @@
#include "util/csv.h"
#include "util/db.h"
#include "util/mmsi.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/dialpopup.h"
#include "gui/dialogpositioner.h"
@ -1076,7 +1077,7 @@ void AISDemodGUI::on_logOpen_clicked() @@ -1076,7 +1077,7 @@ void AISDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "AIS Demod", error);
MessageDialog::critical(this, "AIS Demod", error);
}
m_loadingData = false;
ui->messages->setSortingEnabled(true);
@ -1086,7 +1087,7 @@ void AISDemodGUI::on_logOpen_clicked() @@ -1086,7 +1087,7 @@ void AISDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "AIS Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "AIS Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

5
plugins/channelrx/demodapt/aptdemodgui.cpp

@ -37,6 +37,7 @@ @@ -37,6 +37,7 @@
#include "ui_aptdemodgui.h"
#include "plugin/pluginapi.h"
#include "util/db.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/dialpopup.h"
#include "gui/dialogpositioner.h"
@ -526,12 +527,12 @@ void APTDemodGUI::on_saveImage_clicked() @@ -526,12 +527,12 @@ void APTDemodGUI::on_saveImage_clicked()
{
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]));
MessageDialog::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"));
MessageDialog::critical(this, "APT Demodulator", QString("Please specify a filename with an extension such as .png or .jpg"));
}
}
}

5
plugins/channelrx/demoddsc/dscdemodgui.cpp

@ -40,6 +40,7 @@ @@ -40,6 +40,7 @@
#include "util/csv.h"
#include "util/db.h"
#include "util/mmsi.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/decimaldelegate.h"
#include "dsp/dspengine.h"
@ -1174,12 +1175,12 @@ void DSCDemodGUI::on_logOpen_clicked() @@ -1174,12 +1175,12 @@ void DSCDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "DSC Demod", error);
MessageDialog::critical(this, "DSC Demod", error);
}
}
else
{
QMessageBox::critical(this, "DSC Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "DSC Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

4
plugins/channelrx/demoddsd/dsdstatustextdialog.cpp

@ -28,6 +28,8 @@ @@ -28,6 +28,8 @@
#include <QMessageBox>
#include <QTextStream>
#include "gui/messagedialog.h"
DSDStatusTextDialog::DSDStatusTextDialog(QWidget* parent) :
QDialog(parent),
ui(new Ui::DSDStatusTextDialog)
@ -84,7 +86,7 @@ void DSDStatusTextDialog::on_saveLog_clicked() @@ -84,7 +86,7 @@ void DSDStatusTextDialog::on_saveLog_clicked()
}
else
{
QMessageBox::information(this, tr("Message"), tr("Cannot open file for writing"));
MessageDialog::information(this, tr("Message"), tr("Cannot open file for writing"));
}
}

5
plugins/channelrx/demodendoftrain/endoftraindemodgui.cpp

@ -34,6 +34,7 @@ @@ -34,6 +34,7 @@
#include "plugin/pluginapi.h"
#include "util/csv.h"
#include "util/db.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "dsp/dspengine.h"
#include "dsp/glscopesettings.h"
@ -728,12 +729,12 @@ void EndOfTrainDemodGUI::on_logOpen_clicked() @@ -728,12 +729,12 @@ void EndOfTrainDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "End-Of-Train Demod", error);
MessageDialog::critical(this, "End-Of-Train Demod", error);
}
}
else
{
QMessageBox::critical(this, "End-Of-Train Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "End-Of-Train Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

5
plugins/channelrx/demodinmarsat/inmarsatdemodgui.cpp

@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
#include "util/db.h"
#include "util/units.h"
#include "util/osndb.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/dialogpositioner.h"
#include "dsp/glscopesettings.h"
@ -1947,12 +1948,12 @@ void InmarsatDemodGUI::on_logOpen_clicked() @@ -1947,12 +1948,12 @@ void InmarsatDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "Inmarsat Demod", error);
MessageDialog::critical(this, "Inmarsat Demod", error);
}
}
else
{
QMessageBox::critical(this, "Inmarsat Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Inmarsat Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

4
plugins/channelrx/demodm17/m17statustextdialog.cpp

@ -28,6 +28,8 @@ @@ -28,6 +28,8 @@
#include <QMessageBox>
#include <QTextStream>
#include "gui/messagedialog.h"
M17StatusTextDialog::M17StatusTextDialog(QWidget* parent) :
QDialog(parent),
ui(new Ui::M17StatusTextDialog)
@ -84,7 +86,7 @@ void M17StatusTextDialog::on_saveLog_clicked() @@ -84,7 +86,7 @@ void M17StatusTextDialog::on_saveLog_clicked()
}
else
{
QMessageBox::information(this, tr("Message"), tr("Cannot open file for writing"));
MessageDialog::information(this, tr("Message"), tr("Cannot open file for writing"));
}
}

4
plugins/channelrx/demodmeshcore/meshcorekeysdialog.cpp

@ -20,6 +20,8 @@ @@ -20,6 +20,8 @@
#include "ui_meshcorekeysdialog.h"
#include "meshcorepacket.h"
#include "gui/messagedialog.h"
MeshcoreKeysDialog::MeshcoreKeysDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::MeshcoreKeysDialog)
@ -53,7 +55,7 @@ void MeshcoreKeysDialog::accept() @@ -53,7 +55,7 @@ void MeshcoreKeysDialog::accept()
{
if (!validateCurrentInput())
{
QMessageBox::warning(this, tr("Invalid Keys"), tr("Fix the Meshcore key list before saving."));
MessageDialog::warning(this, tr("Invalid Keys"), tr("Fix the Meshcore key list before saving."));
return;
}

4
plugins/channelrx/demodmeshtastic/meshtastickeysdialog.cpp

@ -20,6 +20,8 @@ @@ -20,6 +20,8 @@
#include "ui_meshtastickeysdialog.h"
#include "meshtasticpacket.h"
#include "gui/messagedialog.h"
MeshtasticKeysDialog::MeshtasticKeysDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::MeshtasticKeysDialog)
@ -53,7 +55,7 @@ void MeshtasticKeysDialog::accept() @@ -53,7 +55,7 @@ void MeshtasticKeysDialog::accept()
{
if (!validateCurrentInput())
{
QMessageBox::warning(this, tr("Invalid Keys"), tr("Fix the Meshtastic key list before saving."));
MessageDialog::warning(this, tr("Invalid Keys"), tr("Fix the Meshtastic key list before saving."));
return;
}

5
plugins/channelrx/demodnavtex/navtexdemodgui.cpp

@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
#include "plugin/pluginapi.h"
#include "util/csv.h"
#include "util/db.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/decimaldelegate.h"
#include "dsp/dspengine.h"
@ -850,12 +851,12 @@ void NavtexDemodGUI::on_logOpen_clicked() @@ -850,12 +851,12 @@ void NavtexDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "Navtex Demod", error);
MessageDialog::critical(this, "Navtex Demod", error);
}
}
else
{
QMessageBox::critical(this, "Navtex Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Navtex Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

5
plugins/channelrx/demodpacket/packetdemodgui.cpp

@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
#include "plugin/pluginapi.h"
#include "util/csv.h"
#include "util/db.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "dsp/dspengine.h"
#include "gui/dialogpositioner.h"
@ -719,12 +720,12 @@ void PacketDemodGUI::on_logOpen_clicked() @@ -719,12 +720,12 @@ void PacketDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "Packet Demod", error);
MessageDialog::critical(this, "Packet Demod", error);
}
}
else
{
QMessageBox::critical(this, "Packet Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Packet Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

5
plugins/channelrx/demodpager/pagerdemodgui.cpp

@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
#include "util/db.h"
#include "util/csv.h"
#include "util/units.h"
#include "gui/messagedialog.h"
#include "gui/crightclickenabler.h"
#include "gui/basicchannelsettingsdialog.h"
#include "dsp/dspengine.h"
@ -897,12 +898,12 @@ void PagerDemodGUI::on_logOpen_clicked() @@ -897,12 +898,12 @@ void PagerDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "Pager Demod", error);
MessageDialog::critical(this, "Pager Demod", error);
}
}
else
{
QMessageBox::critical(this, "Pager Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Pager Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

5
plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp

@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
#include "util/csv.h"
#include "util/db.h"
#include "util/units.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/datetimedelegate.h"
#include "gui/decimaldelegate.h"
@ -913,12 +914,12 @@ void RadiosondeDemodGUI::on_logOpen_clicked() @@ -913,12 +914,12 @@ void RadiosondeDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "Radiosonde Demod", error);
MessageDialog::critical(this, "Radiosonde Demod", error);
}
}
else
{
QMessageBox::critical(this, "Radiosonde Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Radiosonde Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

3
plugins/channelrx/demodvormc/vordemodmcgui.cpp

@ -37,6 +37,7 @@ @@ -37,6 +37,7 @@
#include "util/db.h"
#include "util/morse.h"
#include "util/units.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "dsp/dspengine.h"
#include "gui/crightclickenabler.h"
@ -1026,7 +1027,7 @@ void VORDemodMCGUI::downloadFinished(const QString& filename, bool success) @@ -1026,7 +1027,7 @@ void VORDemodMCGUI::downloadFinished(const QString& filename, bool success)
else
{
qDebug() << "VORDemodMCGUI::downloadFinished: Failed: " << filename;
QMessageBox::warning(this, "Download failed", QString("Failed to download %1").arg(filename));
MessageDialog::warning(this, "Download failed", QString("Failed to download %1").arg(filename));
}
if (closeDialog && m_progressDialog)
{

3
plugins/channelrx/filesink/filesinkgui.cpp

@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
#include "device/deviceuiset.h"
#include "device/deviceapi.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/dialpopup.h"
#include "gui/dialogpositioner.h"
@ -168,7 +169,7 @@ bool FileSinkGUI::handleMessage(const Message& message) @@ -168,7 +169,7 @@ bool FileSinkGUI::handleMessage(const Message& message)
else if (FileSinkMessages::MsgReportRecordFileError::match(message))
{
const FileSinkMessages::MsgReportRecordFileError& report = (FileSinkMessages::MsgReportRecordFileError&) message;
QMessageBox::critical(this, tr("File Error"), report.getMessage());
MessageDialog::critical(this, tr("File Error"), report.getMessage());
return true;
}
else

7
plugins/channelrx/freqscanner/freqscannergui.cpp

@ -30,6 +30,7 @@ @@ -30,6 +30,7 @@
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "ui_freqscannergui.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "dsp/dspengine.h"
#include "gui/tabletapandhold.h"
@ -958,13 +959,13 @@ void FreqScannerGUI::on_importFreqs_clicked() @@ -958,13 +959,13 @@ void FreqScannerGUI::on_importFreqs_clicked()
{
QString actualColNames = colIndexes.keys().join(" ");
QString expectedColNames = colNames.join(" ");
QMessageBox::critical(this, "Frequency Scanner", QString("Failed to read expected header in CSV file. %1 != %2").arg(actualColNames).arg(expectedColNames));
MessageDialog::critical(this, "Frequency Scanner", QString("Failed to read expected header in CSV file. %1 != %2").arg(actualColNames).arg(expectedColNames));
return;
}
}
else
{
QMessageBox::warning(this, "Frequency Scanner", QString("Failed to open file %1").arg(filename));
MessageDialog::warning(this, "Frequency Scanner", QString("Failed to open file %1").arg(filename));
}
}
}
@ -1005,7 +1006,7 @@ void FreqScannerGUI::on_exportFreqs_clicked() @@ -1005,7 +1006,7 @@ void FreqScannerGUI::on_exportFreqs_clicked()
}
else
{
QMessageBox::warning(this, "Frequency Scanner", QString("Failed to open file %1").arg(filename));
MessageDialog::warning(this, "Frequency Scanner", QString("Failed to open file %1").arg(filename));
}
}
}

17
plugins/channelrx/heatmap/heatmapgui.cpp

@ -38,6 +38,7 @@ @@ -38,6 +38,7 @@
#include "util/colormap.h"
#include "util/db.h"
#include "util/units.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/dialpopup.h"
#include "gui/dialogpositioner.h"
@ -314,7 +315,7 @@ void HeatMapGUI::on_writeCSV_clicked() @@ -314,7 +315,7 @@ void HeatMapGUI::on_writeCSV_clicked()
QFile file(fileNames[0]);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
{
QMessageBox::critical(this, "Heat Map", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Heat Map", QString("Failed to open file %1").arg(fileNames[0]));
return;
}
QTextStream out(&file);
@ -351,7 +352,7 @@ void HeatMapGUI::on_readCSV_clicked() @@ -351,7 +352,7 @@ void HeatMapGUI::on_readCSV_clicked()
QFile file(fileNames[0]);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
{
QMessageBox::critical(this, "Heat Map", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Heat Map", QString("Failed to open file %1").arg(fileNames[0]));
return;
}
QTextStream in(&file);
@ -382,7 +383,7 @@ void HeatMapGUI::on_readCSV_clicked() @@ -382,7 +383,7 @@ void HeatMapGUI::on_readCSV_clicked()
{
QString actualColNames = colIndexes.keys().join(" ");
QString expectedColNames = colNames.join(" ");
QMessageBox::critical(this, "Heat Map", QString("Failed to read expected header in CSV file. %1 != %2").arg(actualColNames).arg(expectedColNames));
MessageDialog::critical(this, "Heat Map", QString("Failed to read expected header in CSV file. %1 != %2").arg(actualColNames).arg(expectedColNames));
return;
}
}
@ -400,7 +401,7 @@ void HeatMapGUI::on_writeImage_clicked() @@ -400,7 +401,7 @@ void HeatMapGUI::on_writeImage_clicked()
{
if (!m_image.save(fileNames[0]))
{
QMessageBox::critical(this, "Heat Map", QString("Failed to save image to %1").arg(fileNames[0]));
MessageDialog::critical(this, "Heat Map", QString("Failed to save image to %1").arg(fileNames[0]));
return;
}
}
@ -977,7 +978,7 @@ void HeatMapGUI::createImage(int width, int height) @@ -977,7 +978,7 @@ void HeatMapGUI::createImage(int width, int height)
catch (std::bad_alloc&)
{
m_image = QImage();
QMessageBox::critical(this, "Heat Map", QString("Failed to allocate memory (width=%1 height=%2)").arg(m_width).arg(m_height));
MessageDialog::critical(this, "Heat Map", QString("Failed to allocate memory (width=%1 height=%2)").arg(m_width).arg(m_height));
}
}
@ -1295,7 +1296,7 @@ void HeatMapGUI::createMap() @@ -1295,7 +1296,7 @@ void HeatMapGUI::createMap()
catch (std::bad_alloc&)
{
deleteMap();
QMessageBox::critical(this, "Heat Map", QString("Failed to allocate memory (width=%1 height=%2)").arg(m_width).arg(m_height));
MessageDialog::critical(this, "Heat Map", QString("Failed to allocate memory (width=%1 height=%2)").arg(m_width).arg(m_height));
}
on_clearHeatMap_clicked();
@ -1442,7 +1443,7 @@ void HeatMapGUI::resizeMap(int x, int y) @@ -1442,7 +1443,7 @@ void HeatMapGUI::resizeMap(int x, int y)
delete[] powerMaxPeak;
delete[] powerMinPeak;
delete[] powerPathLoss;
QMessageBox::critical(this, "Heat Map", QString("Failed to allocate memory (width=%1 height=%2)").arg(newWidth).arg(newHeight));
MessageDialog::critical(this, "Heat Map", QString("Failed to allocate memory (width=%1 height=%2)").arg(newWidth).arg(newHeight));
}
}
}
@ -1537,7 +1538,7 @@ void HeatMapGUI::addToPowerSeries(QDateTime dateTime, double average, double pul @@ -1537,7 +1538,7 @@ void HeatMapGUI::addToPowerSeries(QDateTime dateTime, double average, double pul
}
catch (std::bad_alloc&)
{
QMessageBox::critical(this, "Heat Map", QString("Failed to allocate memory for chart series"));
MessageDialog::critical(this, "Heat Map", QString("Failed to allocate memory for chart series"));
ui->displayChart->setChecked(false);
}
}

9
plugins/channelrx/noisefigure/noisefiguregui.cpp

@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
#include "ui_noisefiguregui.h"
#include "plugin/pluginapi.h"
#include "util/db.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/decimaldelegate.h"
#include "gui/dialogpositioner.h"
@ -287,7 +288,7 @@ bool NoiseFigureGUI::handleMessage(const Message& message) @@ -287,7 +288,7 @@ bool NoiseFigureGUI::handleMessage(const Message& message)
m_runningTest = false;
QString errorMessage = report.getErrorMessage();
if (!errorMessage.isEmpty()) {
QMessageBox::critical(this, "Noise Figure", errorMessage);
MessageDialog::critical(this, "Noise Figure", errorMessage);
}
return true;
}
@ -406,7 +407,7 @@ void NoiseFigureGUI::on_startStop_clicked() @@ -406,7 +407,7 @@ void NoiseFigureGUI::on_startStop_clicked()
// Check we have at least on ENR value
if (m_settings.m_enr.size() < 1)
{
QMessageBox::critical(this, "Noise Figure", "You must enter the ENR of the noise source for at least one frequency");
MessageDialog::critical(this, "Noise Figure", "You must enter the ENR of the noise source for at least one frequency");
return;
}
// Clear current results if starting a test
@ -435,7 +436,7 @@ void NoiseFigureGUI::on_saveResults_clicked() @@ -435,7 +436,7 @@ void NoiseFigureGUI::on_saveResults_clicked()
qDebug() << "NoiseFigureGUI: Saving results to " << fileNames;
QFile file(fileNames[0]);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QMessageBox::critical(this, "Noise Figure", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Noise Figure", QString("Failed to open file %1").arg(fileNames[0]));
return;
}
QTextStream out(&file);
@ -467,7 +468,7 @@ void NoiseFigureGUI::on_openReference_clicked() @@ -467,7 +468,7 @@ void NoiseFigureGUI::on_openReference_clicked()
m_refFilename = fileNames[0];
QFile file(m_refFilename);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QMessageBox::critical(this, "Noise Figure", QString("Failed to open file %1").arg(m_refFilename));
MessageDialog::critical(this, "Noise Figure", QString("Failed to open file %1").arg(m_refFilename));
return;
}
QTextStream in(&file);

17
plugins/channelrx/radioastronomy/radioastronomygui.cpp

@ -44,6 +44,7 @@ @@ -44,6 +44,7 @@
#include "util/interpolation.h"
#include "util/png.h"
#include "util/units.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "dsp/dspengine.h"
#include "gui/timedelegate.h"
@ -1500,7 +1501,7 @@ void RadioAstronomyGUI::savePowerData(const QString& filename) @@ -1500,7 +1501,7 @@ void RadioAstronomyGUI::savePowerData(const QString& filename)
{
QFile file(filename);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QMessageBox::critical(this, "Radio Astronomy", QString("Failed to open file %1").arg(filename));
MessageDialog::critical(this, "Radio Astronomy", QString("Failed to open file %1").arg(filename));
return;
}
QTextStream out(&file);
@ -1784,7 +1785,7 @@ void RadioAstronomyGUI::saveSpectrumData(const QString& filename) @@ -1784,7 +1785,7 @@ void RadioAstronomyGUI::saveSpectrumData(const QString& filename)
{
QFile file(filename);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QMessageBox::critical(this, "Radio Astronomy", QString("Failed to open file %1").arg(filename));
MessageDialog::critical(this, "Radio Astronomy", QString("Failed to open file %1").arg(filename));
return;
}
QTextStream out(&file);
@ -1882,7 +1883,7 @@ void RadioAstronomyGUI::on_loadSpectrumData_clicked() @@ -1882,7 +1883,7 @@ void RadioAstronomyGUI::on_loadSpectrumData_clicked()
{
QFile file(fileNames[0]);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QMessageBox::critical(this, "Radio Astronomy", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Radio Astronomy", QString("Failed to open file %1").arg(fileNames[0]));
return;
}
@ -1997,7 +1998,7 @@ void RadioAstronomyGUI::on_loadSpectrumData_clicked() @@ -1997,7 +1998,7 @@ void RadioAstronomyGUI::on_loadSpectrumData_clicked()
}
else
{
QMessageBox::critical(this, "Radio Astronomy", QString("Missing required columns in file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Radio Astronomy", QString("Missing required columns in file %1").arg(fileNames[0]));
return;
}
}
@ -5316,7 +5317,7 @@ void RadioAstronomyGUI::on_savePowerChartImage_clicked() @@ -5316,7 +5317,7 @@ void RadioAstronomyGUI::on_savePowerChartImage_clicked()
QPainter painter(&image);
ui->powerChart->render(&painter);
if (!image.save(fileNames[0])) {
QMessageBox::critical(this, "Radio Astronomy", QString("Failed to save image to %1").arg(fileNames[0]));
MessageDialog::critical(this, "Radio Astronomy", QString("Failed to save image to %1").arg(fileNames[0]));
}
}
}
@ -5336,7 +5337,7 @@ void RadioAstronomyGUI::on_saveSpectrumChartImage_clicked() @@ -5336,7 +5337,7 @@ void RadioAstronomyGUI::on_saveSpectrumChartImage_clicked()
QPainter painter(&image);
ui->spectrumChart->render(&painter);
if (!image.save(fileNames[0])) {
QMessageBox::critical(this, "Radio Astronomy", QString("Failed to save image to %1").arg(fileNames[0]));
MessageDialog::critical(this, "Radio Astronomy", QString("Failed to save image to %1").arg(fileNames[0]));
}
}
}
@ -5369,7 +5370,7 @@ void RadioAstronomyGUI::on_saveSpectrumChartImages_clicked() @@ -5369,7 +5370,7 @@ void RadioAstronomyGUI::on_saveSpectrumChartImages_clicked()
apng.addImage(image);
}
if (!apng.save(fileNames[0])) {
QMessageBox::critical(this, "Radio Astronomy", QString("Failed to write to file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Radio Astronomy", QString("Failed to write to file %1").arg(fileNames[0]));
}
}
}
@ -6378,7 +6379,7 @@ void RadioAstronomyGUI::on_startStop_clicked(bool checked) @@ -6378,7 +6379,7 @@ void RadioAstronomyGUI::on_startStop_clicked(bool checked)
}
if (!errorMessage.isEmpty())
{
QMessageBox::warning(this,
MessageDialog::warning(this,
tr("Invalid Sweep Configuration"),
errorMessage);

3
plugins/channelrx/remotetcpsink/remotetcpsinkgui.cpp

@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
#include <QMessageBox>
#include "device/deviceuiset.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/dialpopup.h"
#include "gui/dialogpositioner.h"
@ -281,7 +282,7 @@ bool RemoteTCPSinkGUI::handleMessage(const Message& message) @@ -281,7 +282,7 @@ bool RemoteTCPSinkGUI::handleMessage(const Message& message)
{
const RemoteTCPSink::MsgError& msg = (const RemoteTCPSink::MsgError&) message;
QString error = msg.getError();
QMessageBox::warning(this, "RemoteTCPSink", error, QMessageBox::Ok);
MessageDialog::warning(this, "RemoteTCPSink", error, QMessageBox::Ok);
return true;
}
else

1
plugins/feature/aprs/aprsgui.cpp

@ -32,6 +32,7 @@ @@ -32,6 +32,7 @@
#include "feature/featureuiset.h"
#include "feature/featurewebapiutils.h"
#include "gui/messagedialog.h"
#include "gui/basicfeaturesettingsdialog.h"
#include "gui/dialogpositioner.h"
#include "maincore.h"

4
plugins/feature/map/mapbeacondialog.cpp

@ -25,6 +25,8 @@ @@ -25,6 +25,8 @@
#include "channel/channelwebapiutils.h"
#include "mapgui.h"
#include "gui/messagedialog.h"
MapBeaconDialog::MapBeaconDialog(MapGUI *gui, QWidget* parent) :
QDialog(parent),
m_gui(gui),
@ -126,7 +128,7 @@ void MapBeaconDialog::downloadFinished(const QString& filename, bool success, co @@ -126,7 +128,7 @@ void MapBeaconDialog::downloadFinished(const QString& filename, bool success, co
}
else
{
QMessageBox::warning(this, "Download failed", QString("Failed to download %1 to %2\n%3").arg(url).arg(filename).arg(errorMessage));
MessageDialog::warning(this, "Download failed", QString("Failed to download %1 to %2\n%3").arg(url).arg(filename).arg(errorMessage));
}
}

6
plugins/feature/map/mapsettingsdialog.cpp

@ -27,6 +27,8 @@ @@ -27,6 +27,8 @@
#include <QtGui/private/qzipreader_p.h>
#else
#include <QtCore/private/qzipreader_p.h>
#include "gui/messagedialog.h"
#endif
MapItemSettingsGUI::MapItemSettingsGUI(QTableWidget *table, int row, MapSettings::MapItemSettings *settings) :
@ -520,7 +522,7 @@ void MapSettingsDialog::downloadComplete(const QString &filename, bool success, @@ -520,7 +522,7 @@ void MapSettingsDialog::downloadComplete(const QString &filename, bool success,
else
{
m_downloadDialog.reject();
QMessageBox::warning(this, "Download failed", QString("Failed to download %1 to %2\n%3").arg(url).arg(filename).arg(errorMessage));
MessageDialog::warning(this, "Download failed", QString("Failed to download %1 to %2\n%3").arg(url).arg(filename).arg(errorMessage));
}
}
@ -582,7 +584,7 @@ void MapSettingsDialog::downloadProgress(qint64 bytesRead, qint64 totalBytes) @@ -582,7 +584,7 @@ void MapSettingsDialog::downloadProgress(qint64 bytesRead, qint64 totalBytes)
void MapSettingsDialog::downloadError(const QString& error)
{
QMessageBox::critical(this, "Map", error);
MessageDialog::critical(this, "Map", error);
if (m_progressDialog)
{
m_progressDialog->close();

6
plugins/feature/remotecontrol/remotecontroldevicedialog.cpp

@ -23,6 +23,8 @@ @@ -23,6 +23,8 @@
#include <QUrl>
#include <QMessageBox>
#include "gui/messagedialog.h"
RemoteControlDeviceDialog::RemoteControlDeviceDialog(RemoteControlSettings *settings, RemoteControlDevice *rcDevice, QWidget* parent) :
QDialog(parent),
ui(new Ui::RemoteControlDeviceDialog),
@ -218,7 +220,7 @@ void RemoteControlDeviceDialog::on_protocol_currentTextChanged(const QString &pr @@ -218,7 +220,7 @@ void RemoteControlDeviceDialog::on_protocol_currentTextChanged(const QString &pr
}
else
{
QMessageBox::critical(this, "Remote Control Error", QString("Failed to discover %1 devices").arg(protocol));
MessageDialog::critical(this, "Remote Control Error", QString("Failed to discover %1 devices").arg(protocol));
}
}
enableWidgets();
@ -388,7 +390,7 @@ void RemoteControlDeviceDialog::deviceList(const QList<DeviceDiscoverer::DeviceI @@ -388,7 +390,7 @@ void RemoteControlDeviceDialog::deviceList(const QList<DeviceDiscoverer::DeviceI
void RemoteControlDeviceDialog::deviceError(const QString &error)
{
QMessageBox::critical(this, "Remote Control Error", error);
MessageDialog::critical(this, "Remote Control Error", error);
}
void RemoteControlDeviceDialog::on_controlAdd_clicked()

3
plugins/feature/remotecontrol/remotecontrolgui.cpp

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
///////////////////////////////////////////////////////////////////////////////////
#include "feature/featureuiset.h"
#include "gui/messagedialog.h"
#include "gui/basicfeaturesettingsdialog.h"
#include "gui/flowlayout.h"
#include "gui/scidoublespinbox.h"
@ -89,7 +90,7 @@ bool RemoteControlGUI::handleMessage(const Message& message) @@ -89,7 +90,7 @@ bool RemoteControlGUI::handleMessage(const Message& message)
else if (RemoteControl::MsgDeviceError::match(message))
{
const RemoteControl::MsgDeviceError& msg = (RemoteControl::MsgDeviceError&) message;
QMessageBox::critical(this, "Remote Control Error", msg.getErrorMessage());
MessageDialog::critical(this, "Remote Control Error", msg.getErrorMessage());
return true;
}
else if (RemoteControl::MsgDeviceUnavailable::match(message))

3
plugins/feature/satellitetracker/satellitetrackergui.cpp

@ -31,6 +31,7 @@ @@ -31,6 +31,7 @@
#include "feature/featureuiset.h"
#include "feature/featureutils.h"
#include "feature/featurewebapiutils.h"
#include "gui/messagedialog.h"
#include "gui/basicfeaturesettingsdialog.h"
#include "gui/dialogpositioner.h"
#include "util/units.h"
@ -200,7 +201,7 @@ bool SatelliteTrackerGUI::handleMessage(const Message& message) @@ -200,7 +201,7 @@ bool SatelliteTrackerGUI::handleMessage(const Message& message)
{
SatelliteTracker::MsgError& errorMsg = (SatelliteTracker::MsgError&) message;
QString error = errorMsg.getError();
QMessageBox::critical(this, "Satellite Tracker", error);
MessageDialog::critical(this, "Satellite Tracker", error);
return true;
}

15
plugins/feature/sid/sidgui.cpp

@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
#include "feature/featureuiset.h"
#include "feature/featurewebapiutils.h"
#include "channel/channelwebapiutils.h"
#include "gui/messagedialog.h"
#include "gui/crightclickenabler.h"
#include "gui/basicfeaturesettingsdialog.h"
#include "gui/dialogpositioner.h"
@ -1926,15 +1927,15 @@ void SIDGUI::sdoVideoError(QMediaPlayer::Error error) @@ -1926,15 +1927,15 @@ void SIDGUI::sdoVideoError(QMediaPlayer::Error error)
// Qt5/Windows doesn't support mp4 by default, so suggest K-Lite codecs
// Qt6 doesn't need these
if (error == QMediaPlayer::FormatError) {
QMessageBox::warning(this, "Video Error", "Unable to play video. Please try installing mp4/h264 codec, such as: <a href='https://www.codecguide.com/download_k-lite_codec_pack_basic.htm'>K-Lite codedcs</a>.");
MessageDialog::warning(this, "Video Error", "Unable to play video. Please try installing mp4/h264 codec, such as: <a href='https://www.codecguide.com/download_k-lite_codec_pack_basic.htm'>K-Lite codedcs</a>.");
}
#elif LINUX
if (error == QMediaPlayer::FormatError) {
QMessageBox::warning(this, "Video Error", "Unable to play video. Please try installing mp4/h264 codec, such as gstreamer libav.");
MessageDialog::warning(this, "Video Error", "Unable to play video. Please try installing mp4/h264 codec, such as gstreamer libav.");
}
#else
if (error == QMediaPlayer::FormatError) {
QMessageBox::warning(this, "Video Error", "Unable to play video. Please try installing an mp4/h264 codec.");
MessageDialog::warning(this, "Video Error", "Unable to play video. Please try installing an mp4/h264 codec.");
}
#endif
}
@ -1994,7 +1995,7 @@ void SIDGUI::on_showSats_clicked() @@ -1994,7 +1995,7 @@ void SIDGUI::on_showSats_clicked()
}
else
{
QMessageBox::warning(this, "Error", "Satellite Tracker feature not available");
MessageDialog::warning(this, "Error", "Satellite Tracker feature not available");
}
}
@ -2269,7 +2270,7 @@ void SIDGUI::writeCSV(const QString& filename) @@ -2269,7 +2270,7 @@ void SIDGUI::writeCSV(const QString& filename)
QFile file(filename);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
{
QMessageBox::critical(this, "SID", QString("Failed to open file %1").arg(filename));
MessageDialog::critical(this, "SID", QString("Failed to open file %1").arg(filename));
return;
}
QTextStream out(&file);
@ -2373,7 +2374,7 @@ void SIDGUI::readCSV(const QString& filename, bool autoload) @@ -2373,7 +2374,7 @@ void SIDGUI::readCSV(const QString& filename, bool autoload)
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
{
if (!autoload) {
QMessageBox::critical(this, "SID", QString("Failed to open file %1").arg(filename));
MessageDialog::critical(this, "SID", QString("Failed to open file %1").arg(filename));
}
return;
}
@ -2536,7 +2537,7 @@ void SIDGUI::on_saveChartImage_clicked() @@ -2536,7 +2537,7 @@ void SIDGUI::on_saveChartImage_clicked()
QPainter painter(&image);
ui->chart->render(&painter);
if (!image.save(fileNames[0])) {
QMessageBox::critical(this, "SID", QString("Failed to save image to %1").arg(fileNames[0]));
MessageDialog::critical(this, "SID", QString("Failed to save image to %1").arg(fileNames[0]));
}
}
}

5
plugins/feature/startracker/startrackergui.cpp

@ -38,6 +38,7 @@ @@ -38,6 +38,7 @@
#include "feature/featureutils.h"
#include "feature/featurewebapiutils.h"
#include "channel/channelwebapiutils.h"
#include "gui/messagedialog.h"
#include "gui/basicfeaturesettingsdialog.h"
#include "gui/dmsspinbox.h"
#include "gui/graphicsviewzoom.h"
@ -1614,7 +1615,7 @@ void StarTrackerGUI::on_saveAnimation_clicked() @@ -1614,7 +1615,7 @@ void StarTrackerGUI::on_saveAnimation_clicked()
apng.addImage(m_animationImages[i]);
}
if (!apng.save(fileNames[0])) {
QMessageBox::critical(this, "Star Tracker", QString("Failed to write to file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Star Tracker", QString("Failed to write to file %1").arg(fileNames[0]));
}
}
}
@ -3330,7 +3331,7 @@ void StarTrackerGUI::downloadFinished(const QString& filename, bool success) @@ -3330,7 +3331,7 @@ void StarTrackerGUI::downloadFinished(const QString& filename, bool success)
if (success && filename.endsWith("solar_flux.srd")) {
readSolarFlux();
} else if (!success) {
QMessageBox::warning(this, "Failed to download file", QString("Failed to download %1").arg(filename));
MessageDialog::warning(this, "Failed to download file", QString("Failed to download %1").arg(filename));
}
}

3
plugins/feature/vorlocalizer/vorlocalizergui.cpp

@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
#include "plugin/pluginapi.h"
#include "util/morse.h"
#include "util/units.h"
#include "gui/messagedialog.h"
#include "gui/basicfeaturesettingsdialog.h"
#include "gui/dialpopup.h"
#include "gui/dialogpositioner.h"
@ -920,7 +921,7 @@ void VORLocalizerGUI::downloadingURL(const QString& url) @@ -920,7 +921,7 @@ void VORLocalizerGUI::downloadingURL(const QString& url)
void VORLocalizerGUI::downloadError(const QString& error)
{
QMessageBox::critical(this, "VOR Localizer", error);
MessageDialog::critical(this, "VOR Localizer", error);
if (m_progressDialog)
{

3
plugins/samplemimo/audiocatsiso/audiocatsisogui.cpp

@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
#include "device/deviceapi.h"
#include "device/deviceuiset.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/dialpopup.h"
@ -649,7 +650,7 @@ void AudioCATSISOGUI::updateStatus() @@ -649,7 +650,7 @@ void AudioCATSISOGUI::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

5
plugins/samplemimo/bladerf2mimo/bladerf2mimogui.cpp

@ -27,6 +27,7 @@ @@ -27,6 +27,7 @@
#include "device/deviceapi.h"
#include "device/deviceuiset.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -841,7 +842,7 @@ void BladeRF2MIMOGui::updateStatus() @@ -841,7 +842,7 @@ void BladeRF2MIMOGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStopRx->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage(0));
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage(0));
break;
default:
break;
@ -866,7 +867,7 @@ void BladeRF2MIMOGui::updateStatus() @@ -866,7 +867,7 @@ void BladeRF2MIMOGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStopTx->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage(1));
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage(1));
break;
default:
break;

5
plugins/samplemimo/limesdrmimo/limesdrmimogui.cpp

@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
#include "device/deviceapi.h"
#include "device/deviceuiset.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -691,7 +692,7 @@ void LimeSDRMIMOGUI::updateStatus() @@ -691,7 +692,7 @@ void LimeSDRMIMOGUI::updateStatus()
break;
case DeviceAPI::StError:
ui->startStopRx->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage(0));
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage(0));
break;
default:
break;
@ -716,7 +717,7 @@ void LimeSDRMIMOGUI::updateStatus() @@ -716,7 +717,7 @@ void LimeSDRMIMOGUI::updateStatus()
break;
case DeviceAPI::StError:
ui->startStopTx->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage(1));
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage(1));
break;
default:
break;

3
plugins/samplemimo/metismiso/metismisogui.cpp

@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
#include "device/deviceapi.h"
#include "device/deviceuiset.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/dialpopup.h"
@ -452,7 +453,7 @@ void MetisMISOGui::updateStatus() @@ -452,7 +453,7 @@ void MetisMISOGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

5
plugins/samplemimo/plutosdrmimo/plutosdrmimogui.cpp

@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
#include "device/deviceapi.h"
#include "device/deviceuiset.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -492,7 +493,7 @@ void PlutoSDRMIMOGUI::updateStatus() @@ -492,7 +493,7 @@ void PlutoSDRMIMOGUI::updateStatus()
ui->startStopRx->setChecked(false);
}
ui->startStopRx->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;
@ -520,7 +521,7 @@ void PlutoSDRMIMOGUI::updateStatus() @@ -520,7 +521,7 @@ void PlutoSDRMIMOGUI::updateStatus()
ui->startStopTx->setChecked(false);
}
ui->startStopTx->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplemimo/testmi/testmigui.cpp

@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
#include "device/deviceapi.h"
#include "device/deviceuiset.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -475,7 +476,7 @@ void TestMIGui::updateStatus() @@ -475,7 +476,7 @@ void TestMIGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplemimo/testmosync/testmosyncgui.cpp

@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
#include <QString>
#include <QMessageBox>
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -250,7 +251,7 @@ void TestMOSyncGui::updateStatus() @@ -250,7 +251,7 @@ void TestMOSyncGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

5
plugins/samplemimo/xtrxmimo/xtrxmimogui.cpp

@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
#include "device/deviceapi.h"
#include "device/deviceuiset.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -577,7 +578,7 @@ void XTRXMIMOGUI::updateStatus() @@ -577,7 +578,7 @@ void XTRXMIMOGUI::updateStatus()
break;
case DeviceAPI::StError:
ui->startStopRx->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;
@ -601,7 +602,7 @@ void XTRXMIMOGUI::updateStatus() @@ -601,7 +602,7 @@ void XTRXMIMOGUI::updateStatus()
break;
case DeviceAPI::StError:
ui->startStopTx->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage(1));
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage(1));
break;
default:
break;

3
plugins/samplesink/aaroniartsaoutput/aaroniartsaoutputgui.cpp

@ -31,6 +31,7 @@ @@ -31,6 +31,7 @@
#include <QJsonObject>
#include "ui_aaroniartsaoutputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -353,7 +354,7 @@ void AaroniaRTSAOutputGui::updateStatus() @@ -353,7 +354,7 @@ void AaroniaRTSAOutputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesink/bladerf1output/bladerf1outputgui.cpp

@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
#include <libbladeRF.h>
#include "ui_bladerf1outputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -431,7 +432,7 @@ void Bladerf1OutputGui::updateStatus() @@ -431,7 +432,7 @@ void Bladerf1OutputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesink/bladerf2output/bladerf2outputgui.cpp

@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
#include <libbladeRF.h>
#include "ui_bladerf2outputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -447,7 +448,7 @@ void BladeRF2OutputGui::updateStatus() @@ -447,7 +448,7 @@ void BladeRF2OutputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesink/fileoutput/fileoutputgui.cpp

@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
#include <QMessageBox>
#include "ui_fileoutputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -256,7 +257,7 @@ void FileOutputGui::updateStatus() @@ -256,7 +257,7 @@ void FileOutputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesink/hackrfoutput/hackrfoutputgui.cpp

@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
#include <libhackrf/hackrf.h>
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -464,7 +465,7 @@ void HackRFOutputGui::updateStatus() @@ -464,7 +465,7 @@ void HackRFOutputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesink/limesdroutput/limesdroutputgui.cpp

@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
#include <QMessageBox>
#include "ui_limesdroutputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -504,7 +505,7 @@ void LimeSDROutputGUI::updateStatus() @@ -504,7 +505,7 @@ void LimeSDROutputGUI::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesink/localoutput/localoutputgui.cpp

@ -31,6 +31,7 @@ @@ -31,6 +31,7 @@
#include <QJsonObject>
#include "ui_localoutputgui.h"
#include "gui/messagedialog.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
#include "gui/dialogpositioner.h"
@ -279,7 +280,7 @@ void LocalOutputGui::updateStatus() @@ -279,7 +280,7 @@ void LocalOutputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesink/plutosdroutput/plutosdroutputgui.cpp

@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
#include <QSignalBlocker>
#include "dsp/dspcommands.h"
#include "gui/messagedialog.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
#include "gui/dialpopup.h"
@ -414,7 +415,7 @@ void PlutoSDROutputGUI::updateStatus() @@ -414,7 +415,7 @@ void PlutoSDROutputGUI::updateStatus()
ui->startStop->setChecked(false);
}
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesink/remoteoutput/remoteoutputgui.cpp

@ -27,6 +27,7 @@ @@ -27,6 +27,7 @@
#include <boost/lexical_cast.hpp>
#include "ui_remoteoutputgui.h"
#include "gui/messagedialog.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
#include "gui/dialpopup.h"
@ -276,7 +277,7 @@ void RemoteOutputSinkGui::updateStatus() @@ -276,7 +277,7 @@ void RemoteOutputSinkGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesink/soapysdroutput/soapysdroutputgui.cpp

@ -24,6 +24,7 @@ @@ -24,6 +24,7 @@
#include "device/deviceapi.h"
#include "device/deviceuiset.h"
#include "ui_soapysdroutputgui.h"
#include "gui/messagedialog.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
#include "gui/dialogpositioner.h"
@ -877,7 +878,7 @@ void SoapySDROutputGui::updateStatus() @@ -877,7 +878,7 @@ void SoapySDROutputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesink/testsink/testsinkgui.cpp

@ -24,6 +24,7 @@ @@ -24,6 +24,7 @@
#include <QMessageBox>
#include "ui_testsinkgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -232,7 +233,7 @@ void TestSinkGui::updateStatus() @@ -232,7 +233,7 @@ void TestSinkGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesink/usrpoutput/usrpoutputgui.cpp

@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
#include <QMessageBox>
#include "ui_usrpoutputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -436,7 +437,7 @@ void USRPOutputGUI::updateStatus() @@ -436,7 +437,7 @@ void USRPOutputGUI::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesink/xtrxoutput/xtrxoutputgui.cpp

@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
#include <QMessageBox>
#include "ui_xtrxoutputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -414,7 +415,7 @@ void XTRXOutputGUI::updateStatus() @@ -414,7 +415,7 @@ void XTRXOutputGUI::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/aaroniartsainput/aaroniartsainputgui.cpp

@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
#include <QFileDialog>
#include "ui_aaroniartsainputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -217,7 +218,7 @@ void AaroniaRTSAInputGui::updateStatus() @@ -217,7 +218,7 @@ void AaroniaRTSAInputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/airspy/airspygui.cpp

@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
#include "device/deviceuiset.h"
#include "ui_airspygui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -438,7 +439,7 @@ void AirspyGui::updateStatus() @@ -438,7 +439,7 @@ void AirspyGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/airspyhf/airspyhfgui.cpp

@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
#include "device/deviceuiset.h"
#include "ui_airspyhfgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -466,7 +467,7 @@ void AirspyHFGui::updateStatus() @@ -466,7 +467,7 @@ void AirspyHFGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/androidsdrdriverinput/androidsdrdriverinputgui.cpp

@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
#include <QString>
#include "ui_androidsdrdriverinputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -542,7 +543,7 @@ void AndroidSDRDriverInputGui::updateStatus() @@ -542,7 +543,7 @@ void AndroidSDRDriverInputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/audioinput/audioinputgui.cpp

@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
#include <QFileDialog>
#include "ui_audioinputgui.h"
#include "gui/messagedialog.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
#include "gui/dialpopup.h"
@ -384,7 +385,7 @@ void AudioInputGui::updateStatus() @@ -384,7 +385,7 @@ void AudioInputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/bladerf1input/bladerf1inputgui.cpp

@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
#include <libbladeRF.h>
#include "ui_bladerf1inputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -502,7 +503,7 @@ void Bladerf1InputGui::updateStatus() @@ -502,7 +503,7 @@ void Bladerf1InputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/bladerf2input/bladerf2inputgui.cpp

@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
#include <libbladeRF.h>
#include "ui_bladerf2inputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -540,7 +541,7 @@ void BladeRF2InputGui::updateStatus() @@ -540,7 +541,7 @@ void BladeRF2InputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/fcdpro/fcdprogui.cpp

@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
#include <QFileDialog>
#include "ui_fcdprogui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -577,7 +578,7 @@ void FCDProGui::updateStatus() @@ -577,7 +578,7 @@ void FCDProGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/fcdproplus/fcdproplusgui.cpp

@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
#include <QFileDialog>
#include "ui_fcdproplusgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -316,7 +317,7 @@ void FCDProPlusGui::updateStatus() @@ -316,7 +317,7 @@ void FCDProPlusGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/fileinput/fileinputgui.cpp

@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
#include <QMessageBox>
#include "ui_fileinputgui.h"
#include "gui/messagedialog.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
#include "gui/dialogpositioner.h"
@ -287,7 +288,7 @@ void FileInputGUI::updateStatus() @@ -287,7 +288,7 @@ void FileInputGUI::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/fobos/fobosgui.cpp

@ -41,6 +41,7 @@ @@ -41,6 +41,7 @@
#include <QList>
#include "ui_fobosgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -544,7 +545,7 @@ void FOBOSGui::updateStatus() @@ -544,7 +545,7 @@ void FOBOSGui::updateStatus()
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
ui->power->setText(QStringLiteral("Error"));
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/hackrfinput/hackrfinputgui.cpp

@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
#include <libhackrf/hackrf.h>
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -528,7 +529,7 @@ void HackRFInputGui::updateStatus() @@ -528,7 +529,7 @@ void HackRFInputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/kiwisdr/kiwisdrgui.cpp

@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
#include <QFileDialog>
#include "ui_kiwisdrgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -233,7 +234,7 @@ void KiwiSDRGui::updateStatus() @@ -233,7 +234,7 @@ void KiwiSDRGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/limesdrinput/limesdrinputgui.cpp

@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
#include <algorithm>
#include "ui_limesdrinputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -557,7 +558,7 @@ void LimeSDRInputGUI::updateStatus() @@ -557,7 +558,7 @@ void LimeSDRInputGUI::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/localinput/localinputgui.cpp

@ -32,6 +32,7 @@ @@ -32,6 +32,7 @@
#include <QJsonObject>
#include "ui_localinputgui.h"
#include "gui/messagedialog.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
#include "gui/dialogpositioner.h"
@ -309,7 +310,7 @@ void LocalInputGui::updateStatus() @@ -309,7 +310,7 @@ void LocalInputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/perseus/perseusgui.cpp

@ -24,6 +24,7 @@ @@ -24,6 +24,7 @@
#include "device/deviceuiset.h"
#include "ui_perseusgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -377,7 +378,7 @@ void PerseusGui::updateStatus() @@ -377,7 +378,7 @@ void PerseusGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/plutosdrinput/plutosdrinputgui.cpp

@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
#include <QSignalBlocker>
#include "dsp/dspcommands.h"
#include "gui/messagedialog.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
#include "gui/dialpopup.h"
@ -508,7 +509,7 @@ void PlutoSDRInputGui::updateStatus() @@ -508,7 +509,7 @@ void PlutoSDRInputGui::updateStatus()
ui->startStop->setChecked(false);
}
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/remoteinput/remoteinputgui.cpp

@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
#include <QString>
#include "ui_remoteinputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -673,7 +674,7 @@ void RemoteInputGui::updateStatus() @@ -673,7 +674,7 @@ void RemoteInputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/remotetcpinput/remotetcpinputgui.cpp

@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
#include <QFileDialog>
#include "ui_remotetcpinputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -1011,7 +1012,7 @@ void RemoteTCPInputGui::updateStatus() @@ -1011,7 +1012,7 @@ void RemoteTCPInputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/rtlsdr/rtlsdrgui.cpp

@ -30,6 +30,7 @@ @@ -30,6 +30,7 @@
#include "device/deviceuiset.h"
#include "ui_rtlsdrgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "mainspectrum/mainspectrumgui.h"
@ -472,7 +473,7 @@ void RTLSDRGui::updateStatus() @@ -472,7 +473,7 @@ void RTLSDRGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/sdrplay/sdrplaygui.cpp

@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
#include "device/deviceuiset.h"
#include "ui_sdrplaygui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -314,7 +315,7 @@ void SDRPlayGui::updateStatus() @@ -314,7 +315,7 @@ void SDRPlayGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/sdrplayv3/sdrplayv3gui.cpp

@ -27,6 +27,7 @@ @@ -27,6 +27,7 @@
#include "device/deviceuiset.h"
#include "ui_sdrplayv3gui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -389,7 +390,7 @@ void SDRPlayV3Gui::updateStatus() @@ -389,7 +390,7 @@ void SDRPlayV3Gui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/sigmffileinput/sigmffileinputgui.cpp

@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
#include <QMessageBox>
#include "ui_sigmffileinputgui.h"
#include "gui/messagedialog.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
#include "gui/dialogpositioner.h"
@ -517,7 +518,7 @@ void SigMFFileInputGUI::updateStatus() @@ -517,7 +518,7 @@ void SigMFFileInputGUI::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/soapysdrinput/soapysdrinputgui.cpp

@ -24,6 +24,7 @@ @@ -24,6 +24,7 @@
#include "dsp/dspcommands.h"
#include "device/deviceapi.h"
#include "device/deviceuiset.h"
#include "gui/messagedialog.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
#include "gui/dialogpositioner.h"
@ -919,7 +920,7 @@ void SoapySDRInputGui::updateStatus() @@ -919,7 +920,7 @@ void SoapySDRInputGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/testsource/testsourcegui.cpp

@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
#include <QFileDialog>
#include "ui_testsourcegui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -447,7 +448,7 @@ void TestSourceGui::updateStatus() @@ -447,7 +448,7 @@ void TestSourceGui::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/usrpinput/usrpinputgui.cpp

@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
#include <algorithm>
#include "ui_usrpinputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -472,7 +473,7 @@ void USRPInputGUI::updateStatus() @@ -472,7 +473,7 @@ void USRPInputGUI::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

3
plugins/samplesource/xtrxinput/xtrxinputgui.cpp

@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
#include <algorithm>
#include "ui_xtrxinputgui.h"
#include "gui/messagedialog.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
@ -443,7 +444,7 @@ void XTRXInputGUI::updateStatus() @@ -443,7 +444,7 @@ void XTRXInputGUI::updateStatus()
break;
case DeviceAPI::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
MessageDialog::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
break;
default:
break;

2
sdrgui/CMakeLists.txt

@ -36,6 +36,7 @@ set(sdrgui_SOURCES @@ -36,6 +36,7 @@ set(sdrgui_SOURCES
gui/devicestreamselectiondialog.cpp
gui/deviceuserargsdialog.cpp
gui/dialogpositioner.cpp
gui/messagedialog.cpp
gui/dialpopup.cpp
gui/dmsspinbox.cpp
gui/editcommanddialog.cpp
@ -167,6 +168,7 @@ set(sdrgui_HEADERS @@ -167,6 +168,7 @@ set(sdrgui_HEADERS
gui/devicestreamselectiondialog.h
gui/deviceuserargsdialog.h
gui/dialogpositioner.h
gui/messagedialog.h
gui/dialpopup.h
gui/dmsspinbox.h
gui/doublevalidator.h

2
sdrgui/feature/featuregui.cpp

@ -31,7 +31,9 @@ @@ -31,7 +31,9 @@
#include <QOpenGLWidget>
#include <QMdiArea>
#include <QMessageBox>
#include "mainwindow.h"
#include "gui/messagedialog.h"
#include "gui/workspaceselectiondialog.h"
#include "featuregui.h"

73
sdrgui/gui/messagedialog.cpp

@ -0,0 +1,73 @@ @@ -0,0 +1,73 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
// Some code by AI //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#include <QWidget>
#include "gui/messagedialog.h"
void MessageDialog::show(QWidget *parent, QMessageBox::Icon icon, const QString& title, const QString& text, QMessageBox::StandardButtons buttons, std::function<void (QMessageBox::StandardButton)> onAnswer)
{
// Avoid creating new box with same text. Raise the existing one instead.
if (parent)
{
const QList<QMessageBox *> existing = parent->findChildren<QMessageBox *>(
QString(), Qt::FindDirectChildrenOnly);
for (QMessageBox *box : existing)
{
if (box->isVisible() && (box->text() == text) && (box->windowTitle() == title))
{
box->raise();
return;
}
}
}
QMessageBox *box = new QMessageBox(icon, title, text, buttons, parent);
box->setAttribute(Qt::WA_DeleteOnClose);
if (onAnswer)
{
QObject::connect(box, &QMessageBox::finished, box, [box, onAnswer](int) {
onAnswer(box->standardButton(box->clickedButton()));
});
}
// open() rather than exec(): it returns immediately, so nothing left on stack
box->open();
}
void MessageDialog::information(QWidget *parent, const QString& title, const QString& text, QMessageBox::StandardButtons buttons)
{
show(parent, QMessageBox::Information, title, text, buttons, nullptr);
}
void MessageDialog::warning(QWidget *parent, const QString& title, const QString& text, QMessageBox::StandardButtons buttons)
{
show(parent, QMessageBox::Warning, title, text, buttons, nullptr);
}
void MessageDialog::critical(QWidget *parent, const QString& title, const QString& text, QMessageBox::StandardButtons buttons)
{
show(parent, QMessageBox::Critical, title, text, buttons, nullptr);
}
void MessageDialog::question(QWidget *parent, const QString& title, const QString& text, QMessageBox::StandardButtons buttons, std::function<void (QMessageBox::StandardButton)> onAnswer)
{
show(parent, QMessageBox::Question, title, text, buttons, onAnswer);
}

61
sdrgui/gui/messagedialog.h

@ -0,0 +1,61 @@ @@ -0,0 +1,61 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
// Some code by AI //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#ifndef SDRGUI_GUI_MESSAGEDIALOG_H
#define SDRGUI_GUI_MESSAGEDIALOG_H
#include <QMessageBox>
#include <QString>
#include <functional>
#include "export.h"
class QWidget;
// Non-blocking replacements for the QMessageBox static functions, for use in device,
// channel and feature GUIs.
//
// QMessageBox::information() and friends build the message box on the stack, parent it to
// the calling widget and run a nested event loop in exec(). If the parent is closed
// via the Web API while the box is open, the parent deletes the box and its children,
// which corrupts the heap.
//
// The trade-off is that these return immediately, so they cannot report which button was
// pressed. Use question() when the answer is needed; it delivers it to a callback.
class SDRGUI_API MessageDialog
{
public:
static void information(QWidget *parent, const QString& title, const QString& text,
QMessageBox::StandardButtons buttons = QMessageBox::Ok);
static void warning(QWidget *parent, const QString& title, const QString& text,
QMessageBox::StandardButtons buttons = QMessageBox::Ok);
static void critical(QWidget *parent, const QString& title, const QString& text,
QMessageBox::StandardButtons buttons = QMessageBox::Ok);
//!< Calls onAnswer with the button pressed. Not called if the box is destroyed unanswered
static void question(QWidget *parent, const QString& title, const QString& text,
QMessageBox::StandardButtons buttons, std::function<void (QMessageBox::StandardButton)> onAnswer);
private:
static void show(QWidget *parent, QMessageBox::Icon icon, const QString& title,
const QString& text, QMessageBox::StandardButtons buttons,
std::function<void (QMessageBox::StandardButton)> onAnswer);
};
#endif // SDRGUI_GUI_MESSAGEDIALOG_H
Loading…
Cancel
Save