*/
onCommand: function (element) {
- // if submenu
- if (element.menuID >= 0) {
+ if (element.commandID < 0) {
+
+ switch (element.commandID) {
+ case -1: {
+ FFW.BasicCommunication.ExitApplication(SDL.SDLAppController.model.appID);
+ break;
+ }
+ default: {
+ console.log("Unknown command with ID: " + element.commandID);
+ }
+ }
+ } else if (element.menuID >= 0) {
+ // if subMenu
// activate driver destruction if necessary
if (SDL.SDLModel.driverDistractionState) {
SDL.DriverDistraction.activate();
}
console.log(commands.length);
- FFW.UI.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
+ if (request.id >= 0) {
+ FFW.UI.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
+ }
} else {
FFW.UI.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, request.method, 'Adding more than 1000 item to the top menu or to submenu is not allowed.');
}