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