mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Added an (experimental) tree view to ATC stations
This commit is contained in:
@@ -23,27 +23,14 @@ namespace BlackGui
|
||||
CAtcStationView::CAtcStationView(QWidget *parent) : CViewBase(parent)
|
||||
{
|
||||
this->standardInit(new CAtcStationListModel(CAtcStationListModel::StationsOnline, this));
|
||||
this->m_withMenuItemClear = true;
|
||||
this->m_withMenuItemRefresh = true;
|
||||
}
|
||||
|
||||
void CAtcStationView::setStationMode(CAtcStationListModel::AtcStationMode stationMode)
|
||||
{
|
||||
Q_ASSERT(this->m_model);
|
||||
this->m_model->setStationMode(stationMode);
|
||||
this->m_withMenuItemClear = true;
|
||||
this->m_withMenuItemRefresh = true;
|
||||
|
||||
switch (stationMode)
|
||||
{
|
||||
case CAtcStationListModel::NotSet:
|
||||
case CAtcStationListModel::StationsOnline:
|
||||
this->m_model->setSortColumnByPropertyIndex(BlackMisc::Aviation::CAtcStation::IndexDistance);
|
||||
break;
|
||||
case CAtcStationListModel::StationsBooked:
|
||||
this->m_model->setSortColumnByPropertyIndex(BlackMisc::Aviation::CAtcStation::IndexBookedFrom);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this->setSortIndicator();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace BlackGui
|
||||
namespace Views
|
||||
{
|
||||
//! ATC stations view
|
||||
class CAtcStationView : public CViewBase<Models::CAtcStationListModel, BlackMisc::Aviation::CAtcStationList, BlackMisc::Aviation::CAtcStation>
|
||||
class CAtcStationView : public CViewBase<BlackGui::Models::CAtcStationListModel, BlackMisc::Aviation::CAtcStationList, BlackMisc::Aviation::CAtcStation>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace BlackGui
|
||||
explicit CAtcStationView(QWidget *parent = nullptr);
|
||||
|
||||
//! Set station mode
|
||||
void setStationMode(Models::CAtcStationListModel::AtcStationMode stationMode);
|
||||
void setStationMode(BlackGui::Models::CAtcStationListModel::AtcStationMode stationMode);
|
||||
|
||||
signals:
|
||||
//! Request some dummy ATC stations
|
||||
|
||||
Reference in New Issue
Block a user