mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Fixes issues found during testing refs #568
* upper case in filters * validation of distributor (made distributor mandatory) * country change triggers filter
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "dbcountryselectorcomponent.h"
|
||||
#include "ui_dbcountryselectorcomponent.h"
|
||||
#include "blackgui/guiutility.h"
|
||||
#include "blackgui/uppercasevalidator.h"
|
||||
#include <QMimeData>
|
||||
|
||||
using namespace BlackGui;
|
||||
@@ -32,6 +33,8 @@ namespace BlackGui
|
||||
connect(ui->le_CountryName, &QLineEdit::returnPressed, this, &CDbCountrySelectorComponent::ps_dataChanged);
|
||||
connect(ui->le_CountryIso, &QLineEdit::editingFinished, this, &CDbCountrySelectorComponent::ps_dataChanged);
|
||||
connect(ui->le_CountryName, &QLineEdit::returnPressed, this, &CDbCountrySelectorComponent::ps_dataChanged);
|
||||
|
||||
this->ui->le_CountryIso->setValidator(new CUpperCaseValidator(this));
|
||||
}
|
||||
|
||||
CDbCountrySelectorComponent::~CDbCountrySelectorComponent()
|
||||
|
||||
@@ -61,12 +61,7 @@ namespace BlackGui
|
||||
CStatusMessageList CDistributorForm::validate() const
|
||||
{
|
||||
CDistributor distributor(getValue());
|
||||
CStatusMessageList msgs;
|
||||
if (!distributor.getDbKey().isEmpty())
|
||||
{
|
||||
// optional distributor
|
||||
msgs = distributor.validate();
|
||||
}
|
||||
CStatusMessageList msgs(distributor.validate());
|
||||
if (this->isReadOnly())
|
||||
{
|
||||
// in readonly I cannot change the data anyway, so skip warnings
|
||||
|
||||
@@ -9,10 +9,12 @@
|
||||
|
||||
#include "airlineicaofilterbar.h"
|
||||
#include "ui_airlineicaofilterbar.h"
|
||||
#include "blackgui/uppercasevalidator.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackGui::Models;
|
||||
using namespace BlackGui::Components;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -27,6 +29,9 @@ namespace BlackGui
|
||||
|
||||
connect(ui->le_Designator, &QLineEdit::returnPressed, this, &CFilterWidget::triggerFilter);
|
||||
connect(ui->le_Name, &QLineEdit::returnPressed, this, &CFilterWidget::triggerFilter);
|
||||
connect(ui->country_Selector, &CDbCountrySelectorComponent::countryChanged, this, &CAirlineIcaoFilterBar::ps_CountryChanged);
|
||||
|
||||
ui->le_Designator->setValidator(new CUpperCaseValidator(this));
|
||||
}
|
||||
|
||||
CAirlineIcaoFilterBar::~CAirlineIcaoFilterBar() { }
|
||||
@@ -73,6 +78,14 @@ namespace BlackGui
|
||||
this->ui->filter_Buttons->onRowCountChanged(count, withFilter);
|
||||
}
|
||||
|
||||
void CAirlineIcaoFilterBar::ps_CountryChanged(const CCountry &country)
|
||||
{
|
||||
if (country.hasIsoCode())
|
||||
{
|
||||
this->ui->filter_Buttons->clickButton(CFilterBarButtons::Filter);
|
||||
}
|
||||
}
|
||||
|
||||
void CAirlineIcaoFilterBar::clearForm()
|
||||
{
|
||||
this->ui->le_Designator->clear();
|
||||
|
||||
@@ -55,6 +55,10 @@ namespace BlackGui
|
||||
//! \copydoc CFilterWidget::onRowCountChanged
|
||||
virtual void onRowCountChanged(int count, bool withFilter) override;
|
||||
|
||||
private slots:
|
||||
//! Country has been changed
|
||||
void ps_CountryChanged(const BlackMisc::CCountry &country);
|
||||
|
||||
protected:
|
||||
//! Clear form
|
||||
virtual void clearForm() override;
|
||||
|
||||
Reference in New Issue
Block a user