mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
Some refactoring for model base / view base
* update by int index (row) * updateContainer renaming
This commit is contained in:
@@ -35,11 +35,11 @@ namespace BlackGui
|
||||
|
||||
if (this->getIContextNetwork()->isConnected())
|
||||
{
|
||||
this->ui->tvp_AircraftsInRange->update(this->getIContextNetwork()->getAircraftsInRange());
|
||||
this->ui->tvp_AircraftsInRange->updateContainer(this->getIContextNetwork()->getAircraftsInRange());
|
||||
}
|
||||
if (this->getIContextSimulator()->isConnected())
|
||||
{
|
||||
this->ui->tvp_AirportsInRange->update(this->getIContextSimulator()->getAirportsInRange());
|
||||
this->ui->tvp_AirportsInRange->updateContainer(this->getIContextSimulator()->getAirportsInRange());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace BlackGui
|
||||
if (this->m_timestampOnlineStationsChanged.isNull() || this->m_timestampLastReadOnlineStations.isNull() ||
|
||||
(this->m_timestampOnlineStationsChanged > this->m_timestampLastReadOnlineStations))
|
||||
{
|
||||
this->ui->tvp_AtcStationsOnline->update(this->getIContextNetwork()->getAtcStationsOnline());
|
||||
this->ui->tvp_AtcStationsOnline->updateContainer(this->getIContextNetwork()->getAtcStationsOnline());
|
||||
this->m_timestampLastReadOnlineStations = QDateTime::currentDateTimeUtc();
|
||||
this->m_timestampOnlineStationsChanged = this->m_timestampLastReadOnlineStations;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ namespace BlackGui
|
||||
}
|
||||
else
|
||||
{
|
||||
this->ui->tvp_AtcStationsBooked->update(this->getIContextNetwork()->getAtcStationsBooked());
|
||||
this->ui->tvp_AtcStationsBooked->updateContainer(this->getIContextNetwork()->getAtcStationsBooked());
|
||||
this->m_timestampLastReadBookedStations = QDateTime::currentDateTimeUtc();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ namespace BlackGui
|
||||
if (room1.isConnected())
|
||||
{
|
||||
this->ui->le_CockpitVoiceRoomCom1->setStyleSheet("background: green");
|
||||
if (this->getIContextAudio()) this->ui->tvp_CockpitVoiceRoom1->update(this->getIContextAudio()->getCom1RoomUsers());
|
||||
if (this->getIContextAudio()) this->ui->tvp_CockpitVoiceRoom1->updateContainer(this->getIContextAudio()->getCom1RoomUsers());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -379,12 +379,12 @@ namespace BlackGui
|
||||
{
|
||||
if (!this->getIContextAudio()) return;
|
||||
if (!this->ui->le_CockpitVoiceRoomCom1->text().trimmed().isEmpty())
|
||||
this->ui->tvp_CockpitVoiceRoom1->update(this->getIContextAudio()->getCom1RoomUsers());
|
||||
this->ui->tvp_CockpitVoiceRoom1->updateContainer(this->getIContextAudio()->getCom1RoomUsers());
|
||||
else
|
||||
this->ui->tvp_CockpitVoiceRoom1->clear();
|
||||
|
||||
if (!this->ui->le_CockpitVoiceRoomCom2->text().trimmed().isEmpty())
|
||||
this->ui->tvp_CockpitVoiceRoom2->update(this->getIContextAudio()->getCom2RoomUsers());
|
||||
this->ui->tvp_CockpitVoiceRoom2->updateContainer(this->getIContextAudio()->getCom2RoomUsers());
|
||||
else
|
||||
this->ui->tvp_CockpitVoiceRoom2->clear();
|
||||
}
|
||||
|
||||
@@ -106,10 +106,10 @@ namespace BlackGui
|
||||
|
||||
// update servers
|
||||
this->ui->tvp_SettingsTnServers->setSelectedServer(nws.getCurrentTrafficNetworkServer());
|
||||
this->ui->tvp_SettingsTnServers->update(nws.getTrafficNetworkServers());
|
||||
this->ui->tvp_SettingsTnServers->updateContainer(nws.getTrafficNetworkServers());
|
||||
|
||||
// update hot keys
|
||||
this->ui->tvp_SettingsMiscHotkeys->update(this->getIContextSettings()->getHotkeys());
|
||||
this->ui->tvp_SettingsMiscHotkeys->updateContainer(this->getIContextSettings()->getHotkeys());
|
||||
|
||||
// fake setting for sound notifications
|
||||
this->ui->cb_SettingsAudioPlayNotificationSounds->setChecked(true);
|
||||
|
||||
@@ -34,8 +34,8 @@ namespace BlackGui
|
||||
|
||||
if (this->getIContextNetwork()->isConnected())
|
||||
{
|
||||
this->ui->tvp_Clients->update(this->getIContextNetwork()->getOtherClients());
|
||||
this->ui->tvp_AllUsers->update(this->getIContextNetwork()->getUsers());
|
||||
this->ui->tvp_Clients->updateContainer(this->getIContextNetwork()->getOtherClients());
|
||||
this->ui->tvp_AllUsers->updateContainer(this->getIContextNetwork()->getUsers());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user