mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 11:05:33 +08:00
Ref T442, ATC station treeview
* store expand/collapsed state * resize * clear
This commit is contained in:
@@ -57,10 +57,16 @@ namespace BlackGui
|
||||
|
||||
void CAtcStationTreeModel::updateContainer(const CAtcStationList &stations)
|
||||
{
|
||||
if (stations.isEmpty())
|
||||
{
|
||||
CAtcStationTreeModel::clear();
|
||||
return;
|
||||
}
|
||||
|
||||
m_stations = stations.sortedByAtcSuffixSortOrderAndDistance();
|
||||
m_stationsBySuffix = m_stations.splitPerSuffix();
|
||||
m_suffixes = m_stations.getSuffixes();
|
||||
this->clear();
|
||||
QStandardItemModel::clear();
|
||||
|
||||
int visibleColumns = 0;
|
||||
for (const QString &suffix : m_suffixes)
|
||||
@@ -104,5 +110,19 @@ namespace BlackGui
|
||||
}
|
||||
this->setColumnCount(visibleColumns);
|
||||
}
|
||||
|
||||
void CAtcStationTreeModel::clear()
|
||||
{
|
||||
m_stations.clear();
|
||||
m_stationsBySuffix.clear();
|
||||
m_suffixes.clear();
|
||||
QStandardItemModel::clear();
|
||||
}
|
||||
|
||||
void CAtcStationTreeModel::changedAtcStationConnectionStatus(const CAtcStation &station, bool added)
|
||||
{
|
||||
Q_UNUSED(station);
|
||||
Q_UNUSED(added);
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user