From 3e25b1f6469209301fa0a67965ef90423735a185 Mon Sep 17 00:00:00 2001 From: Patrick Linstruth Date: Wed, 22 May 2019 13:04:29 -0700 Subject: [PATCH 1/2] Exit gracefully if no softkey definitions are found --- utils/rdsoftkeys/rdsoftkeys.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; } From eab64a8ccceceae12999f3c5e73627f4e5d5c546 Mon Sep 17 00:00:00 2001 From: Patrick Linstruth Date: Wed, 22 May 2019 13:06:22 -0700 Subject: [PATCH 2/2] Updated ChangeLog --- ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index ed0cfae2..27af78d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18678,3 +18678,6 @@ '--end-startup-after-rdpadengined', '--end-startup-after-rdvairplayd', and '--end-startup-after-rdrepld' command line switches to rdservice(8). +2019-05-22 Patrick Linstruth + * Display error dialog in rdsoftkeys(1) if no defintions are + found in map file.