From b727ea65af3eadef044a32046313958ebd30ed7d Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Wed, 30 Apr 2014 01:05:42 +0200 Subject: [PATCH] refs #225, added validation message for remarks > 100chars --- src/blackgui/flightplancomponent.cpp | 9 +++++++-- src/blackgui/flightplancomponent.ui | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/blackgui/flightplancomponent.cpp b/src/blackgui/flightplancomponent.cpp index 1988ce2b8..50de640ef 100644 --- a/src/blackgui/flightplancomponent.cpp +++ b/src/blackgui/flightplancomponent.cpp @@ -105,7 +105,13 @@ namespace BlackGui flightPlan.setRoute(v); v = ui->pte_Remarks->toPlainText().trimmed(); - flightPlan.setRemarks(v); + if (v.length() > 100) + { + QString m = QString("Length exceeded (100 chars max.) %1").arg(this->ui->lbl_Remarks->text()); + messages.push_back(CStatusMessage::getValidationError(m)); + } + else + flightPlan.setRemarks(v); v = ui->le_EstimatedTimeEnroute->text(); if (v.isEmpty() || v == defaultTime()) @@ -176,7 +182,6 @@ namespace BlackGui else flightPlan.setCruiseTrueAirspeed(cruiseTAS); - v = this->ui->le_OriginAirport->text(); if (v.isEmpty() || v.endsWith(defaultIcao(), Qt::CaseInsensitive)) { diff --git a/src/blackgui/flightplancomponent.ui b/src/blackgui/flightplancomponent.ui index 7114ecdb0..bd6cf5a87 100644 --- a/src/blackgui/flightplancomponent.ui +++ b/src/blackgui/flightplancomponent.ui @@ -194,7 +194,11 @@ - + + + 1 + +