diff --git a/ChangeLog b/ChangeLog index c1a5caff..3fab6f6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18681,3 +18681,6 @@ 2019-05-19 Patrick Linstruth * Fixed bug in 'RDCartDialog' that caused an empty scheduler code dropdown box. +2019-05-23 Patrick Linstruth + * Display error dialog in rdsoftkeys(1) if no defintions are + found in map file. diff --git a/utils/rdsoftkeys/rdsoftkeys.cpp b/utils/rdsoftkeys/rdsoftkeys.cpp index c3b59a8a..2219cc5f 100644 --- a/utils/rdsoftkeys/rdsoftkeys.cpp +++ b/utils/rdsoftkeys/rdsoftkeys.cpp @@ -157,6 +157,17 @@ MainWidget::MainWidget(QWidget *parent) } n++; } + + // + // If no softkeys have been defined, gracefully exit + // + if (!key_macros.size()) { + QMessageBox::critical(this, tr("RDSoftKeys"), + tr(QString("No SoftKey definitions found in file\n%1") + .arg(map_filename))); + exit(1); + } + if((key_macros.size()%key_columns)==0) { key_ysize-=60; }