refs #452, removed some classes which will be replaced by new classes

* CAircraftMappings -> will be replace by CAircraftModel
* CAircraftIcaoData aircraft ICAO data -> aircraft/airline ICAO code and livery
* CAircraft class no longer to be used, but CSimulatedAircraft
* removed corresponding GUI model classes / filters
This commit is contained in:
Klaus Basan
2015-09-23 02:40:03 +02:00
committed by Mathew Sutcliffe
parent 51e8a6a208
commit 874f29098b
23 changed files with 1 additions and 1645 deletions

View File

@@ -1,68 +0,0 @@
/* Copyright (C) 2015
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
#include "listmodelfilter.h"
#include "blackmisc/simulation/aircraftmodellist.h"
namespace BlackGui
{
namespace Models
{
template<class ContainerType>
bool IModelFilter<ContainerType>::stringMatchesFilterExpression(const QString &value, const QString &filter, Qt::CaseSensitivity cs) const
{
QString v = value.trimmed();
QString f = filter.trimmed();
if (v.isEmpty() && f.isEmpty()) { return true; }
if (v.isEmpty()) { return false; }
// no wildcard, just string matching
if (!filter.contains('*'))
{
return (v.indexOf(f, 0, cs) == 0) &&
(v.length() == f.length());
}
const QString filterNoWildcard = stripWildcard(f);
// included?
if (f.startsWith('*') && f.endsWith('*'))
{
return v.contains(filterNoWildcard, cs);
}
// starting with
if (f.startsWith('*'))
{
return v.endsWith(filterNoWildcard, cs);
}
if (f.endsWith('*'))
{
return v.startsWith(filterNoWildcard, cs);
}
// should never happen
Q_ASSERT(false);
return false;
}
template<class ContainerType>
QString IModelFilter<ContainerType>::stripWildcard(const QString &value) const
{
QString sw(value);
return sw.remove('*');
}
// Forward instantiations
template class IModelFilter<BlackMisc::Simulation::CAircraftModelList>;
} // namespace
} // namespace

View File

@@ -1,48 +0,0 @@
/* Copyright (C) 2015
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKGUI_LISTMODELFILTER_H
#define BLACKGUI_LISTMODELFILTER_H
#include "blackgui/blackguiexport.h"
#include <QString>
namespace BlackGui
{
namespace Models
{
//! Model filter interface
template<class ContainerType> class IModelFilter
{
public:
//! Destructor
virtual ~IModelFilter() {}
//! Used container data
virtual ContainerType filter(const ContainerType &container) const = 0;
//! Anything to do?
virtual bool isValid() const = 0;
protected:
//! Standard string search supporting wildcard at begin and end: "*xyz", "abc*"
bool stringMatchesFilterExpression(const QString &value, const QString &filter, Qt::CaseSensitivity cs = Qt::CaseInsensitive) const;
//! Remove the * wildcards
QString stripWildcard(const QString &value) const;
};
} // namespace
} // namespace
#endif // guard

View File

@@ -1,39 +0,0 @@
/* Copyright (C) 2013
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
#include "aircraftmodelfilterform.h"
#include "ui_aircraftmodelfilterform.h"
using namespace BlackGui::Models;
namespace BlackGui
{
namespace Views
{
CAircraftModelFilterForm::CAircraftModelFilterForm(QWidget *parent) :
CFilterDialog(parent),
ui(new Ui::CAircraftModelFilterForm)
{
ui->setupUi(this);
this->setWindowTitle("Filter models");
}
CAircraftModelFilterForm::~CAircraftModelFilterForm()
{ }
std::unique_ptr<CAircraftModelFilter> CAircraftModelFilterForm::getFilter() const
{
QString model(this->ui->le_ModelString->text());
QString desc(this->ui->le_ModelDescription->text());
return std::unique_ptr<CAircraftModelFilter>(new CAircraftModelFilter(model, desc));
}
} // namespace
} // namespace

View File

@@ -1,51 +0,0 @@
/* Copyright (C) 2013
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKGUI_AIRCRAFTMODELFILTERFORM_H
#define BLACKGUI_AIRCRAFTMODELFILTERFORM_H
#include "blackgui/blackguiexport.h"
#include "filterdialog.h"
#include "blackgui/models/aircraftmodelfilter.h"
#include <QDialog>
#include <QScopedPointer>
#include <iostream>
#include <memory>
namespace Ui { class CAircraftModelFilterForm; }
namespace BlackGui
{
namespace Views
{
//! Form for a aircraft model filter
class BLACKGUI_EXPORT CAircraftModelFilterForm : public CFilterDialog
{
Q_OBJECT
public:
//! Constructor
explicit CAircraftModelFilterForm(QWidget *parent = nullptr);
//! Destructor
~CAircraftModelFilterForm();
//! Get created filter
std::unique_ptr<BlackGui::Models::CAircraftModelFilter> getFilter() const;
private:
QScopedPointer<Ui::CAircraftModelFilterForm> ui;
};
} // namespace
} // namespace
#endif // guard

View File

@@ -1,91 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CAircraftModelFilterForm</class>
<widget class="QDialog" name="CAircraftModelFilterForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>336</width>
<height>95</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="vl_AircraftModelFilterForm">
<item>
<layout class="QFormLayout" name="fl_FilterLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="lbl_ModelString">
<property name="text">
<string>Model</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="le_ModelString"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lbl_ModelDescription">
<property name="text">
<string>Description</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="le_ModelDescription"/>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="bb_ButtonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>bb_ButtonBox</sender>
<signal>accepted()</signal>
<receiver>CAircraftModelFilterForm</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>bb_ButtonBox</sender>
<signal>rejected()</signal>
<receiver>CAircraftModelFilterForm</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -1,37 +0,0 @@
/* Copyright (C) 2013
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
#include "filterdialog.h"
#include "blackgui/stylesheetutility.h"
namespace BlackGui
{
namespace Views
{
CFilterDialog::CFilterDialog(QWidget *parent) : QDialog(parent, Qt::Tool)
{
this->setWindowTitle("Filter dialog");
ps_onStyleSheetChanged();
connect(&CStyleSheetUtility::instance(), &CStyleSheetUtility::styleSheetsChanged, this, &CFilterDialog::ps_onStyleSheetChanged);
}
CFilterDialog::~CFilterDialog()
{ }
void CFilterDialog::ps_onStyleSheetChanged()
{
const QString qss = CStyleSheetUtility::instance().style(CStyleSheetUtility::fileNameFilterDialog());
this->setStyleSheet(qss);
}
} // namespace
} // namespace

View File

@@ -1,40 +0,0 @@
/* Copyright (C) 2013
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKGUI_FILTERDIALOG_H
#define BLACKGUI_FILTERDIALOG_H
#include "blackgui/blackguiexport.h"
#include <QDialog>
namespace BlackGui
{
namespace Views
{
//! Base for filter dialog
class BLACKGUI_EXPORT CFilterDialog : public QDialog
{
public:
//! Constructor
CFilterDialog(QWidget *parent = nullptr);
//! Destructor
virtual ~CFilterDialog();
private slots:
//! Stylesheet changed
void ps_onStyleSheetChanged();
};
} // namespace
} // namespace
#endif // guard