mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-30 05:51:23 +08:00
refs #358, aircrafts -> aircraft in GUI
This commit is contained in:
@@ -31,17 +31,17 @@ namespace BlackGui
|
|||||||
this->ui->tvp_AirportsInRange->setResizeMode(CAirportView::ResizingOnce);
|
this->ui->tvp_AirportsInRange->setResizeMode(CAirportView::ResizingOnce);
|
||||||
m_updateTimer = new CUpdateTimer(SLOT(update()), this);
|
m_updateTimer = new CUpdateTimer(SLOT(update()), this);
|
||||||
|
|
||||||
connect(this->ui->tvp_AircraftsInRange, &CAircraftView::countChanged, this, &CAircraftComponent::ps_countChanged);
|
connect(this->ui->tvp_AircraftInRange, &CAircraftView::countChanged, this, &CAircraftComponent::ps_countChanged);
|
||||||
connect(this->ui->tvp_AirportsInRange, &CAircraftView::countChanged, this, &CAircraftComponent::ps_countChanged);
|
connect(this->ui->tvp_AirportsInRange, &CAircraftView::countChanged, this, &CAircraftComponent::ps_countChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
CAircraftComponent::~CAircraftComponent()
|
CAircraftComponent::~CAircraftComponent()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
int CAircraftComponent::countAircrafts() const
|
int CAircraftComponent::countAircraft() const
|
||||||
{
|
{
|
||||||
Q_ASSERT(this->ui->tvp_AircraftsInRange);
|
Q_ASSERT(this->ui->tvp_AircraftInRange);
|
||||||
return this->ui->tvp_AircraftsInRange->rowCount();
|
return this->ui->tvp_AircraftInRange->rowCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
int CAircraftComponent::countAirportsInRange() const
|
int CAircraftComponent::countAirportsInRange() const
|
||||||
@@ -52,16 +52,16 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CAircraftComponent::update()
|
void CAircraftComponent::update()
|
||||||
{
|
{
|
||||||
Q_ASSERT(this->ui->tvp_AircraftsInRange);
|
Q_ASSERT(this->ui->tvp_AircraftInRange);
|
||||||
Q_ASSERT(this->getIContextNetwork());
|
Q_ASSERT(this->getIContextNetwork());
|
||||||
Q_ASSERT(this->getIContextSimulator());
|
Q_ASSERT(this->getIContextSimulator());
|
||||||
|
|
||||||
if (this->getIContextNetwork()->isConnected())
|
if (this->getIContextNetwork()->isConnected())
|
||||||
{
|
{
|
||||||
bool visible = (this->isVisibleWidget() && this->currentWidget() == this->ui->tb_AircraftsInRange);
|
bool visible = (this->isVisibleWidget() && this->currentWidget() == this->ui->tb_AircraftInRange);
|
||||||
if (this->countAircrafts() < 1 || visible)
|
if (this->countAircraft() < 1 || visible)
|
||||||
{
|
{
|
||||||
this->ui->tvp_AircraftsInRange->updateContainer(this->getIContextNetwork()->getAircraftInRange());
|
this->ui->tvp_AircraftInRange->updateContainer(this->getIContextNetwork()->getAircraftInRange());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this->getIContextSimulator()->isConnected())
|
if (this->getIContextSimulator()->isConnected())
|
||||||
@@ -94,11 +94,11 @@ namespace BlackGui
|
|||||||
void CAircraftComponent::ps_countChanged(int count)
|
void CAircraftComponent::ps_countChanged(int count)
|
||||||
{
|
{
|
||||||
Q_UNUSED(count);
|
Q_UNUSED(count);
|
||||||
int ac = this->indexOf(this->ui->tb_AircraftsInRange);
|
int ac = this->indexOf(this->ui->tb_AircraftInRange);
|
||||||
int ap = this->indexOf(this->ui->tb_AirportsInRange);
|
int ap = this->indexOf(this->ui->tb_AirportsInRange);
|
||||||
QString acs = this->tabBar()->tabText(ac);
|
QString acs = this->tabBar()->tabText(ac);
|
||||||
QString aps = this->tabBar()->tabText(ap);
|
QString aps = this->tabBar()->tabText(ap);
|
||||||
acs = CGuiUtility::replaceTabCountValue(acs, this->countAircrafts());
|
acs = CGuiUtility::replaceTabCountValue(acs, this->countAircraft());
|
||||||
aps = CGuiUtility::replaceTabCountValue(aps, this->countAirportsInRange());
|
aps = CGuiUtility::replaceTabCountValue(aps, this->countAirportsInRange());
|
||||||
this->tabBar()->setTabText(ac, acs);
|
this->tabBar()->setTabText(ac, acs);
|
||||||
this->tabBar()->setTabText(ap, aps);
|
this->tabBar()->setTabText(ap, aps);
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ namespace BlackGui
|
|||||||
//! Timer for updating
|
//! Timer for updating
|
||||||
CUpdateTimer *getTimerComponent() { return this->m_updateTimer; }
|
CUpdateTimer *getTimerComponent() { return this->m_updateTimer; }
|
||||||
|
|
||||||
//! Aircrafts in range
|
//! Aircraft in range
|
||||||
int countAircrafts() const;
|
int countAircraft() const;
|
||||||
|
|
||||||
//! Airports in range
|
//! Airports in range
|
||||||
int countAirportsInRange() const;
|
int countAirportsInRange() const;
|
||||||
|
|||||||
@@ -22,9 +22,9 @@
|
|||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tb_AircraftsInRange">
|
<widget class="QWidget" name="tb_AircraftInRange">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Aircrafts in range</string>
|
<string>Aircraft in range</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="vl_AircraftsInRange">
|
<layout class="QVBoxLayout" name="vl_AircraftsInRange">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="BlackGui::Views::CAircraftView" name="tvp_AircraftsInRange">
|
<widget class="BlackGui::Views::CAircraftView" name="tvp_AircraftInRange">
|
||||||
<attribute name="verticalHeaderVisible">
|
<attribute name="verticalHeaderVisible">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
|||||||
@@ -194,7 +194,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Aircrafts</string>
|
<string>Aircraft</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
|||||||
Reference in New Issue
Block a user